Forums > MaxMSP

How can I get the current sample rate?

January 14, 2011 | 12:48 am

Hi,
I think this should be an easy thing to do, but I can’t seem to find the answer. I’m using hostsync to get transport info from rewire. It outputs the tempo in samples per beat. I need to use the current sample rate in order to calculate the BPM tempo, but I don’t know how to retrieve the sample rate in Max. Is is possible?

Thanks,
Joe


January 14, 2011 | 12:56 am

[dspstate~]


January 15, 2011 | 12:21 am

Perfect. Thanks:)


January 15, 2011 | 8:14 am

I prefer [adstatus sr] because it reports the ‘correct’ sampling rate even while DSP is off(example, start up Max, and in a blank new patcher create both objects: one [dspstate~] and one [adstatus sr]. change your sampling rate to 48000 without turning audio on, send a bang to [dspstate~] and also to [adstatus sr] still without turning audio on. result: on my computer [dspstate~] sends incorrectly the sample-rate of 44100(default? i don’t know why) but [adstatus sr] will show the correct value of 48000). [adstatus] help file also shows that how [adstatus] can give you much more access to other things good to learn.

________________________________
*Never fear, Noob4Life was never here!*


January 15, 2011 | 11:36 am

Aha…that is good to know! Although I think [dspstate~] will spit out the correct info as soon as audio processing is turned on even without a bang, which must be why I’ve never had a problem with it :)


January 16, 2011 | 1:14 am

true, but then [adstatus sr] does the same thing when audio processing is turned on even without a bang as well.

(i wonder what is dspstate~ good for then if it simply duplicates adstatus functionality but… somewhat poorly)

________________________________
*Never fear, Noob4Life was never here!*


January 16, 2011 | 1:17 am

"i wonder what is dspstate~ good for then if it simply duplicates adstatus functionality but… somewhat poorly"

probably just a nice all-in-one-without-arguments solution from the olden days?

(Noob! don’t you have homework you should be doing?!)


January 16, 2011 | 1:20 am

I have homework I should be doing……


January 16, 2011 | 1:26 am

(ha, Tim, sorry for my younger rambunctious distant-cousin’s boredom. he likes the distraction of these forums i guess…)


January 16, 2011 | 1:31 am

:D ^ (this forum is just so much more interesting than cs homework)

but raja, it’s saturday, eat my signature:
________________________________
*Never fear, Noob4Life was never here!*


January 16, 2011 | 1:31 am

as do I :p

I may have to start using [adstatus] now


January 16, 2011 | 1:48 am

@tim
adstatus = bliss

@arun
don’t make me come over there! >.<


January 16, 2011 | 5:13 am

if only all our homework was max-based.


Viewing 13 posts - 1 through 13 (of 13 total)