Kyma Forum
  Kyma Support
  DNA Echoes

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   DNA Echoes
robertjarvis
Member
posted 25 January 2007 15:32         Edit/Delete Message   Reply w/Quote
I'm having fun listening to DNA strings using the 'Text to Pitch' prototype. Here is the DNA for the tobacoo plant (Nicotiana) for example: -

GGTTCTGGGGTTTCCACGCTTGAAAAAAAAAACCCGGGGCGTGTCGTCCAAATCATCGGTCCGGTACTAGA
TGTAGCCTTTCCCCCGGGCAAGATGCCGAATATTTATAACGCTCTGGTAGTTCAAGGTCGAGATAGTGTTG
GTCAACCAATTAATGTGGCTTGTGAGGTACAGCAATTATTAGGAAATAATCGAGTTAGGGCTATAGCTATG
AGTGCTACAGAGGGTCTAACGAGAGGAATGGAAGTGATTGACACAGGAGCTCCTATAAGTGTTCCGGTCGG
GGGAGCGACTCTGGGACGAATTTTTAACGTGCTCGGAGAACCTGTTGATAATTTAGGGCCTGTAGATACTA
GTACAACGTCTCCTATTCATAGATCTGCGCCCGCCTTTATACAGTTGGATACAAAATTATCTATTTTTGAA
ACAGGAATTGAAGTAGTAGATCTTTTAGCCCCTTATCGCCGTGGAGGAAAAATCGGACTATTCGGGGGAGC
TGGAGTGGGTAAAACAGTACTTATTATGGAATTGATTAACAATTAAAGCTCACGGGGGCGTATCCGTATTT
GGCGGAGTGGGTGAACGTACTCGGGAAGGAAATGATCTTTACATGGAAATGAAAGAATCTGGAGTAATTAA
TGAAGAAAATATTGCAGAATCAAAAGTAGCCCTAGTTTATGGTCAGATGAATGAACCGCCGGGAGCTCGTA
TGAGAGTTGGTTTGACTGCCCTAACTATGGCGGAATATTTCCGAGATGTTAATGAGCAAGACGTACTTCTT
TTTATTGACAATATCTTCCGTTTCGTCCAAGCAGGATCCGAAGTATCGGCCTTATTGGGTAGAATGCCTTC
CGCTGTGGGTTATCAACCCACCCTGAGTACCGAAATGGGTTCTTTACAAGAAAGAATTACTTCTACCAAAG
AAGGGTCCATAACCTCTATTCAAGCAGTTTATGTACCCGCAGACGATTTGACCGACCCTGCTCCTGCTACG
ACATTTGCACATTTAGATGCTACTACCGTACTATCAAGAGGATTGGCTGCCAAAGGTATTTATCCAGCAGT
AGATCCTTTAGATTCAACGTCAACCATGCTTCAACCTCGGATCGTTGGTGAGGAACATTACGAAACCGCCC
AAAGAGTTAAGCAAACTTTACAACGTTACAAAGAACTTCAGGACATTATAGCTATCCTTGGATTGGACGAA
TTATCCGAAGAGGATCGTTTACTCGTAGCAAGAGCGCGAAAAATTGAGCGTTTCTTATCACAACCCTTTTT
CGTAGCAGAAGTATTTACCGGTTCTCCAGGTAAATATGTTGGTCTAGCAGAAACAATTCGAGGATTTCAAT
TGATCCTTTCCGGAGAATTAGATGGTCTTCCTGAACAGGCCTTTTATTTGGTAGGTAACATCGATGAAGCT
ACCGCGAAGGCTATG AACTTAGAAATGGAGAGCAATTTGAAGAA

Now notice that there are many repeating sequences in the chain.

I was wondering whether if it was possible to script that every time a letter (or sequence of letters) was immediately repeated it could be played at a quieter volume than its last playing. When the repeating pattern was over, the next time it was played it would be at its first volume.

For example the beginning of the chain: GGTTCTGGGGT would be two 'G' notes, the second of which would be quieter; two 'T' notes, the second of which would be quieter; a 'C' note; then a 'T' note sounding at its first (louder) volume; four 'G' notes each getting quieter; and a 'T' not sounding at its original volume.

Is there an easy way to script this, or do I do it manually?

Any help/advice (or other stimulating input) greatly appreciated.

Thanks!


Robert

[This message has been edited by robertjarvis (edited 29 January 2007).]

IP: Logged

SSC
Administrator
posted 25 January 2007 22:44         Edit/Delete Message   Reply w/Quote
If you save the previous event's pitch and amplitude in variables, you could have something like

prevPch = pch ifTrue: [vol := prevVol * 0.5].
prevPch := pch.
prevVol := vol.

If this is not what you need, please post your script here and I could try to offer a more specific suggestion.

IP: Logged

robertjarvis
Member
posted 29 January 2007 12:29         Edit/Delete Message   Reply w/Quote

Catalpa.zip

 
Thanks for your reply. Unfortunately, I am having a difficult time getting started with this as scripting is not my Forte (yet).... If you have the time, I would be grateful if you could give me a few more hints.

I have a few ideas that I would like to eventually incorporate: For example, would it be possible to control which part of the file is being read (i.e., characters 11 - 120) and might it be possible to change this parameter in real time?

In the meantime, I'll keep plugging away....

IP: Logged

SSC
Administrator
posted 30 January 2007 10:33         Edit/Delete Message   Reply w/Quote

Catalpa.kym

 
That's a nice way to deal with the repeating pitches! I've attached a modified Sound. The main loop is (with apologies for the lack of tabs):

prevPch := 60.
prevVol := 1.

[f atEnd] whileFalse: [ | newPch newVol |

"Read next character from the file and turn it into an integer."
nbr := f next asInteger.
newPch := nbr max: 12.

"For characters, increment time by one beat. For punctuation, increment by one quarter beat."
(nbr < 97) ifTrue: [t := t + 1] ifFalse: [t := t + 0.25].

"If the new pitch is the same as the previous pitch, halve the volume."
(prevPch = newPch)
ifTrue: [newVol := prevVol * 0.5]
ifFalse: [newVol := 1].

self
keyDownAt: t beats
duration: 1 beats
frequency: newPch nn
velocity: newVol.

"Save the current pitch and volume to compare against the next item read from the file."
prevPch := newPch.
prevVol := newVol].

IP: Logged

robertjarvis
Member
posted 01 February 2007 07:39         Edit/Delete Message   Reply w/Quote
Thanks. I'll examine this, play around with it, add and subtract ideas, and see what I come up with!

IP: Logged

SSC
Administrator
posted 01 February 2007 09:29         Edit/Delete Message   Reply w/Quote
"add and subtract ideas, and see what I come up with!"

recombinant life forms?

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c