Posted March 6, 2021 by ‐ 3 min read
Using notemap functions to create a drum beat.
This script is an example that uses the Melrōse language to create your own drum beats. Line by line, I will explain how it is composed.
Using the bpm function you change the default from 120 beats-per-minute to 85.
line 5 .. 8
Using the General MIDI mapping (see url on line 3), 4 variables with notes are created with the
midi function. Parameter 16 refers to the fraction of the note, 1/16. The second parameter is the MIDI number, the kick is 36. The third parameter is the velocity (loudness) and is set a bit lower than the default (72).
line 10 .. 13
Using the notemap function we create a sequence of notes in which for each number the note is placed. On index 3 , 10 and 11 (sequences start at 1), the open note is placed. On all other indices (1,2,…) a rest note ( ‘=’ ) is placed. For each note (open,close,clap,kick) a pattern is created using notemap.
The indices in this example were found using Ableton learning music.
An alternative way to describe the indices in a
notemap is using dots (.) and bangs (!).
d1 = notemap('..!......!!.....', kick) // 16 characters
Which gives a better visual feedback of the pattern.
The drum set is created by merging all the notemaps into one sequence. The first parameter 16 of the
merge (notemerge is the old name) function is needed to specify the total number of notes in the set. Again, unspecified indices will have the rest note.
Finally, on this line we create a loop using the set as its parameter. You can play this loop by using cmd+3 in the Editor (*)
Modify while play
While playing the loop, you can change the notes and the notemap in the Editor and evaluate each line to hear the effect. Below is a snapshot of a piano roll created from playing this loop using a DAW (e.g. Logic).
(*) Editor refers to the Melrōse Plugin for Visual Studio Code which is connected to the program melrose which send MIDI message to your Digital Audio Workstation (DAW).