Skip to content

Instantly share code, notes, and snippets.

@quilime
Created September 16, 2013 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quilime/59fc3af7c5f30ca2399f to your computer and use it in GitHub Desktop.
Save quilime/59fc3af7c5f30ca2399f to your computer and use it in GitHub Desktop.
print semitones
#!/bin/perl
# prints:
# semitone - fine
# 0 - 0
# 1 - 59
# 2 - 122
# 3 - 189
# 4 - 260
# 5 - 335
# 6 - 414
# 7 - 498
# 8 - 587
# 9 - 682
# 10 - 782
# 11 - 888
# 12 - 1000
my $m = 2 ** (1/12);
foreach my $s (0..12) {
print int(0.5 + 1000 * $m ** $s-1000), "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment