bassline - Generates a random jazz-bassline, for improvisation practice.


 bassline -c 3           # output on MIDI Channel 3 (default=1)
 bassline -d             # Drum option; generates also a ride-cymbal
 bassline -m             # generates output in Muscript format
 bassline -n 500         # generate 500 beats (default = 5 minutes)
 bassline -p 33          # use Patch 33, Electric Bass (default=32)
 bassline -s 0.5         # use equal eighths (default Swing=0.6)
 bassline -t 120         # Tempo 120 beats/minute (default=144)
 bassline -v 80          # MIDI-Volume 80 (default=100, max=127)
 bassline -8 0.05        # proportion of swung Eigth-notes (default=0.09)
 bassline -2 0.15        # proportion of Half-notes (default=0.0)
 bassline -a 58,56,46,44,34,32 # avoids Bb and Ab
 bassline -A G           # Accords with the note G, by avoiding Ab and F#
 bassline -A D,G,A       # outputs only white notes (useful with midichord!)
 bassline | aplaymidi -  # do your jazz piano practice :-)
 perldoc bassline        # read the manual :-)


This program generates randomly wandering jazz-like basslines. It mostly plays one note per beat, but sometimes throws in a pair of swung quavers. It tends to keep moving either up or down, but sometimes it turns round and starts going the other way. It prefers intervals of one and two semitones, but from time to time it throws in larger intervals.

OPTIONS   -a,   -A,   -c,   -d,   -m,   -n,   -p,   -s,   -t,   -v,   -2,   -8

-a 32,34,44,46

This example will avoid generating any of the specified notes, in this case the notes Ab, Bb, ab and bb.

-A A

This example will generate only notes which Accord with an A (natural), in the sense that it avoids notes in any octave which are in a semitone dischord with it. This example works the same as -a 32,34,44,46,56 (see above). Several notes to be accorded with can be specified, separated by commas.

-c 3

This example will cause output to be generated on midi channel 3 (of 0..15). The default is channel 1.


This drum option generates also a simple ride-cymbal, using note 53 on channel 9.


The output will be generated in muscript format. This could be useful if you want to add by hand in some other instruments; like a tenor saxpohone is General-MIDI Patch 66, for example. The output will be divided into bars.

-n 300

This will cause a particular number of beats to be generated, three hundred in this example. The default is to generate five minute's worth.

-p 33

This example will cause output to be generated with midi patch 33. The default is patch 32, which is the General-MIDI pizzicato acoustic bass.

-s .53

This sets the swing, to 0.53 in this example, which is almost equal-eighths. The 0.53 parameter is the length of the first eighth, as a proportion of the beat. Equal eights is .5, the default is .6, and triplets is .667

-t 160

This example sets the tempo to 160 beats per minute. The default is 144 beats per minute.

-v 90

This example sets the MIDI-volume (note-velocity) to 90. The minimum is 1, the default is 100, and the maximum 127.

-2 0.1

This example sets the proportion of half-notes to 0.1
The default is 0, meaning you only get quarters and eighths.

-8 0.2

This example sets the proportion of eighth-notes to 0.2
The default is 0.09, meaning about one beat out of eleven will be subdivided into eights.


The current version of bassline is available by http at (make it executable, and move it into your $PATH),
or as part of (unpack the tar archive somewhere in your $PATH).
If necessary, edit the first lines to reflect where perl is installed on your system.

You'll also need to install the MIDI-Perl module written by Sean Burke.


1.6, 20140913, -d option introduced
1.5, 20130509, -a, -A, -2, -8, -s options introduced
1.4, 20111105, -q option to adjust Quaver_Probability, now renamed -8
1.3, 20090309, MIDI-Perl module not required if -m option is used
1.2, 20090308, added -m option for muscript output
1.1, 20071006, -v option now sets the volume
1.0, 20061103, first working version


Peter J Billam


Based on Sean Burke's MIDI-Perl CPAN module.