lgcantarelli/emusic/1.0.0

Emusic

DSL that implements the music patterns and functions to make it easy to write music and parse its structures to send to browser.

Instrument type

= AMSynth
| FMSynth
| MBSynth

Intrument type

MAction type

type MAction
= X
| O

Music action

MPattern type

= MPattern (List MAction)

Music pattern

Song type

type Song
= Song (List Track)

Song type

Track type

Track type

SongData type

type alias SongData =
List TrackObject

Song data to send to JS

SongIdentifier type

type alias SongIdentifier =
{ songName : SongName
, song : Song
}

Song identifier type

SongName type

type alias SongName =
String

Song name type

TrackObject type

type alias TrackObject =
{ instrument : Int
, actions : List String
}

Track data to send to JS

Msg type

type Msg
= Play SongName
| Stop

Msg type

Model type

type alias Model =
{ songs : List SongIdentifier
, currentSong : SongName
}

Model type

Exposed methods

init : List SongIdentifier -> ( Model, Cmd Msg )

Init program with a list of song identifiers

update : Msg -> Model -> (SongData -> Cmd Msg) -> ( Model, Cmd Msg )

Update program

repeat : Int -> List MAction -> List MAction

Repeat action lists