Once upon a time, there were many music composition software packages, mostly written in Common LISP. To name a few I know, Common Music, Symbolic Composer (not related to the Symbolics Lisp Machine). Common Music is still available in source code but I doubt if anyone is still able to setup that. Symbolic Composer just vaporized decades ago, which some archived programs scattered over the Internet. The package is also a 32bit Intel program so newer macOS versions would not support it and it is license protected anyway. Yet another is Patchwork, a more graphic oriented composing program, and I'd be surprise if it is able to survive from bit rot.
The one I actually uses is Opusmodus, similar in the spirit of Symbolic Composer. Unfortunately I need to remind you if you are tempted that this is still an Intel Mac only program, since Clozure CL is still not able to support the new ARM Mac, and Rosetta is not able to translate the program.
Opusmodus is about to release 3.0 based on LispWorks on Oct 2022 which has Windows/Apple M1 support so you can wait a couple days if you does not have Intel Mac.
Before introducing all the fancy terms about algorithm composition, let's first see a brief example that generates melody from modulation of sin wave.
(filter-repeat 1 (quarter-tone-closest|
'(g3 g5)5 |
12 120 9 4.2 :phase 7|
:modulation (gen-sine 120 1 0.4 :phase 60))|
Then add some classic euclidean rhythm. Since this is a
randomized process, a
is provided to produce consistent result.
(euclidean-rhythm (gen-repeat 18 8) 1/2 8 1/16 :seed 9941))
Sometimes it is just desirable to have some polyphonic1 part playing. This time, we could add some variation by changing velocity a bit. The basic idea is still sine wave modulation.
(add-sine-waves 17 120 9 0.3|
:phase 445 |
:modulation (gen-sine 120 3 0.4 :phase 60))|
'(1 2 3 4) :type :ratio))|
'(5 1)10 |
(filter-repeat 2 (mapcar #'floor|
(add-sine-waves 12 120 9 1|
(gen-sine 120 1 0.3 :phase 3))))|
(setq score (make-omn :pitch pitch :length rythm20 |
:velocity '(f mf p mp)))
To start composing music it is important to first decide how
many sections one would like to have. Which that settled one can
get-span to acquire the length
information, then use
fill other materials like percussion generated by
gen-euclidean-omn into the desirable length.
Instead of specify a very long
count number to
gen-euclidean-omn, which would cause a long time
length-span takes much
less time to since it just repeats materials.
Major keys are of the
'(0 2 4 5 7 9 11
12) interval2. The key
signatures are hard to remember, but one trick is for sharp keys
the name is one half step higher than last sharp; for flat keys the
name is the second to last flat. The reason why it works is
demonstrated below. The name is just from the first note in each
This is produced by OMN generated by this lisp loop:
(loop for i from 0 to 11|
collect (append '(q)|
(integer-to-pitch (x+b '(0 2 4 5 7 9 11 12) i))))