One interesting happens, I believe the main reason is sample rate in Csound.
When I use the example you gave me with ‘diskin2’ opcode, your original sample rate was set to 48000 and it works perfect with AudioSource pitch to 1, but when I set that to 44100, it behave just like my .csd file that you have to adjust that pitch to ‘0.92’ in Unity to play the normal pitch.
But when I changed the sample rate in my Csound file (with ‘tempscal’ opcode) to 48000 (originally was 44100), nothing happens and you still need to set pitch to ‘0.92’, and I even tried to change the my Csound sample rate to ‘32Hz’ and it’s still the same, when I set sample rate below 32 Hz in my Csound file it stopped playing. Which is really weird.
I believe either tempscal, ftgentmp or GEN01 (coz I used GEN01 to pass my audio file to tempscal) ignore or have an error with the sample rate we set in the header of Csound file.
But anyway, I would really appreciate if you can help me try this out tomorrow. I’ll also keep trying this until the problem has been resolved.
I think there’s nothing to do with your CsoundUnity API but Csound itself. Maybe I should try some other opcode and stop using GEN01 and see if that will work.