Cabbage Logo
Back to Cabbage Site

Get Sample Rate and bitdepth from Daw

Hi Guys,
i’m new to the whole situation and i’m trying to cook my first plugin.

In a lot of examples i see that the Sample Rate value sr is set as constant at 44100.

So my question is: there’s a way to obtain Sample rate and also bitdepth from the host Daw in order to follow the ones in the project?

Thank you a lot
Red

If you leave out any sr assignment in the Csound file the DAW’s sample rate will be used instead. If you need to get the DAW’s sampling rate you can just us sr in your code. For example, teh following code will print whatever SR the DAW is using:

<CsInstruments>
nchnls = 2

instr 1
    print sr
endin

</CsInstruments>

If you load this in the Cabbage IDE itself, Csound will use whatever SR is set in the Cabbage Audio Settings :wink:

Thanks! just to bother you a little more i was trying to implement 2 parmetric eq in my plugin but without luck. it’s better to open another topic?

Thanks @ilrosso, that would be best. Then others might be able to find the information with a search :wink: