• svanya

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

    DNA Sequence (Nucleotide) Player: Converting nucleotide sequences to (midi) Music

    capture14894.png

    Credits:

    All source data is retrieved from the "Nucleotide Database" (DB) via National Center for Biotechnology Information, U.S. National Library of Medicine (NCBI) at
    https://www.ncbi.nlm.nih.gov/nucleotide/

    Miller Puckette for the J08.classicsynth

    and

    the creator(?) of the vlist2symbol abstraction.

    Requirements:

    wget, Linux command line web retrieval tool
    Linux
    ggee, [shell]
    cyclone, [counter]

    Use Case:

    Actors: those who want to hear the patterns in DNA nucleotide sequences and/or comprehend how Nature makes Music not "noise"/Gene sequences are like one of Nature's "voices"/

    Case:
    Enter the "Accession" (identification number (id)) of a NCBI DB entry into the id symbol field

    Case:
    Click on "LOAD"

    Case:
    Click "PLAY".

    Instructions:

    1-Go to the DB (https://www.ncbi.nlm.nih.gov/nucleotide/) and find an Accession(id) of a sequence;
    2-Enter that value into the ID [symbol] box of the patch
    3-Click the "LOAD" [button/bang];
    4-Set pitch, velocity, duration, and repeat for G,A,C, and T (representing the four nucleotide bases of a DNA strand — guanine, cytosine, adenine, and thymine);
    5-Toggle "PLAY" to 1, i.e. to On, to hear the sequence using the variables you set in 4) and to "0" to stop it.

    How It Works:

    The patch takes the input ID and packs it into a string as the FILE(Path) for wget.

    The wget command is then sent as a list to a shell object.

    The output of the shell object is then parsed (using an intermediate [text] object) into a [text] object with each line being 4 characters long, each character being either G,C,A, or T.

    Once loaded and Play is clicked, each line is then reconstructed as a midi note with the pitch as determined by the first character, velocity (2nd) and duration (3rd) and repeated as many times as the 4th character dictates (as set in 4) above).

    Once the entire sequence is played, the player stops sending notes.

    Inlets(left to right):

    id, either numbers or symbols
    values, a 16 item list of 4x4 sets of pitch, velocity, duration, repeat (i.e. one set per nucleotide type, G,C,A, or T) (Note: the sequence, if loaded, will play immediately upon receipt of this list.)
    beats per minute, bpm, esp. as it relates to note durations.

    Outlets:
    the current midi note, i.e. pitch/velocity/duration
    id (of the gene sequence)
    sequence name, as listed by the NCBI DB
    nucleotide being played as a string, ex. GGAC

    AFTERWARD:

    1. Since it really is only sending midi value it can be connected to whatever synth you would like;

    2. Elsewhere on this Forum, I shared a patch which took "noise" as its input and converted it into music using sigmund~, in that case "running water" as its source. (See for reference: https://forum.pdpatchrepo.info/topic/12108/converting-noise-to-music-rushing-water-using-sigmund) This patch takes that concept and applies it to what might also be called "noise", DNA sequences, were it not that the results (like the running water, yet even more so) sound like "Music".

    This exploration has me wondering...

    How can we delineate what is noise (only natural at this point) and what is music?

    Is the creative/ordering/soulful nature's being expressed in our own music not also being expressed by Nature itself? ...so that we might be considered one "bow" playing upon it?

    And, if by Music we mean notes laid down on purpose, might not it be said that is what Nature has been done? Is doing?

    I hope you find the patch useful, stimulating, and exciting, or at the very least funny to think about.

    Love through Music, no matter in what state Life may find you,
    Peace,
    Scott

    posted in patch~ read more
  • svanya

    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.

    posted in abstract~ read more
  • svanya

    After learning from @ingox work I came up with this. (Especially since :-) his patch was confusing me.)

    It just accumulates bangs via [v] and then triggers via [del] whatever it is currently at after a given ($f1 or inlet) window (in milliseconds). Ex. so if >2 then it's a long press, 1=single, and 2=double.

    I hope it helps someone. Esp as it pertains to using Mobmuplat with a Bluetooth keyboard as a footswitch/stompbox.

    Cheers! Thank you @ingox and @bang for your contributions to this matter.

    Peace.
    -Scott

    singledoublelong-help.pd
    singledoublelong.pd

    p.s. for ease of use, you could make a copy with "sdl.pd" as the filename.

    posted in abstract~ read more
  • svanya

    @Joseph-Mikkelson
    I apologize for taking so long to get back.

    Here is the .zip with the adsr included (from the "puredata/doc/3.audio.examples" folder) and the "simple-recorder~(atemporanity)(woTables).pd" which does the recording.
    If you unzip all the files from the zip into a directory the "noise-to-music~.pd" file should point to those abs in that directory.

    noise-to-music~.zip

    I hope this helps. Do let me know if it doesn't and we will get it worked out.

    Peace.
    -Scott

    posted in output~ read more
  • svanya

    @ingox Thank you, so much for these ingox.

    Is there any way you could help me wrap in a longpress?

    So [bngdblbng] becomes [bngdbllong]? esp. as it pertains to [key] and [keyup].

    If so, I could use my bluetooth keyboard as a footpedal with my android (via MMP) and only have 2 buttons yet capture 3 states per button, ex. record | play | bypass.

    If not, no sweat. I understand.

    Peace, and thanks again, for the work done alread. (Much better than mine).
    -S

    posted in abstract~ read more
  • svanya

    @Joseph-Mikkelson
    Here you go.
    Notes:

    1. it should really be [openpanel] but I created it on it a lark. So leave that up to you/others to do.
    2. IMPORTANT it starts recording the transformation once you play the loop so analyze/amend the patch before you begin.

    May it bring you many happy returns.
    -S

    noise-to-music~.zip

    posted in output~ read more
  • svanya

    This is a transformation of a rushing gulley of water (down from my apartment after a Big Texas thunderstorm).
    It takes the (supposed) "noise" of the rushing water and converts it to music (using Pure Data/sigmund~) by 1) rounding the incoming frequencies to integers and converting them to midi pitches, 2) converting the volumes to note durations, 3) leaving all notes a velocity maximum (127), and then 3) sending them to a synthesizer ("J08.classicsynth.pd").

    I find the result to be 1) enormously pleasing and 2) proof of the point: Nature NEVER makes "noise".

    In one way or another all living audio may be heard as "music". You just have to be listening correctly.

    Peace and Love ever-growing out of You.
    -s

    https://m.soundcloud.com/scott-vanya/rushing-water-below-spillway-after-tstorm

    posted in output~ read more
  • svanya

    @bang Cool. I'd love to see it. Can you share it here? Thanks.

    posted in abstract~ read more
  • svanya

    bngdblbng.png

    bngdblbng-help.pd
    bngdblbng.pd

    First I want to thank @Balwyn for giving me some sense of how I might do this (and the keyname trigger in the help file is his).

    Use:
    Capture a bang as either bang or double-bang by setting a metronome on the first bang.
    If the [f] is at 1 when it hits the next beat then it's a bang. If it's at 2, then it's double-bang.

    Me? I am going to use it with my arduino footpedal as well as my usb-keyboard ([keyname]) foot-switches.

    I hope you may find a use for it.

    Peace and ever-living Music.
    -S

    The abs:

    capture5772.png

    posted in abstract~ read more
  • svanya

    @Balwyn
    Thank you, so much for the help/patch. Works like a charm to capture dblclick.

    Am going to look more closely at it to coerce out both the double and single clicks to trigger 2 tgls. (😀 Unless you can get back with me first with a 2nd patch that does that.)

    Much thanks. Empowers me to move on with my idea. And Very useful to put in my local abs folder.

    Peace.
    -S

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!