Program Description

  • This program provides a simple template for creating a parameter-mapping sonification (PMSon) of a DNA sequence using General MIDI (GM) instruments.
  • A DNA sequence is made up of four nucleotide bases: cytosine [C], guanine [G], adenine [A], and thymine [T].
  • In this PMSon, A, C, G & T are mapped to MIDI parameters: pitch, velocity, and duration in real time.
  • Since this patcher is the most complex one we have studied thus far, its constituent modules have been number 1-14. Each module is described below:
    • 1. On program load, the filein object reads the text file “insulin.txt”. Other DNA sequence file may be read into the program using the ‘read’ message.
      • This file is in the FASTA format.
      • The program reads the fileone character at a time.
      • Each character emerges from the left outlet of filein as an integer.
      • The itoa object converts the integers coming out of filein to Unicode/ASCII codes (decimal format) and sends them to the right side of the program (via s data) so they can be mapped to MIDI parameters.
    • 2. Turn the Play/pause toggle on and the PMSon will begin.
      • The PMSon is executed in real time.
      • The Reset button resets the counter to 0 on the next clock and erases the note event report in the Max Console.
    • 3. The metro object generates a rhythm. The rhythm is based on the incoming duration (r dur), which 200, 400, 600, or 800 ms. duration mapping set on the right side of the program.
    • 4. The counter object creates an index n that is used to read through the the “insulin.txt” file – one character at a time. There are 1431 characters in the file. The filein object receives the decremented index (n-1).
    • 5. A umenu displays the current base as an alpha character: C, G, A, or T.
    • 6. The current character is received from the left side of the program (r data) and is displayed: 65 is ‘A’, 67 is ‘C’; 71 is ‘G’; 84 is ‘T’,
    • 7. The sel object works as an if then control statement that controls the MIDI parameter mappings. The four possible bangs are displayed so the user can see the mapping.
    • 8. Create the pitch mappings. The current base-to-pitch mappings are ‘A’ maps A3, ‘C’ maps to C4, ‘G’ maps to G4, and ‘T’ maps to B4.
    • 9. Create the duration mappings. The current base-to-duration mappings are ‘A’ maps 200 ms., ‘C’ maps to 400 ms., ‘G’ maps to 600 ms., and ‘T’ maps to 800 ms.
    • 10. The current pitch and duration selections are displayed in the number boxes.
    • 11. The current pitch is harmonized with notes a perfect fifth above (+ 7) and below ( 7). This harmonization was chosen to complement the pitches A, C, G, and B and create a sense of parallel harmony.
    • 12. Pitch is mapped to velocity and scaled over a larger range.
    • 13. MIDI note-on/note-off pairs are constructed using the current pitch, velocity, and duration parameters.
    • 14. Choose a GM instrument from the umenu.
    • 15. The notate subpatcher (p notate) displays the current pitch on the nslider and prints a note event score in the Max Console listing the following for each melodic note event: n, DNA nucleotide base, pitch, velocity, and duration.

References

Grond, Florian, and Jonathan Berger. 2011. “Chapter 15. Parameter Mapping Sonification.” In The Sonification Handbook, T. Hermann, A. Hunt and J. G. Neuhoff, eds. Berlin: Logos Publishing House. Available online at: <https://sonification.de/handbook/chapters/chapter15/>.

Data credit: https://www.ncbi.nlm.nih.gov/gene?Db=gene&Cmd=DetailsSearch&Term=3630

Object Reference

Updated: 10/23/23