You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-> the compilation work. The problem seems linked to the stereo mode.
Try 2 - Find the disturbing element
I was able to find what make a mess but I don't uderstant why ^^. Moving the function definition of callback_updateEncodeurRotatif() after updateAudio and the sketch is compiled witout error :
//********************************************************************// 2023 Djevahirdjian Léo//// Bug Stereo - Minimal Code////********************************************************************//********************************************************************// DEFINITIONS - Interface//********************************************************************// Rotary encoder
# defineROT_PIN06
# defineROT_PIN17
#include<RotaryEncoder.h>
RotaryEncoder *interface_encodeurRotatif = nullptr ;
//********************************************************************// DEFINITIONS - Mozzi//********************************************************************
#include<MozziGuts.h>
#include<AudioOutput.h>// Template oscillateur
#include<Oscil.h>// Chargement des tables pour oscillateurs
#include<tables/saw2048_int8.h>
#include<tables/sin2048_int8.h>
Oscil <SAW2048_NUM_CELLS, AUDIO_RATE> Oscillateur_Scie1(SAW2048_DATA) ;
Oscil <SAW2048_NUM_CELLS, AUDIO_RATE> Oscillateur_Scie2(SAW2048_DATA) ;
int CH1_frequence = 440 ;
int CH2_frequence = 220 ;
voidupdateControl() {
Oscillateur_Scie1.setFreq(CH1_frequence) ;
Oscillateur_Scie2.setFreq(CH2_frequence) ;
}
// Fonction de génération de la sortie
AudioOutput_t updateAudio() {
returnStereoOutput::fromNBit(9, Oscillateur_Scie1.next(), Oscillateur_Scie2.next()) ;
}
// AFTER -> MAKE THE COMPILE WORKS IN STEREOvoidcallback_updateEncodeurRotatif(){
interface_encodeurRotatif->tick() ;
}
//********************************************************************// COEUR n°0 - Mozzi//********************************************************************voidsetup() {
}
voidloop() {
}
//********************************************************************// COEUR n°1 - Interface//********************************************************************voidsetup1(void) {
}
voidloop1(){
}
Conclusion
I don't have a clue what happen, it's really strange... I don't know if that is a clue that something wrong is happening with stereo mode... Hope that can help.
Thanks for your good work :-)
Leo
The text was updated successfully, but these errors were encountered:
BertheGrandPied
changed the title
Stereo - Strange error compilation depending if a function was define before - Problem with preprocessor ?
Stereo - Strange error compilation depending if a function was define before updateAudio() - Problem with preprocessor ?
May 18, 2023
Sorry for the noise, I see you mention that, specifically.
I guess we still need more diagnostics, though. Please enable display of warnings in Arduino (if you haven't already), and post the full compilation messages. That should probably give some further hints.
And as yet another after-thought: Try moving just the #include <MozziGuts.h> statement a bit higher up in the sketch. AFAIR, Arduino only looks at the first n lines trying to resolve which libraries to use, so I imagine something strange may be happening, there.
Hello,
I got a really strange problem using the stereo mode on a pico using pt_8211 as output (I did not test on other platforms).
The problem
My code is using a rotary encoder and mozzi and looks like that (minimal code example, I remove a max of things) :
These return an error "Compilation error: 'StereoOutput' does not name a type".
Try 1 - Switch to Mono
Switching to Mono mode in mozzi_config.h, and replacing
-> the compilation work. The problem seems linked to the stereo mode.
Try 2 - Find the disturbing element
I was able to find what make a mess but I don't uderstant why ^^. Moving the function definition of
callback_updateEncodeurRotatif()
after updateAudio and the sketch is compiled witout error :Conclusion
I don't have a clue what happen, it's really strange... I don't know if that is a clue that something wrong is happening with stereo mode... Hope that can help.
Thanks for your good work :-)
Leo
The text was updated successfully, but these errors were encountered: