Error Msg: stack overflow on a patch that used to work (maybe order of operations issue?)

    Oct 15 2019 | 4:56 pm
    Hi there, I'm fairly new to max and have very little knowledge of sound/ production but I've been designing an interactive light/ sound ear-training device. Here's a link to the prototype: - its basically like Simple Simon (or the board game Mastermind, which it's loosely based on). It uses a MIDI's pentatonic (the black keys) to send signals to Max, where all of the logic and game design occurs, then Max sends signals of what color to output via the 4 rings (and 4 levels).
    Now, I am working towards the end of this project and really need to understand everything that's going on so I can re-imagine this project via a sort of "laser-harp" but with DMX controlled lights instead. My friend was kind enough to help me write a bunch of this towards the end, which is where it got a bit too confusing and became a giant spaghetti monster that I no longer understood. So I've spent a boat load of time cleaning it up to all be easier to understand (although there may be some question marks still as comments I need to discuss with him).
    Here is the code cleaned up with the error msg, stack overflow (which I'm 90% sure has to do with the order of operations of where things are placed). It's also having issues with the delay of the notes, as they are being held for too long.
    heres the note check subpatch too!
    I'll post the old messy patch that still works in the comments
    btw presenter mode was just used for quick testing on site for each of the notes/ to make sure winning/ losing sequences were working. You can click any of the numbers (as they are the notes on the keybaord) as your guesses and the left hand side is the "goal/ target" notes so you can see what you're aiming for.

    • Oct 15 2019 | 5:00 pm
      this is the previous patch that still works with very messy and hard to understand code