We can trigger Csound orchestra with
They live in the module Temporal.Music.Score. If you are not familiar with it, you can start with six basic functions.
rest-- makes a pause that lasts for some time (in seconds).
temp-- makes a score of one note that lasts for one second.
mel-- plays a list of notes in sequence (one after the other, short for
har-- plays a list of notes in parallel (at the same time, short for
del-- delays all notes for some time (short for
str-- change the tempo for all notes by the given ratio (short for
Let's play something:
res = str 0.5 $ mel [ temp a, str 2 $ temp b, rest 1, har [temp a, temp b] ]
There are two handy infix operators for delay and stretch:
(*|). So we can write the previous score:
res = 0.5 *| mel [ temp a, 2 *| temp b, 1 +| har [temp a, temp b] ]