Changing Axoloti's Sample Rate?


#1

Hi there,

I was looking over the "Creating AXO objects" thread (https://sebiik.github.io/community.axoloti.com.backup/t/creating-axo-objects/481) and the author mentions in passing:

Sample rates are defined in the firmware app/firmware/axoloti_defines.h
The sample rate is defined by the macro SAMPLERATE.
The number of audio samples corresponding to one control rate sample is defined by the macro BUFSIZE , so a buffersize 16 results a krate of 48000/16 = 3000.

Since I'm in the process of coding a poly-synth that is eating up CPU resources, this made me wonder if all I had to do to lower the sample rate is to lower the number at the end of the line:

.#define SAMPLERATE 48000

from axoloti_defines.h? This seems way too easy to change something so central to how Axoloti functions, so since I'm still new to coding I thought I'd ask here before I tried something that messed up my board.

Anyways, the gist of my question is, Is it possible to change Axoloti's sample rate? And if so, is it as simple as changing the SAMPLERATE definition in axoloti_defines.h or (as I suspect) is it a much more involved process?


#2

The configuration for the SAI and codec would have to change as well- and you typically can't set any old value.
You'd have to check the driver code to see if it does the right thing for your value.


#3

this has been discussed previously

summary, no you cant just change that definition and it all work :wink:


#4

Thanks for the pointers @deadsy and @thetechnobear. I assumed there was a good deal more to it.