Frère Jacques

ReactiveML has been used to
implement a sequencer
for mixed music. Here, we present a simple library that takes
advantage of the expressiveness of ReactiveML to program the classic
French musical round "Frère Jacques".

Traditionally, in western music, a melody is a sequence of notes,
where a note is a sound event characterized by a pitch and a
duration. Notes can be defined with the following types using a
syntax similar to the one of OCaml.

The pitch is represented by a pair (pitch_class,
octave), where pitch_class denotes one of the
twelve semi-tones, e.g., A, A#, A♭, B, B#..., and octave is an
integer. For instance (A,4) denotes the famous A 440Hz.

Using these data types, we can define the score of Frère Jacques as list of notes:

In order to produce actual sounds, notes are converted into UDP messages and sent to an audio environment. This is done by the process sender. This process awaits notes produced on the signal perf and sends UDP messages.