purescript-abc-melody

September 1, 2025 ยท View on GitHub

Generate a playable monophonic melody directly from an ABC source. For more information, see the guide.

The melody is generated on channel 0. In this library, chord symbols are ignored with no attempt made to play them. For chord symbol support, see instead melody-plus-chords.

The soundfonts package defines a Playable class for music sources that can be played in the browser. A generic player for such sources is this one which is implemented as a Halogen component. This package introduces a newtype PlayableAbc which is an instance of Playable - i.e. it translates the ABC text into a Melody suitable for use in the player.

It has the following features:

  • abcTune - the tune to be played.
  • bpmOverride - optionally override the tempo (within the ABC itself) at which to play the tune.
  • phraseSize - the duration of each phrase of music after which the playback may be interrupted (default 0.7s).
  • playback - choose the type of playback - normal (the default), repeated or preceded by an intro.

To Build

 npm run build

To build the player example

 npm run player

and then navigate your browser to player/dist

To Test

 npm run test