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