Skip to content

Instantly share code, notes, and snippets.

@elvis-epx
Created October 11, 2019 01:04
Show Gist options
  • Save elvis-epx/c02177775cf798830642008be0629383 to your computer and use it in GitHub Desktop.
Save elvis-epx/c02177775cf798830642008be0629383 to your computer and use it in GitHub Desktop.
#!/bin/bash
voice1=pluck
notes1="C4,1.3 F4,1 D#4,0.1 C#4,0.1 C4,1.2 F4,0.9 D#4,0.1 C#4,0.1 C4,0.5
F4,0.5 F4,0.5 G#4,0.5 G4,0.135 G#4,0.135 G4,0.135 F4,0.135 Eb4,0.135
F4,0.135 G,4"
notes2="G#3,1.3 G#3,1 A#3,0.1 A#3,0.1 G#3,1.2 C#4,0.9 A#3,0.1 A#3,0.1 G#3,0.5
G#3,0.5 C4,0.5 F4,0.5 D#4,0.135 D#4,0.135 Eb4,0.135 Eb4,0.135 Eb4,0.135
Eb4,0.135 Eb,4"
( for note in $(echo $notes1); do
tone=$(echo $note | sed 's/,.*$//')
dur=$(echo $note | sed 's/^.*,//')
play -qn synth $dur $voice1 $tone
done ) &
( for note in $(echo $notes2); do
tone=$(echo $note | sed 's/,.*$//')
dur=$(echo $note | sed 's/^.*,//')
play -qn synth $dur $voice1 $tone
done ) &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment