I get why Pete's code it preferable but it looks functionally equivalent to me... looked to me like your modulo math should do the same thing in resetting on reaching the inter-accent count (ie -- every three steps)
...
My bad... lots wrong with the theory beside being incorrect. It would not compile, and it would not explain the result....
doesn't this really imply it's resetting because it's getting a start message that is...
Not sure I understand the problem... you want the accent on the third pulse?
if (accentPattern == 0)
velocity = accentVelocity; // we want it on this step
accentPattern++;
But your test...
Using filtering to pass all but the three-byte stuff appears to pass everything else so you'd only need to handle the basic messages from the controller and in the process alter the the note values on note on/off...
https://github.com/FortySevenEffects/arduino_midi_library
I think you call turnThruOff() during setup.
But then you have to pass all the other stuff manually if you want the other MIDI to pass unaffected.
Those two messages are only different from what you're expecting by the note values... are you sure it pulses middle-C (note=60)?
edit... I didn't notice they both say 'off'
Untested code changes... not even compiled so there may well be an error or two!
/************LIBRARIES USED**************
// include the ResponsiveAnalogRead library for analog smoothing
#include...
I'm writing a more detailed reply but in the meantime… you are assuming some things that are just names have meaning to the compiler.
CCID is just the name of an array of data... so is notes…
It really should...
// initialize the ReponsiveAnalogRead objects
ResponsiveAnalogRead analog{
{A14,true}
};This also should work and is likely what you were attempting. With this the defined constants are not needed.
Note you...
ok.... since that's my code you're starting with and the project is certainly worthy so I guess I should step up.
Not sure why you're using Many Knobs... for one knob and one button.
But here's your problem (I...
I think that's supposed to be from the greater high-frequency content -- which entails greater power levels. It's only going to be a factor at levels already near the physical limits of the speaker to dissipate heat.
...