]> git.quilime.com - quilime.com.git/commitdiff
Updating to Python
authorGabriel Dunne <gdunne@quilime.com>
Fri, 7 Jul 2023 05:16:56 +0000 (22:16 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Fri, 7 Jul 2023 05:16:56 +0000 (22:16 -0700)
_posts/cli/2013-09-16-gen_semitones.md
css/highlight.css
css/style.css

index 7b0ffcf042e1500c160fa8ddd3cca5b7224f2153..c770eeca480bd3e203e43099fb97e535b248dbe0 100644 (file)
@@ -2,17 +2,18 @@
 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
@@ -29,6 +30,3 @@ semitone - fine
 12 - 1000
 ```
 
-[gist](https://gist.github.com/quilime/59fc3af7c5f30ca2399f#file-semitones-pl)
-
-
index d46bd299e253587be8324028328d011e32dbf29b..4bee9b397c4db0e8ed4ede948a31cb030a976684 100644 (file)
@@ -39,7 +39,7 @@
   color: #403d3d;
 }
 .highlight .go {
-  color: #403d3d;
+  color: #4fa;
 }
 .highlight .gp {
   color: #66d9ef;
index 9bc126ffb5dcdde5b711b3136deba56b20df8f28..61f89e4a76f12c4a8ec48e57e2863825fb61f21b 100644 (file)
@@ -98,9 +98,8 @@ blockquote {
 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;
@@ -113,7 +112,6 @@ pre {
     overflow: auto;
 }
 code {
-padding:2px 6px;
 }
 table, td, tr {
   margin:0;