/purescript-abc-melody

A directly Playable instance of an ABC tune

Primary LanguagePureScriptMIT LicenseMIT

purescript-abc-melody

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

The melody is generated on channel 0. If there are chord symbols in the ABC and a chord map is provided, chordal accompaniment is generated on channel 1.

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).
  • generateIntro - if true, generate a 2-bar intro to replace any lead-in bar.
  • chordMap - A lookup map of chord symbols for accompaniment

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