How can I get the current sample rate?

Jan 14, 2011 at 12:48am

How can I get the current sample rate?

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

#54403
Jan 14, 2011 at 12:56am

[dspstate~]

#195866
Jan 15, 2011 at 12:21am

Perfect. Thanks:)

#195867
Jan 15, 2011 at 8:14am

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!*

#195868
Jan 15, 2011 at 11:36am

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 :)

#195869
Jan 16, 2011 at 1:14am

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!*

#195870
Jan 16, 2011 at 1:17am

“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?!)

#195871
Jan 16, 2011 at 1:20am

I have homework I should be doing……

#195872
Jan 16, 2011 at 1:26am

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

#195873
Jan 16, 2011 at 1:31am

: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!*

#195874
Jan 16, 2011 at 1:31am

as do I :p

I may have to start using [adstatus] now

#195875
Jan 16, 2011 at 1:48am

@tim
adstatus = bliss

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

#195876
Jan 16, 2011 at 5:13am

if only all our homework was max-based.

#195877

You must be logged in to reply to this topic.