how to match system sample rate on start?

nk.s's icon

Is there a way to make a patcher find the current audio sampling rate, then match it? For example, if I last used a patch at 44.1kHz, but if I reopen the patch after my system has been set to 96kHz - Max seems to always force the audio device back to 44.1. Is there a way to make it automatically switch to the current sample rate?

I've found "adstats sr", but I can't find a way to change the current patch settings on start up.

Roman Thilenius's icon

first post deleted

new answer:

normally it should keep such settings, but it doesnt work with all drivers and devices.

what you can do (==what i did) is hacking into the settings window and add a preset object with 2 or 3 of your preferred settings.

otherwise the initialisation of these settings is left to the patcher(s), so you would do all the adstats stuff in your main patcher and/or make sure that you dont do it multiple times.

Source Audio's icon

Patch itself has nothing to do with sample rate, only in case one tries to enforce it
using embeded messages to dsp, like
;
dsp sr 44100

or using adstatus sr object.

In normal case Max or standalone loads last set audio driver, device, sr and all other
dsp settings from preferences file.

Roman Thilenius's icon


that never worked for me. as soon as "motu" was one time not available when called, then another IO driver was used, next time "motu" defaulted back to another vectorsize than what it should be.

Source Audio's icon

Till Max 6, preferences per Audio Device did include all needed settings

From Max 6 up, that is not the case anymore (we are on Mac , right ?)
Also selection of Driver and Devices is different
Max 4.6

Max 6.1.10

In Max 6 all devices that apear under coreaudio share same settings, only last prefered
I/O Device gets set.

So to say, only if no audio driver at all gets found, Max will use default settings for
iovs and sigvs 512/64
Otherwise it will keep last set values.
Max loads all preferences before any patch gets loaded.
If you want to enforce audio settings like sr, vector sizes etc
include messages to dsp in the patch, like
;
dsp sigvs 32

here is one example of controlled dsp settings and order of activation of audio driver
in respect to other loading processes, like loading plugins etc, which need to
have dsp active in order to get set to wished state...


nk.s's icon

This is all great info, thanks all! It seems to show that what I was trying to do is not possible. Max has numerous ways to control the audio device, but not the other way around.