MIDI (not USB) pedal to play chords on an arranger

Status
Not open for further replies.

JimmyNic

New member
Hi all,

I'm new and slightly versed in Teensy coding. My project is somewhat simple to explain but not simple, for me, to execute. I'm hoping the bigger brains on here can guide my smallish brain to accomplish my goal. I'm using the Teensy 4.0 and have all of the buttons, MIDI connectors, breadboard, jumpers... Also, I use a MacBook.


The project: MIDI pedalboard for accompanying lead musician using an arranger

---The arranger part of this project has no bearing on the pedalboard as long as the correct info is sent to it. In this case it only needs a 3-note chord to trigger the accompaniment.

---The board will have 4 momentary stomper buttons for the different chords. Each will send a different 3-note chord to the arranger via MIDI.

---The 4-chord set for the buttons will be determined by a selected "Style" (major, minor, diminished, augmented, etc.). The style is chosen with 2 buttons (style up/down) which cycle through the different styles.

---Two more buttons will change the key (key up/down) which will cycle through the 12 tones.

---I would want to have a display to show current settings.


I have determined the actual notes or tones for the different styles and the corresponding number to send over MIDI.
i.e.--a song in C Major has the following 4 chords (48 = C, 49=C#, 50=D...):
1st- 48, 52, 55
2nd- 53, 57, 48
3rd- 52, 59, 50
4th- 48, 52, 59

Each chord is made up of a "root," a "third," and a "fifth."

I assumed to set a "tonal" value of 48("tonal" is the name of the predominant chord in the set which is also the "root" note of the chord) so the system would default to the key of C and then adjust the "tonal" value as needed by incrementing or decrementing using the "key"buttons. therefore it would initialize to "tonal = 48" and then adjusted as needed.

so for C Major:
tonal = 48
root1 = tonal
root2 = tonal + 5
root3 = tonal + 7
root4 = tonal
third1 = tonal + 4
third2 = tonal + 9
third3 = tonal + 11
third4 = tonal + 4
fifth1 = tonal + 7
fifth2 = tonal
fifth3 = tonal + 2
fifth4 = tonal + 11 (the number is for each of the 4 chords, i.e. root2 is the root note of the second chord)

Further assumptions were to create the hard coded intervals of the different styles, as above, and call each of them up individually by selecting them with the "style" up/down buttons. So, if the button value is 1, then set the chords for "Major." If the value is 2, then set the chords to "Minor" and so on. I have no idea how to do that.

This all seems very well explained to me, however, I'm old enough to know that it will not be clear to everyone. Please know that any help is very much appreciated.
 
Last edited:
I'm not familiar with music theory but I think you can represent the four chords as offsets from the root note, like this:
1st- 0, 4, 1
2nd- 5, 9, 0 (Does the order actually matter when sending a chord?)
3rd- 4, 11, 2
4th- 0, 4, 11

Then you just add the actual root midi note to each offset to get the MIDI notes that are sent. This can be used to generate the four chords for any major key. You can then have similar groups for minor, diminished, etc.

Pete
 
I'm not familiar with music theory but I think you can represent the four chords as offsets from the root note, like this:
1st- 0, 4, 1
2nd- 5, 9, 0 (Does the order actually matter when sending a chord?)
3rd- 4, 11, 2
4th- 0, 4, 11

Then you just add the actual root midi note to each offset to get the MIDI notes that are sent. This can be used to generate the four chords for any major key. You can then have similar groups for minor, diminished, etc.

Pete

Thanks, Pete. The order doesn't matter at all. That is correct. So, is this considered an array? I wouldn't know how to code it either way.
 
An array would be the most convenient way to handle it. If you don't know how to use arrays, you've got some reading and learning ahead of you :)
You code the major array like this:
Code:
int major[4][3] = {
  0, 4, 1,
  0, 5, 9,
  2, 4, 11,
  0, 4, 11
};

In C, array indices start at zero, so to send the C major chord:
Code:
int root;

  root = 48;
  for(int i = 0;i < 2;i++) {
    send_midi(root+major[0,i]);
  }
where send_midi is a function you supply which sends the specified note.

Pete
 
Status
Not open for further replies.
Back
Top