Possible to parse text into midi note numbers within max?
Hi friends,
I have an idea for a generative patch where I would open a text file and the letters world be turned in to midi note numbers a=1, b=2, etc.
I could probably figure out how to write a php function to parse the text and make a string of numbers, but I'd love to have this be a completely self contained patch if possible. Any advice appreciated!
One way: [atoi] then [table] to convert the numbers to what you want.
Thank you very much. I'm making some interesting things happen with the [atoi] going in to a [makenote]. The [atoi] is outputting a string of numbers all at once. Is there a way to make that string come out one at a time-like with a [bang]?
EDIT: I've made a bit of progress. I am sending [atoi] into a [listfunnel] followed by [unpack]. THat is now giving me the individual numbers outputting one at a time. I just need to now figure out how to slow down that output into a meaningful speed (ideally clocked to a metronome).
Part of the patcher in this post might help? https://cycling74.com/forums/%22slowly%22-outputting-message-as-individual-ascii-ints
I would pack output of itoa into coll or another text object.
You can use iter to produce individual output of the list.
Than You can just call coll address to spit out the note number,
or if You decide for text object line $1.
Here is a little patch using text object, without ascii to midi note map...
@Bill I see you have answered this before! That worked perfectly. Thank you-and now I need to go sit with it to understand why it does what it does!
@source Audio. Thanks! I will check it out!