Created
August 20, 2014 22:44
-
-
Save opyate/6076262895924b0d9329 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def command(note) do | |
| "play -qn synth 2 pluck #{note}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def play(note) do | |
| note | |
| |> command | |
| |> (&( String.split(&1, " ") )).() | |
| |> (&( System.cmd( hd(&1), tl(&1) ) )).() | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def play(note) do | |
| note |> command |> System.cmd | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From Elixir sips, free episode 62.
The
play/1doesn't work with the MASTER Elixir build anymore at the time of writing this, so I aim to rewrite it innew.ex.