From JimboWiki
Jump to: navigation, search

 · Suff Home  · Style Research  · Functional Requirements  · Algorithm  · Patches  ·


Max - The software these programs are written in. Created by Cycling'74. I's a graphical programming language focused on music.
Patch or Patcher - This is what the Max folks call the programs writtin in their software.
MIDI - Musical Instrument Digital Interface. A communications protocol for talking about music. It's event based, so no sound is actually transmitted, just commands to start, end, or alter notes. There's a lot of stuff it can do - see Wikipedia:MIDI
Velocity - This is a MIDI word. It's a measure of how hard a note is struck. It usually corresponds directly to the volume the note is played with, and sometimes some other musical elements. Velocities range from 0 to 127, 1 being softest, and 127 being hardest. A velocity of "0" will cause a note to stop playing.
Program Path - These patchs are implementations of an algorithm. They create music (though possibly not good music).
Helper Patch - These patches generally don't do anything on their own, but their functionality can be added to program patches or helper patches quite easily. They're separated out for reuse or to keep a program patch a little cleaner looking. Usually, they will require additional information or stimulation to do their job.

Helper Patches


The "Advanced Metronome" (advmetro) is used to time different note types simultaneously and synchronously. It uses a "tempo" object to produce 48 bangs per beat. The bangs are counted by "counter" objects to produce measure count, half note count, quarter note count, eighth note count, sixteenth note count, and triplet count. The counts are sent out the outlets and to variable names using the "send" object. This way, patches can be synchronized without the need of connecting clocks.


The "Random Line Generator" (randline) is used to generate a random bunch of notes within a given (or default) range. The notes have random velocities which are all greater than 50. Duration of the note is selected randomly, but conforms to the rhythm supplied by "advmetro"'s send variables. This algorithm was first developed in the "Duel-Metro" patch and later put into a separate patch for easy reuse. This patch should be supplied with a bottom range of notes to play and a range.


Adds the ability to control the complexity of the rhythm by changing the maximum value of the random number associated with picking rhythms, effectively eliminating possibilities of certain "more complex" rhythm elements - such as triplets, 16th notes, on up the line.


Same functionality as randline2, but the pitch selecting is done in a sub patch. Also, repeated notes are not played. All note on and note off events are sent out globally using send. This may help to determine what key the piece is playing in and where the song should progress to.


