Proof of Concept- RNA (genetic) Sequence to Music (midi) Interpreter

gene-seq-to-music-via-pd~.zip

sample output: gene-seq-to-music-via-pd~.mp3

Input:

  1. an RNA sequence .txt file (one is provided, "data/data-001.txt");
  2. laid out in 3 columns of;
  3. g,a, c and t's;
  4. with either a g,a, c, or t in each column.

(The raw data is available for public use at many sites online, ex. https://www.ncbi.nlm.nih.gov/nuccore/advanced)

(Currently, laying the file out in 3 columns must be done manually. Though, to those more inclined, I do think it would be relatively easy to write a parser. If you do write one, please, share it below).)

Process/GUI:

  1. Select a pitch [0..127], velocity [0..127], and duration [0..4]={1/16,1/8, 1/4, 1/2, or whole note in 4/4 time, i.e. 125ms^x} for each of the four nucleotides, i.e. g, a, c, and t.;
  2. Click [open];
  3. Browse to a data file (example, "data/data-001.txt") and open it;
  4. Click Stop|Play.

Behind the scenes:

The patch cycles thru each line of the data file and bangs each line and using [makenote] constructs a note of given pitch, velocity, and duration as determined by whether the value in the 1,2, or 3rd column is g,c,a, or t.

Once that note has played for the given duration it bangs (by changing the metro delay) the next line/note.

The data file included is from the NCRI website https://www.ncbi.nlm.nih.gov/nuccore/advanced page and is for "coxsackievirus B4 strain /ca/Roma partial VP1 gene", i.e. meningitis.

The .mp3 file above is an example (with quasi-random inputs for the GACT pitch, velocity, and duration values. "Quasi" especially since I do not understand midi, chords, scales, etc.. I would think, if one knew such things, they would make the pitches form a chord.)

I hope you find this as fun(ny) as I do.

Peace, go with Love, and Music flowing out of your heart,
-Scott

p.s. the synth used is from "pd-help/J08.classicsynth.pd". If you need any help getting this working, just let me know and I will be happy to provide as much as I can.