An Elixir application that models the sequencer part of a drum machine.
Drum samples courtesy of 99sounds.org.
- Mac OS X (for audio playback)
- Elixir 1.6 (Visit https://elixir-lang.org for more information)
> cd beat_machine
> mix test
To play the demos:
> mix escript.build
> ./beat_machine
To create your own beats in IEX:
> cd beat_machine
> iex -S mix
iex(1)> alias BeatMachine.{Song, Sequencer}
iex(2)> song = Song.new(120, "New Song")
iex(3)> {:ok, song} = Song.add_pattern(song, "kick", [1, 0, 0])
iex(4)> {:ok, song} = Song.add_pattern(song, "snare", [0, 0, 0, 0, 1, 0.2, 0, 0])
iex(5)> {:ok, song} = Song.add_pattern(song, "hihat", [0.2, 0, 1, 0.2, 0.2, 0.2, 1, 0.2])
iex(6)> Sequencer.play(song)