diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-10-31 10:17:43 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-10-31 10:17:43 +0100 |
| commit | ae24d9a8869c497537839f330384cbadb2cf687c (patch) | |
| tree | 79184f1d1db6f0b8e2f7aad3a262b3a2bccdde58 /public/what-would-dna-sound-if-synthesized.html | |
| parent | 409dfae3983b55ffa469a556683fab4ec70b1e99 (diff) | |
| download | mitjafelicijan.com-ae24d9a8869c497537839f330384cbadb2cf687c.tar.gz | |
Updated theme
Diffstat (limited to 'public/what-would-dna-sound-if-synthesized.html')
| -rwxr-xr-x | public/what-would-dna-sound-if-synthesized.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/public/what-would-dna-sound-if-synthesized.html b/public/what-would-dna-sound-if-synthesized.html index 5b8b082..8c02137 100755 --- a/public/what-would-dna-sound-if-synthesized.html +++ b/public/what-would-dna-sound-if-synthesized.html | |||
| @@ -102,7 +102,7 @@ in Python.</blockquote><h2 id=generating-spectograms>Generating Spectograms</h2> | |||
| 102 | out to use the <a href=https://linux.die.net/man/1/sox>SoX - Sound eXchange, the Swiss Army knife of audio | 102 | out to use the <a href=https://linux.die.net/man/1/sox>SoX - Sound eXchange, the Swiss Army knife of audio |
| 103 | manipulation</a> one because it didn't require | 103 | manipulation</a> one because it didn't require |
| 104 | anything else.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>sox output.wav -n spectrogram -o spectrogram.png | 104 | anything else.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>sox output.wav -n spectrogram -o spectrogram.png |
| 105 | </span></span></code></pre><p>An example spectrogram of Ludwig van Beethoven Symphony No. 6 First movement.</p><audio controls><source src=/posts/dna-synthesized/symphony-no6-1st-movement.mp3 type=audio/mpeg></audio><figure><img src=/posts/dna-synthesized/symphony-no6-1st-movement.png alt="Ludwig van Beethoven Symphony No. 6 First movement"></figure><p>The other option could also be in combination with | 105 | </span></span></code></pre><p>An example spectrogram of Ludwig van Beethoven Symphony No. 6 First movement.</p><audio controls><source src=/posts/dna-synthesized/symphony-no6-1st-movement.mp3 type=audio/mpeg></audio><figure><img loading="lazy" src=/posts/dna-synthesized/symphony-no6-1st-movement.png alt="Ludwig van Beethoven Symphony No. 6 First movement"></figure><p>The other option could also be in combination with |
| 106 | <a href=http://www.gnuplot.info/>gnuplot</a>. This would require an intermediary step, | 106 | <a href=http://www.gnuplot.info/>gnuplot</a>. This would require an intermediary step, |
| 107 | however.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>sox output.wav audio.dat | 107 | however.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>sox output.wav audio.dat |
| 108 | </span></span><span style=display:flex><span>tail -n+3 audio.dat > audio_only.dat | 108 | </span></span><span style=display:flex><span>tail -n+3 audio.dat > audio_only.dat |
| @@ -135,21 +135,21 @@ this.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex> | |||
| 135 | </span></span></code></pre><h2 id=pre-generated-sequences>Pre-generated sequences</h2><p>What I did was take interesting parts from an animal's genome and feed it to a | 135 | </span></span></code></pre><h2 id=pre-generated-sequences>Pre-generated sequences</h2><p>What I did was take interesting parts from an animal's genome and feed it to a |
| 136 | tone generator script. This then generated a WAV file and I converted those to | 136 | tone generator script. This then generated a WAV file and I converted those to |
| 137 | MP3, so they can be played in a browser. The last step was creating a | 137 | MP3, so they can be played in a browser. The last step was creating a |
| 138 | spectrogram based on a WAV file.<h3 id=niels-bohr-quote>Niels Bohr quote</h3><audio controls><source src=/posts/dna-synthesized/quote/out.mp3 type=audio/mpeg></audio><figure><img src=/posts/dna-synthesized/quote/spectogram.png alt=Spectogram></figure><h3 id=mouse>Mouse</h3><p>This is part of a mouse genome <code>Mus_musculus.GRCm39.dna.nonchromosomal</code>. You | 138 | spectrogram based on a WAV file.<h3 id=niels-bohr-quote>Niels Bohr quote</h3><audio controls><source src=/posts/dna-synthesized/quote/out.mp3 type=audio/mpeg></audio><figure><img loading="lazy" src=/posts/dna-synthesized/quote/spectogram.png alt=Spectogram></figure><h3 id=mouse>Mouse</h3><p>This is part of a mouse genome <code>Mus_musculus.GRCm39.dna.nonchromosomal</code>. You |
| 139 | can get <a href=http://ftp.ensembl.org/pub/release-106/fasta/mus_musculus/dna/>genom data | 139 | can get <a href=http://ftp.ensembl.org/pub/release-106/fasta/mus_musculus/dna/>genom data |
| 140 | here</a>.</p><audio controls><source src=/posts/dna-synthesized/mouse/out.mp3 type=audio/mpeg></audio><figure><img src=/posts/dna-synthesized/mouse/spectogram.png alt=Spectogram></figure><h3 id=bison>Bison</h3><p>This is part of a bison genome <code>Bison_bison_bison.Bison_UMD1.0.cdna</code>. You can | 140 | here</a>.</p><audio controls><source src=/posts/dna-synthesized/mouse/out.mp3 type=audio/mpeg></audio><figure><img loading="lazy" src=/posts/dna-synthesized/mouse/spectogram.png alt=Spectogram></figure><h3 id=bison>Bison</h3><p>This is part of a bison genome <code>Bison_bison_bison.Bison_UMD1.0.cdna</code>. You can |
| 141 | get <a href=http://ftp.ensembl.org/pub/release-106/fasta/bison_bison_bison/cdna/>genom data | 141 | get <a href=http://ftp.ensembl.org/pub/release-106/fasta/bison_bison_bison/cdna/>genom data |
| 142 | here</a>.</p><audio controls><source src=/posts/dna-synthesized/bison/out.mp3 type=audio/mpeg></audio><figure><img src=/posts/dna-synthesized/bison/spectogram.png alt=Spectogram></figure><h3 id=taurus>Taurus</h3><p>This is part of a taurus genome <code>Bos_taurus.ARS-UCD1.2.cdna</code>. You can get | 142 | here</a>.</p><audio controls><source src=/posts/dna-synthesized/bison/out.mp3 type=audio/mpeg></audio><figure><img loading="lazy" src=/posts/dna-synthesized/bison/spectogram.png alt=Spectogram></figure><h3 id=taurus>Taurus</h3><p>This is part of a taurus genome <code>Bos_taurus.ARS-UCD1.2.cdna</code>. You can get |
| 143 | <a href=http://ftp.ensembl.org/pub/release-106/fasta/bos_taurus/cdna/>genom data | 143 | <a href=http://ftp.ensembl.org/pub/release-106/fasta/bos_taurus/cdna/>genom data |
| 144 | here</a>.</p><audio controls><source src=/posts/dna-synthesized/taurus/out.mp3 type=audio/mpeg></audio><figure><img src=/posts/dna-synthesized/taurus/spectogram.png alt=Spectogram></figure><h2 id=making-a-drummer-out-of-a-dna-sequence>Making a drummer out of a DNA sequence</h2><p>To make things even more interesting, I decided to send this data via MIDI to my | 144 | here</a>.</p><audio controls><source src=/posts/dna-synthesized/taurus/out.mp3 type=audio/mpeg></audio><figure><img loading="lazy" src=/posts/dna-synthesized/taurus/spectogram.png alt=Spectogram></figure><h2 id=making-a-drummer-out-of-a-dna-sequence>Making a drummer out of a DNA sequence</h2><p>To make things even more interesting, I decided to send this data via MIDI to my |
| 145 | <a href=https://www.elektron.se/en/model-samples>Elektron Model:Samples</a>. This is a | 145 | <a href=https://www.elektron.se/en/model-samples>Elektron Model:Samples</a>. This is a |
| 146 | really cool piece of equipment that supports MIDI in via USB and 3.5 mm audio | 146 | really cool piece of equipment that supports MIDI in via USB and 3.5 mm audio |
| 147 | jack.<p>Elektron is connected to my MacBook via USB cable and audio out is patched to a | 147 | jack.<p>Elektron is connected to my MacBook via USB cable and audio out is patched to a |
| 148 | Sony Bluetooth speaker I have that supports 3.5 mm audio in. Elektron doesn't | 148 | Sony Bluetooth speaker I have that supports 3.5 mm audio in. Elektron doesn't |
| 149 | have internal speakers.<figure><img src=/posts/dna-synthesized/elektron/IMG_0619.jpg alt></figure><figure><img src=/posts/dna-synthesized/elektron/IMG_0620.jpg alt></figure><figure><img src=/posts/dna-synthesized/elektron/IMG_0622.jpg alt></figure><p>For communicating with Elektron, I choose <code>pygame</code> Python module that has MIDI | 149 | have internal speakers.<figure><img loading="lazy" src=/posts/dna-synthesized/elektron/IMG_0619.jpg alt></figure><figure><img loading="lazy" src=/posts/dna-synthesized/elektron/IMG_0620.jpg alt></figure><figure><img loading="lazy" src=/posts/dna-synthesized/elektron/IMG_0622.jpg alt></figure><p>For communicating with Elektron, I choose <code>pygame</code> Python module that has MIDI |
| 150 | built in. With this, it was rather simple to send notes to the device. All I did | 150 | built in. With this, it was rather simple to send notes to the device. All I did |
| 151 | was map MIDI notes to the actual Nucleotides.<p>Before all of this I also checked Audio MIDI Setup app under MacOS and checked | 151 | was map MIDI notes to the actual Nucleotides.<p>Before all of this I also checked Audio MIDI Setup app under MacOS and checked |
| 152 | MIDI Studio by pressing ⌘-2.<figure><img src=/posts/dna-synthesized/elektron/midi-studio.jpg alt></figure><p>The whole script that parses and send notes to the Elektron looks like this.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:#00f>import</span> pygame.midi | 152 | MIDI Studio by pressing ⌘-2.<figure><img loading="lazy" src=/posts/dna-synthesized/elektron/midi-studio.jpg alt></figure><p>The whole script that parses and send notes to the Elektron looks like this.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:#00f>import</span> pygame.midi |
| 153 | </span></span><span style=display:flex><span><span style=color:#00f>import</span> time | 153 | </span></span><span style=display:flex><span><span style=color:#00f>import</span> time |
| 154 | </span></span><span style=display:flex><span> | 154 | </span></span><span style=display:flex><span> |
| 155 | </span></span><span style=display:flex><span>pygame.midi.init() | 155 | </span></span><span style=display:flex><span>pygame.midi.init() |
| @@ -199,11 +199,11 @@ intriguing, biological, natural.<p>I actually find the results fascinating. I to | |||
| 199 | music of nature. Even though it's quite the same, it's also quite different. | 199 | music of nature. Even though it's quite the same, it's also quite different. |
| 200 | The subtle differences on repeat kind of creates music on its own. Makes you | 200 | The subtle differences on repeat kind of creates music on its own. Makes you |
| 201 | wonder. It kind of puts Occam’s Razor in its place. Nature for sure loves to | 201 | wonder. It kind of puts Occam’s Razor in its place. Nature for sure loves to |
| 202 | make things as energy efficient as possible.</div></article></main><section><hr><h2>Posts from blogs I follow around the net</h2><ul><li><a href=https://utcc.utoronto.ca/~cks/space/blog/solaris/ZFSWhyNotDirectoryToFilesystem target=_blank rel=noopener>One reason that ZFS can't turn a directory into a filesystem</a> — <a href=https://utcc.utoronto.ca/~cks/space/blog/>Chris's Wiki :: blog</a><div>One of the wishes that I and other people frequently have for ZFS | 202 | make things as energy efficient as possible.</div></article></main><section><hr><h2>Posts from blogs I follow around the net</h2><ul><li><a href=https://utcc.utoronto.ca/~cks/space/blog/linux/NFSv4ServerLockClients target=_blank rel=noopener>Finding which NFSv4 client owns a lock on a Linux NFS(v4) server</a> — <a href=https://utcc.utoronto.ca/~cks/space/blog/>Chris's Wiki :: blog</a><div>A while back I wrote an entry about finding which NFS client owns |
| 203 | is the ability to take an existing directory (and everything | 203 | a lock on a Linux NFS server, which turned |
| 204 | underneath it) in a ZFS filesystem and turn it into a sub-filesystem | 204 | out to be specific to NFS v3 (which I really should have seen coming, |
| 205 | of its own. One reason for wanting this is that a number of things | 205 | since it involved NLM and lockd). Finding the NFS v4 client that |
| 206 | are set and controlled on a per-filesyst…<li><a href=http://www.landley.net/notes-2023.html#28-10-2023 target=_blank rel=noopener>October 28, 2023</a> — <a href=http://www.landley.net/notes-2023.html>Rob Landley's Blog Thing for 2023</a><div>Oh good grief, two of my least favorite licensing people, Larry Rosen | 206 | owns a lock is, depending on your perspective, either simpl…<li><a href=http://www.landley.net/notes-2023.html#28-10-2023 target=_blank rel=noopener>October 28, 2023</a> — <a href=http://www.landley.net/notes-2023.html>Rob Landley's Blog Thing for 2023</a><div>Oh good grief, two of my least favorite licensing people, Larry Rosen |
| 207 | and Bradley Kuhn, are interacting on the OSI's license-discuss | 207 | and Bradley Kuhn, are interacting on the OSI's license-discuss |
| 208 | list where the're doing | 208 | list where the're doing |
| 209 | bad computer history and insisting that a guy Larry Rosen | 209 | bad computer history and insisting that a guy Larry Rosen |
