📜 ⬆️ ⬇️

Writing and processing music with Haskell

Music Suite - software for composing, processing and analyzing musical compositions. The subset is built into the Haskell library. To master a musical notation with the help of a fairly simple code almost every composer can, for what is musical notation? This is the transfer of musical logic for the execution of the "code" on a musical instrument. Haskell simply allows you to program more efficiently.

So, the generation of the melody in Music Suite / Haskell is done through expressions.


let m = staccato (scat [c,d,e,c]^/2) |> ab |> b_ |> legato (d |> c)^*2 in stretch (1/8) m 

Processing - using functions. For example, this function shortens the duration of notes by half and transposes up to a small sixth (m6).
')
 up m6 . compress 2 

For the above tune, the following result is obtained.



The Music Suite supports multiple note formats: MusicXML, Lilypond, ABC-notation and MIDI.

The documentation details how to write notes, intervals, tempo, strokes, etc.

Dozens of functions are provided for processing music (this part of the documentation has not yet been added).

See examples of musical notations in the Music Suite here .

Source: https://habr.com/ru/post/225499/


All Articles