PD can sense the current sample rate via [samplerate] i suppose.
Can it also set the required sample rate per patch/project?

    No, sample rate is fixed across all programs at the moment. It is 44.1kHz if you are on a Bela or BelaMini, and 48kHz if you are on a CTAG.

    The sample rate setting you see in the IDE Is only for the analog inputs and outputs, but it is ignored for Pd, where it is always the same (22.05kHz or 24kHz respectively), but is upsampled internally to match the one of the audio.

    @giuliomoro Ah, bummer.
    • Does that man, that PD doesn't run on 44.1 internally? Asking because obviously generative music patches out of PD would need full frequency response.
    • What other way could there be to switch sample rate per patch on analog inputs and outputs? Could i potentially hardwire a switch somehow, which i could use on the fly to enable 8 instead of 4 analog ins (Bela Mini here) - but only when needed?

    Generally i notice, that the 22.05 KHz setting from the IDE seems to cost hi freq detail when working with audio from PD. It sounds like the smaple rate is also lowered on the audio ins and outs. (?) I haven't tried, but potentially
    • Could i use analog faders on digital ins in audio mode at 22.05 KHz? If so, how? In that case one would much rarely need to switch from 4 to 8 analog ins anymore.

    Thank you much in advance!

      sorry I should have said

      jayrope PD can sense the current sample rate via [samplerate] i suppose.

      YES, as usual

      jayrope Can it also set the required sample rate per patch/project?

      the response to this was the one I wrote above. However ...

      jayrope Generally i notice, that the 22.05 KHz setting from the IDE seems to cost hi freq detail when working with audio from PD.

      Actually, you are right and I forgot about it: the sampling rate you specify there for the analogs is actually used, and the channels are internally resampled as needed to reach 44.1kHz. Note that the resampling is nothing fancy, just zero-order hold to go from 22.05k to 44.1k, or dropping samples going from 88.2k to 44.1k.

      jayrope It sounds like the smaple rate is also lowered on the audio ins and outs. (?) I haven't tried, but potentially

      NO, the audio sample rate is always fixed at 44.1k or 48k.

      jayrope • Does that man, that PD doesn't run on 44.1 internally? Asking because obviously generative music patches out of PD would need full frequency response.

      On Bela, Pd always runs at 44.1kHz or 48kHz, as explained above. Outside Bela, it runs at whatever sampling rate you set it to. As usual, you can upsample / downsample individual subwindows.

      jayrope • What other way could there be to switch sample rate per patch on analog inputs and outputs? Could i potentially hardwire a switch somehow, which i could use on the fly to enable 8 instead of 4 analog ins (Bela Mini here) - but only when needed?

      That could be done. It requires a tiny bit of bash scripting. You'd need to restart the program for the change to take effect.

      jayrope • Could i use analog faders on digital ins in audio mode at 22.05 KHz? If so, how? In that case one would much rarely need to switch from 4 to 8 analog ins anymore.

      Analog faders on digital ins? How would that work?

      a year later

      Hi, is it actually possible to switch analog outputs sample rate to 44100? If so, can you please elaborate on that "bash scripting" thing? Thanks!

      If you want the analog outs at 44.1kHz and you only have one patch running at boot, then just:

      • set the analog sampling rate in the IDE
      • set the patch to run on boot (this needs to be done after the previous step)
      • done

      Is this enough for your use case?

      9 months later

      Thanks @giuliomoro This works when the Bela is plugged into the IDE. Is there a way to have the settings persist if I am running off a battery?

      Sure, you need to set the project running on boot to •none• and then set it back to your project. This will apply the new settings

      So basically turn it off and on again... I feel silly, but this is super helpful. Thank you!