Hi, I'm using an Arduino Uno R3 to run Mozzi, but I get errors regarding how much dynamic memory the global variables are using.
I tried compiling code from other people's tutorials to test if my code is the problem, but when I try to compile the same code that worked in the tutorials I also run out of memory,
I've put my code below and attached the "d_kit.h" in a zip file. Are there any issues in how I'm using the library which is causing memory problems?
#include <Mozzi.h>
#include <Sample.h> // Sample template
#include "d_kit.h"
//#define OUTPUTSCALING 9
int readV = A5;
int val = 0;
int lastVal = 0;
Sample <BD_NUM_CELLS, AUDIO_RATE> aBD(BD_DATA);
//Sample <SD_NUM_CELLS, AUDIO_RATE> aSD(SD_DATA);
//Sample <CH_NUM_CELLS, AUDIO_RATE> aCH(CH_DATA);
//Sample <OH_NUM_CELLS, AUDIO_RATE> aOH(OH_DATA);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
startMozzi();
// Initialise all samples to play at the speed it was recorded
aBD.setFreq((float) D_SAMPLERATE / (float) BD_NUM_CELLS);
//aSD.setFreq((float) D_SAMPLERATE / (float) SD_NUM_CELLS);
//aCH.setFreq((float) D_SAMPLERATE / (float) CH_NUM_CELLS);
//aOH.setFreq((float) D_SAMPLERATE / (float) OH_NUM_CELLS);
}
void loop() {
audioHook();
}
void updateControl() {
val = analogRead(readV);
Serial.println(val);
if (val >= 50 && lastVal < 50)
{
aBD.start();
}
else
{
}
lastVal = val;
}
AudioOutput_t updateAudio(){
int16_t d_sample = aBD.next(); //+ aSD.next() + aCH.next() + aOH.next();
return MonoOutput::fromNBit(10, d_sample);
}
[d_kit.zip](https://github.com/user-attachments/files/16172953/d_kit.zip)
Hi, I'm using an Arduino Uno R3 to run Mozzi, but I get errors regarding how much dynamic memory the global variables are using.
I tried compiling code from other people's tutorials to test if my code is the problem, but when I try to compile the same code that worked in the tutorials I also run out of memory,
I've put my code below and attached the "d_kit.h" in a zip file. Are there any issues in how I'm using the library which is causing memory problems?