
- Max msp gswitch for signals how to#
- Max msp gswitch for signals generator#
- Max msp gswitch for signals Patch#
Max msp gswitch for signals how to#
Refer to the separately attached itable for how to make it so that a new chord is generated after the arpeggiator repeats a sequence 4 times.This site contains examples and explanations of techniques of computer music programming using Max. In the final code, this section appears twice, with the only difference being the itable. This is so that when the algorithm from this chunk of code generates a number, it also gets selected on the piano so it will trigger that note to play.

The 67 number box above it thats running into the '+0' box is attached to the piano object pictured above, which is also attached to the root number box from the chord generator. In the full picture of the code, seen off to the left the 67 number box on the bottom is attached to root number box from the chord generator, so whatever number ends up being generated from the itable and its attached algorithm will go to the chord generator, and then into the arpeggiator where it will play the newly selected chord. The 'random' boxes determine how far the new root is from the original, currently I have it configured so that it can go up to half an octave up or down. With the sequence in the main code, the arpeggiator would one through one triad, then a new chord would be generated and it would run through that triad, and so on. Since the Arpeggiator runs in sets of 3, the size of the itable is set to 12, to account for 4 cycles, and the range is set to 2, with 2 serving as 'no' and 1 serving as 'yes' for whether or not to change the chord. By attaching this to metro parameter from the arpeggiator (the box set to 500), we can control the exact point in the arpeggiator sequence that the chord changes. The key item here is the 'itable', or the large square with the small blue rectangles inside.
Max msp gswitch for signals generator#
If we refer back to the chord generator from the beginning of this section, changing the root will automatically fill in the following intervals, so we can use that to generate unique chord progressions!
Max msp gswitch for signals Patch#
This chunk of code is what brings this patch to being able to run autonomously. That then run through the +0 boxes, which will add that interval to the root, and provide you with the 3 notes to make a major chord, from any root! For example, if the major key is selected, the corresponding intervals are 4 and 7. Whenever the root changes, the intervals will change correspondingly based on the current key. Starting with the leftmost box labelled '60', thats the root. Referring to the first picture, the bulk of this section is just the math that corresponds to the intervals of these keys. Later on we will add to this part of the code to allow it to cycle through the key signatures on its own, so we selected Major, Minor, Major 7ths, and Minor 7ths to help preserve tonality as the program cycles through chords. The key signatures you use are up to you, however you can also follow along with the 4 key signatures we selected. Fortunately, the numbers are sequential, so by applying some music theory, we can generate the correct intervals that correspond to various key signatures.

In MIDI, every note on the keyboard corresponds to a number, with middle C being 60.

Before we can put an arpeggiator together, we need to be able to generate the chords for it to sequence through.
