title: Generate Semitones
date: 2013-09-16
category: cli
-tags: perl
+tags: python audio
---
-```perl
-#!/bin/perl
-my $m = 2 ** (1/12);
-foreach my $s (0..12) {
- print int(0.5 + 1000 * $m ** $s-1000), "\n";
-}
+```python
+# python
+m = 2 ** (1/12)
+for s in range(13):
+ print(int(0.5 + 1000 * m ** s - 1000))
+```
-prints:
+```bash
+# output
semitone - fine
0 - 0
1 - 59
12 - 1000
```
-[gist](https://gist.github.com/quilime/59fc3af7c5f30ca2399f#file-semitones-pl)
-
-
pre, code {
color:#4fa;
line-height:1.4em;
- font-size:14px;
font-family:menlo, monaco, "Lucida Console", monospace;
- padding:1px 5px 2px;
+/* padding:1px 5px 2px;*/
background:#303030;
border-radius:4px;
text-indent: 0;
overflow: auto;
}
code {
-padding:2px 6px;
}
table, td, tr {
margin:0;