Skip to content

Instantly share code, notes, and snippets.

@arafatkamaal
Last active September 24, 2015 00:17
Show Gist options
  • Save arafatkamaal/e73049f30357dea56212 to your computer and use it in GitHub Desktop.
Save arafatkamaal/e73049f30357dea56212 to your computer and use it in GitHub Desktop.
To emit notes in pairs in a interval for recorder practice.
my Bool $highs_only = False;
my Bool $lows_only = True;
my Str @notes;
if $highs_only {
@notes = <C C# D Eb E F F# G G# A Bb B>;
} elsif $lows_only {
@notes = <Low-C Low-C# Low-D Low-Eb Low-E Low-F Low-F# Low-G Low-G# Low-A Low-Bb Low-B>;
} else {
@notes = <C C# D Eb E F F# G G# A Bb B Low-C Low-C# Low-D Low-Eb Low-E Low-F Low-F# Low-G Low-G# Low-A Low-Bb Low-B>;
}
my $seconds = 4; #Number of seconds you want between each pair of notes is displayed.
my Int $pair = 1; #Number of notes you want to pair at one time.
for 0 .. Inf {
sleep( $seconds * 1 );
print "\e[H";
print "\e[J";
for 1 .. $pair {
print @notes.pick ~ ' ';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment