Cabbage Logo
Back to Cabbage Site

Incongrous pitches only when running file via Cabbage

Ok so, as the title states, something really weird is happening to me. Basically I wanted to hear what the Csound manual example for nreverb sounds like so I went to Program Files/Csound6_x64/doc/manual/examples/ (I use Windows).

I listened to the example by opening a CMD terminal from that directory, and running csound nreverb.csd -odac. Sounds good. So I want to open it in Cabbage for some reason, so I find the text file (nreverb.csd) and open it with Cabbage.

When I hit play in Cabbage, I get the exact same audio sound but at a higher pitch and faster! It’s a small interval, and I’d almost say it may compare to the interval that you get when there’s a mismatch between 44100 and 48000 Hz.

I cannot explain it. Definitely the same file. Very simple code. The frequency of the oscillator is hard-coded as a constant. You can see the text of the example in the Csound manual. It’s just a series of sine-wave tones sent through the nreverb opcode. I tried turning off the nreverb and the incogruity is still there, just without reverb. I tried changing sr in the file - result doesn’t change. I would have tried to change the sample rate in Cabbage>Edit>Settings but the only option available is 48000.

Did you try removing the sr=44100 in the Csound file? Doing so will let Cabbage choose the correct sampling rate based on its audio settings. It’s good practice to leave the sr assignment out of all Cabbage instruments as it means the host will set the sr, thus removing any chance of resampling. By leaving the sr in place, it will force the orc to run at that sampling rate, which might not match that of the host.

Note that my Windows audio drivers only let me choose 44.1kHz. I have 3 other ASIO drivers. " of them let me choose 48kHz, while the other only lets me set 44., or 88. I might sure there is anything Cabbage can do about this. It just lists what the drivers report as far as I know.

Ok, removing sr=44100 solved it. Thank you!

1 Like