-
I've been trying to get things set up so I can switch between jukebox mode and regular midi control mode via a digital input. I am able to compile fine with both JUKEBOX and MIDI_VIA_SERIAL2 defined. I was initially just going to put an IF statement in regular_checks() to run jukebox_tick() or MIDI2.read() based on the input value. This works, but adds a static chopping noise to the output. I'm guessing this is some sort of interrupt issue but I'm not sure where to check from here. Any ideas where I should look? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Please, provide a piece of code that you think to be guilty. It seems that there's no more CPU time to run extra logics. |
Beta Was this translation helpful? Give feedback.
-
Here was my initial attempt. midijack is set by a digital input in the setup routine. If I manually set midijack to a constant HIGH or LOW I still get significant distortion in the output. I have both MIDI_VIA_SERIAL2 and JUKEBOX defined in the config.h. Is there a different way I should be approaching this switch? `void regular_checks() { #ifdef MIDI_VIA_SERIAL #ifdef MIDI_VIA_SERIAL2 #ifdef JUKEBOX }` |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestions. I had tried the if / else and it causes the same distortion as using two ifs. Double checked all my DEBUGs are undef. I also tried making two different regular_check functions, one for midi control, and one for jukebox and doing the switch there, but that also created distortion. Finally, I tried just running both MIDI2.read() and jukebox_tick() at the same time. I was able to trigger notes via MIDI as the jukebox played, but the distortion was still present. |
Beta Was this translation helpful? Give feedback.
-
I have ESP core 2.0.11 installed currently, I will bump that up to 2.0.17 and test. My IDE is currently 2.2.1. Hardware is a Wemos / lolin D32 Pro with 8MB of PSRAM. Using a PCM5102 with everything wired to the default pins. |
Beta Was this translation helpful? Give feedback.
-
It was the ESP core code. Switched to 2.0.17 and everything works as expected. I am even able to put the digitalRead inside the regular_checks() function so I can switch between jukebox and midi mode on the fly. Thank you for the support and for being so responsive! |
Beta Was this translation helpful? Give feedback.
It was the ESP core code. Switched to 2.0.17 and everything works as expected. I am even able to put the digitalRead inside the regular_checks() function so I can switch between jukebox and midi mode on the fly. Thank you for the support and for being so responsive!