Dan Stowell
Dan Stowell

Reputation: 4758

SuperCollider access sample rate in a synthdef

how to find/get the samplerate number that SuperCollider is running into a patch as a variable?

Upvotes: 2

Views: 287

Answers (1)

Dan Stowell
Dan Stowell

Reputation: 4758

Use the SampleRate.ir ugen, which always returns the current sample rate.

Note that using s.sampleRate is not the best answer - it gets you the sample rate at the time the synthdef is compiled, not the sample rate at the time the synth is running...

Upvotes: 4

Related Questions