Hi everyone,
is there a way to access the current sample rate value Pd is set to inside [expr]?
Making a variable like this would do the trick, but I was wondering wether there's already a built-in way to do it.
Thanks in advance.
Access sample rate inside [expr]
Hi everyone,
is there a way to access the current sample rate value Pd is set to inside [expr]?
Making a variable like this would do the trick, but I was wondering wether there's already a built-in way to do it.
Thanks in advance.
Hi, I don't think there's any built-in variable in Pd. It has to be created just like you did. So I'm pretty certain that your method is the only way to use sample rate value in [expr].
@cuinjune Thanks. I was hoping for a built in way so that I don't need to update the variable every time the sample rate changes. Anyway, the new expr help file is pretty comprehensive so I think that if a feature is not documented there, then it may well not exist.
By doing as below, the variable can be updated as soon as the sample rate gets changed.
Or you can change '$17' to 'bang' and connect its outlet to inlet of [samplerate~] which I think is safer.
@cuinjune Thanks! Great solution.
Oops! Looks like something went wrong!