The idea of the pitchselect patches is to select a pitch to play that makes sense musically. In this, the first not completely random, approach, it is possible to play major or minor keys. There are 5 inputs used in the process: get a note, minimum note movement (defalut 0), maximum note movement (default 5), scale type (default major), and dominant (default C). To load a scale for playing, first the dominant must be sent in, then a scale type (currently "major" or "minor"). This triggers the system to populate the note probability table with the values for that scale. The minimum movement controls the minimum spacing required between sequential notes. For instance, if you were in C major, the previous note was E and the minimum note movement was 3, the next note you recieved would be at least +/-3 away, so C (because C#, which is 3 half steps away, is not a choice in the key of C) or G (because the range is inclusive) or higher than G. Note that this effect does not wrap around - pitchselect2 has no notion that C is actually next to B, it acts as though they are as separate as possible. The same logic applies to maximum note movement. pitchselect2 only works within a single octave and only outputs values that make sense in the bottom octave, so in order to play in a useful range, some math has to be done by whatever patch calls pitchselect2.


The inputs have been changed. They now correspond to minimum note movement, maximum note movement, scale type, and dominant. This patch utilizes "pitchselect2" to pick notes using a probability table. All these values are passed into the "pitchselect" sub patch, which puts them into a "pitchselect2" object to get notes out. In the "pitchselect" sub patch some math is done to get the note outputted from pitchselect2, which is gauranteed to be in the bottom octave, back into the octave specified by the note passed into the connection to define the dominant.


"randline5" has all the functionality of randline4, plus the addition of the "veloselect" sub patch, which outputs velocity values based on the current position in the measure. This is accomplished by recieving the beat signals from the "advmetro" and simply storing a corresponding value until it is asked for or changed by the next beat event.

Program Patches


This is random music very close to its simplest form. Two lines of completely random notes spanning the entire MIDI range are played at completely random velocity (0-127) with a duration of less than 250ms. Because duration is a limit, the music isn't completely random, but its pretty close and most unmusical.


Two lines of restricted range notes are played at velocities above 50. Duration is selected randomly from three settings: 1/4 note, 1/8 note, 1/16 note. Tempo is enforced by the "advmetro" patcher. The first note is caused by the on-switch. At this time a random note is generated (within the range) at a random velocity (above 50). A duration is also randomly selected and passed to a "switch" object. When the slected duration is over and "advmetro" sends out a value, that value is converted into a bang which simultaneously ends the currently playing note and starts the process over. This sort of approach has the potential to cause some very strange note durations - such as if a triplet were started, then after the triplet finished a half note was selected, you wouldn't actually get a half note following a triplet. You would get a triplet followed by a note lasting until the next half not event (2 tripplets plus a 1/4 note away). This is very desireable because it will force the music to stay aligned in measures.


Several "randline" patches with different ranges defined are all connected to a single on/off switch and "advmetro" object. The result is quite interesting. The music produced is completely atonal, as axpected. Because "advmetro" is based in 4/4 time, the music actually takes on 4/4 characteristics because of the way notes are distributed in a measure. For instance, there is a 100% chance that there will be a note started on the first beat of a measure because every type of note has a "advmetro" event at that time. It doesn't matter what the duration selector switch is set to - there has to be an event.

Beat 1 1 1/4 1 1/3 1 1/2 1 2/3 2 2 1/4 2 1/3 2 1/2 2 2/3 3 3 1/4 3 1/3 3 1/2 3 2/3 4 4 1/4 4 1/3 4 1/2 4 2/3
Notes Playing 4,2,1,1/2,1/3,1/4 1/4 1/3 1/4, 1/2 1/3 1/4,1/3,1/2,1 1/4 1/3 1/4, 1/2 1/3 1/4,1/3,1/2,1,2 1/4 1/3 1/4, 1/2 1/3 1/4,1/3,1/2,1 1/4 1/3 1/4,1/2 1/3
Probability of event (notes/6) 100% 16.6% 16.6% 33.3% 16.6% 66.6% 16.6% 16.6% 33.3% 16.6% 83.3% 16.6% 16.6% 33.3% 16.6% 66.6% 16.6% 16.6% 33.3% 16.6%

Notice the close correlation between dominant beats and high probabilities over the whole measure. This pattern still applies for larger and smaller duration increments - think 1/32 notes or 4 bar phrases. This shows that although the slection of duration is random, it is likely to produce a fairly pleasing rhythm, thus validating this method of duration selection.


This patch uses "randline4" to expand the capabilities of the system to include the much more musical pitches produced by "pitchselect2". It also features a call-and-response system which is triggered by a random value generated on the 1st beat of every measure. After significant experimentation, some patterns began to emerge. Music produced using C as a dominant was clearly less musical than if a note closer to the middle of pitchselect2's range (like F or G). This is because of how the probability tables work. The dominant has a higher chance of appearing than most other notes, but if the dominant is at the end of the range, like C, there are half as many places to go from the most common note due to minimum and maximum movement restrictions. Also, the probability distribution for minor scales seems to be working a little better than the major distribution. This probably has a lot to do with the fact that the tables are completely made up, with absolutely no science to back them.


Same functionality as Multi-Line-Metro-Pitch, except uses randline5, which selects velocity with the veloselect subpatch instead of the completely random approach in randline4. This works alright. Again, the velocity values are completely made up, so they don't make perfect sense. veloselect is also limited in the sense that is only selects velocities based on the last signal type produced by advmetro, not the last signal count, so adjacent notes have a fairly high probability of having equal velocities. Also, there's a small glitch causing a significant amount of sound if multiple notes are struck on the first beat of the measure that needs to be looked into. veloselect obviously needs some significant improvements.