A musical note identifies a pitched sound and its duration; in a composition, notes can be separated by pauses and arranged sequentially or simultaneously. section 10.4.1 section 11.1
Represent a note at several levels:
- Use a frequency directly when the synthesizer already has a value in hertz. section 10.4.1
- Represent pitch as semitone distance from concert A, where 0 means 440 Hz and twelve semitones double the frequency. section 10.4.1
- Represent named chromatic notes with a note name and octave, then convert them through semitones to frequency. section 10.4.1
- Place notes inside recursive structures that also contain pauses, sequences, and simultaneous groups. section 11.1
Build and render a melody
A melody can convert chromatic notes to frequencies, render each frequency as a tone, concatenate the events, and write the result to a WAV file: map toFrequency [c 4, e 4, g 4, d 5, c 5]. section 10.4.1
data NoteStructure a = Note Notelength a | Pause Notelength | Sequence [NoteStructure a] | Group [NoteStructure a]
Inspect the recursive NoteStructure definition for combining notes, pauses, sequences, and groups. section 11.1


