aboutsummaryrefslogtreecommitdiff
path: root/public/what-would-dna-sound-if-synthesized.html
diff options
context:
space:
mode:
Diffstat (limited to 'public/what-would-dna-sound-if-synthesized.html')
-rwxr-xr-xpublic/what-would-dna-sound-if-synthesized.html24
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>
102out to use the <a href=https://linux.die.net/man/1/sox>SoX - Sound eXchange, the Swiss Army knife of audio 102out to use the <a href=https://linux.die.net/man/1/sox>SoX - Sound eXchange, the Swiss Army knife of audio
103manipulation</a> one because it didn't require 103manipulation</a> one because it didn't require
104anything else.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>sox output.wav -n spectrogram -o spectrogram.png 104anything 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,
107however.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>sox output.wav audio.dat 107however.<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 &gt; audio_only.dat 108</span></span><span style=display:flex><span>tail -n+3 audio.dat &gt; 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
136tone generator script. This then generated a WAV file and I converted those to 136tone generator script. This then generated a WAV file and I converted those to
137MP3, so they can be played in a browser. The last step was creating a 137MP3, so they can be played in a browser. The last step was creating a
138spectrogram 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 138spectrogram 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
139can get <a href=http://ftp.ensembl.org/pub/release-106/fasta/mus_musculus/dna/>genom data 139can get <a href=http://ftp.ensembl.org/pub/release-106/fasta/mus_musculus/dna/>genom data
140here</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 140here</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
141get <a href=http://ftp.ensembl.org/pub/release-106/fasta/bison_bison_bison/cdna/>genom data 141get <a href=http://ftp.ensembl.org/pub/release-106/fasta/bison_bison_bison/cdna/>genom data
142here</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 142here</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
144here</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 144here</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
146really cool piece of equipment that supports MIDI in via USB and 3.5 mm audio 146really cool piece of equipment that supports MIDI in via USB and 3.5 mm audio
147jack.<p>Elektron is connected to my MacBook via USB cable and audio out is patched to a 147jack.<p>Elektron is connected to my MacBook via USB cable and audio out is patched to a
148Sony Bluetooth speaker I have that supports 3.5 mm audio in. Elektron doesn't 148Sony Bluetooth speaker I have that supports 3.5 mm audio in. Elektron doesn't
149have 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 149have 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
150built in. With this, it was rather simple to send notes to the device. All I did 150built in. With this, it was rather simple to send notes to the device. All I did
151was map MIDI notes to the actual Nucleotides.<p>Before all of this I also checked Audio MIDI Setup app under MacOS and checked 151was map MIDI notes to the actual Nucleotides.<p>Before all of this I also checked Audio MIDI Setup app under MacOS and checked
152MIDI 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 152MIDI 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
199music of nature. Even though it's quite the same, it's also quite different. 199music of nature. Even though it's quite the same, it's also quite different.
200The subtle differences on repeat kind of creates music on its own. Makes you 200The subtle differences on repeat kind of creates music on its own. Makes you
201wonder. It kind of puts Occam’s Razor in its place. Nature for sure loves to 201wonder. It kind of puts Occam’s Razor in its place. Nature for sure loves to
202make 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 202make 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
203is the ability to take an existing directory (and everything 203a lock on a Linux NFS server, which turned
204underneath it) in a ZFS filesystem and turn it into a sub-filesystem 204out to be specific to NFS v3 (which I really should have seen coming,
205of its own. One reason for wanting this is that a number of things 205since it involved NLM and lockd). Finding the NFS v4 client that
206are 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 206owns 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
207and Bradley Kuhn, are interacting on the OSI's license-discuss 207and Bradley Kuhn, are interacting on the OSI's license-discuss
208list where the're doing 208list where the're doing
209bad computer history and insisting that a guy Larry Rosen 209bad computer history and insisting that a guy Larry Rosen