In this lab you’ll:
1) Make a multi channel MIDI drum sequencer.
2) Solidify your final project idea.
Part 1) Multi Channel Drum Sequencer
a) Start with your one channel drum sequencer from last week. Make sure it still works.
b) Add two buttons right next to each other, set their pin numbers nextChannelButtonPin and prevChannelButtonPin and set their pinModes. Make the one on the left the prevChannelButtonPin, and the one on the right the nextChannelButtonPin.
c) Add an int variable called channelDisplayed.
This variable should work exactly the same as the counter variable from the lecture homework from last week. You press the one button, its value goes down by one. You press the other button, its value goes up by one. If it’s value goes less than 0, set it back to 2. If it’s value goes above 2, set it to 0.
d) Replace your on[4] array with a multidimensional array containing 3 arrays, each of which has a length of 4.
boolean on[3][4] = { { LOW, HIGH, LOW, HIGH }, { LOW, HIGH, HIGH, HIGH }, { LOW, LOW, LOW, HIGH } };
Think of each of the three arrays as a channel or instrument in your sequencer.
e) Anywhere you had on[someVariableOrNumber] replace it with on[0][someVariableOrNumber]. Upload and make sure it still works.
So right now you have a three channel sequencer, but you can only see and edit the first channel.
f) Use your two new buttons and channelDisplayed to control which of the three channels is being displayed on the LEDs.
It should still be sending the MIDI notes according to what’s on the first channel.
g) Update your code so that the channel currently displayed on the LEDs is also the one that controls your MIDI noteOns.
h) Make an array of 3 called midiNotes.
int midiNotes[3] = { 60, 62, 64 };
You can set the three numbers to whatever MIDI notes you want it to play.
i) Add one or more for loops to the part of your code that sends the MIDI notes to your DAW so that it will work with and play all three channels simultaneously.
As usual take a good clear video and include your code in your lab report.
I highly recommend in Arduino going to Edit -> Copy As HTML and using that you paste your code into WordPress rather than using anymore since lately that seems to have all kinds of bugs in it and Copy As HTML seems to work way better.
Part 2) Start to finalize your Final Project
In class next week we will go around the room and everyone will share their Final Project idea. Be prepared to talk about your project for a minute or two at the start of class.