Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inlets = 1;
- outlets = 2;
- G = [7, 10, 2] //notes of Gm chord
- F = [5, 9 , 0]//notes of F chord
- D = [2, 6, 9]// notes of D chord
- bass = [55,53,50] //bass notes (not implemented)
- //below is dictionary of MIDI number to note name
- notes = {0:"C", 1:"C#", 2:"D", 3:"D#", 4:"E", 5:"F", 6:"F#", 7:"G", 9:"A", 10:"Bb", 11:"B"}
- function get_note(mode) {
- //takes a mode and gets a random note as a result
- mode = [G,F,D][mode]//gets the notes of that mode
- note = mode[random(0,3)]; //chooses a random note from the mode
- outlet(1,note+(12*random(4,8))); // puts in outlet 1 that note from 4-8 octaves above
- outlet(0,notes[note%12]); //puts the name of that note in outlet 0
- }
- function random(min,maximum){
- //simple function that returns a number within the min/max bounds
- return Math.floor(Math.random()*(maximum-min)+min);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement