I’d like to announce a little recreational project. Elm tracker is a simple amiga module format player in Elm. Only several audio effects are supported. I recommend to toggle playing off if you want to switch to another tracks. (have some bugs here)
The main goals here were 1. learn some web audio. 2. work with elm/bytes and binary data. 3. have some fun.
Live demo - https://elm-tracker.netlify.com/
Source code - https://github.com/catz/elm-tracker
The project is based on the following components:
- Slightly changed elm-webaudio. https://github.com/aratama/elm-webaudio Changes related to passing samples data directly from elm.
- elm/bytes for binary parsing
Some highlights that can be interesting to elm community.
Use pipelines to build binary Decoders in Elm.
Example:
decoder : Bytes.Decoder ProTracker
decoder =
Pipeline.decode ProTracker
|> Pipeline.required decoderTitle
|> Pipeline.required decoderInstruments
|> Pipeline.hardcoded []
|> Pipeline.required Bytes.unsignedInt8
|> Pipeline.required Bytes.unsignedInt8
|> Pipeline.required (decoderPatternTable 128)
|> Pipeline.required decoderSignature
|> Pipeline.hardcoded []
|> Bytes.andThen decoderPatterns
|> Bytes.andThen decoderSamples
Tested on
-
Desktop Mac Chrome
-
Desktop Mac Firefox
Not tested on mobile devices.
Local start
This project is bootstrapped with Create Elm App.
Due to “Map.!: given key is not an element in the map” bugs in 0.19 we need to turn off time-travel debugger.
Seems fixed in 0.19.1
ELM_DEBUGGER=false elm-app start