It's a big project consisting of a lot of files, but I can start with the stuff below.
I also noticed that experimenting with putting a delay(1500) first in setup() fixes the problem. Could this be a power up issue?
Code:
void setup() {
GenerateNoteData generateNoteData;
GenerateSequencerData generateSequencerData;
AssignSequencerData assignSequencerData;
Sequencer sequencer;
AssignVoiceData assignVoiceData;
ProcessGPIOExpanders processGPIOExpanders;
MIDI MIDI;
DisplayBaseClass display;
LED LED;
RGBLED RGBLED;
// Debugging
// Serial.begin(115200);
attachInterrupt(digitalPinToInterrupt(interruptPin1), ISR1, FALLING);
attachInterrupt(digitalPinToInterrupt(interruptPin2), ISR2, FALLING);
// Randomization
Entropy.Initialize(); // Used only as a seed below, since the Entropy class is slower than the standard random() function
randomSeed(Entropy.random());
// Input
processGPIOExpanders.setup();
// Generate stuff
generateNoteData.setup(); // Randomizes voice data
generateSequencerData.randomizeOctaveModifier(); //
// Assign stuff
assignVoiceData.setup(); // Voice data is initialized
assignSequencerData.defineAmbitus(); // Defines lowest/highest note of the loop
assignSequencerData.assignRandomArpNOSPB(); // assign arp values
sequencer.bpm = 100; // Start value
// Output
MIDI.setup(); // MIDI Serial port is initialized
display.setup(); // Initializes oled display object, and displays main menu
LED.setup();
RGBLED.setBrightness(0);
}
void loop() {
ProcessGPIOExpanders processGPIOExpanders;
ProcessTimeEvents processTimeEvents;
RGBLED RGBLED;
processGPIOExpanders.processInterrupts(); // Input events
processTimeEvents.processTimeEvents();
RGBLED.processRGBLED();
}