Hello,
I hope this is correct use of this forum.
I am a naïve young student with a creative assignment in PureData (pd-extended). I hope to put PD to use to convert a short input phrase (through an [entry] box) into a series of sound, via each letter's ASCII code. I'm sure there'll be many things to learn along the way but I'm struggling even to get started: I don't know how to get from 'C' to '1, 0, 0, 0, 0, 1, 1'. I think [atoi] is relevant but I am struggling to understand it.
Yes, sadly I'm just signing up to steal the assistance of some kind soul.
Can anyone help me in this first stage?
Thanks.
-
ASCII to binary
-
[atoi] I think only converts symbols that are numbers into an integer and won't work for letters. The only object I've come across that converts symbols to their ASCII code is [ascseq]. Pd doesn't display numbers in binary form, but if you really need the individual digits, check out the attached patch.
-
I made something that might help you get started...only cause I wanted to do something similar and I didn't know [entrybox] exisited!
If you type in a word with spaces inbetween each letter,
then the letters get sent one by one to a select that will send them to a number.
That number is converted to a frequency( [mtof] ) used for an osc~ and sent to dac~It doesn't convert the letters to binary, and I wish didn't have to have spaces in the word but it works as far as being able to type something and make a sound.
-Kai
-
Thanks, both of these responses have been really helpful and I've got a strong start now. Like Kai, though, I don't know how to separate characters into individual messages without requiring spaces, and really need that. Any suggestions?
-
Use [symbol2list] from zexy to separate a word into a list of individual characters. To make it work, be sure to send the message [symbol( into its right inlet first. Though, if you are still going the ASCII route, I think [ascseq] it does one character at a time.
-
Bit by bit, this IS working!
One perhaps particularly rookie question now: How do I set the pseudo-delimiter I desire for [s2l] on launch? -
In most cases, you can add it as an argument. But as far as I can tell, to separate each character you'll have to [loadbang] a [symbol( message into the right inlet.
-
Hello,
I think I've just finished my project.
What I have essentially produced is a toy for batch-converting (with a few live variables) an input text phrase into a musical sequence of four-bar loops, based primarily on equations of the input characters' ASCII values.
Thanks for the help; I was completely lost a couple of weeks ago.The drum parts are completely based on the ASCII binary bits as mentioned in above posts, but the pitched instruments involve more maths.
I regret there're no Stop or Loop functions, and had tried to implement them, but have favoured a separate duration-logic which wouldn't really tesselate with those. I made some cop-outs to eliminate bugs, and it'd really be nice to have more variables, but the result should be sufficient for my assignment.
This is from someone who hadn't heard of PD three months ago. I recognise there'll be examples of very clumsy programming in there, and I'm not really asking for feedback (because I'm sick of debugging; it works fine for me now and must get on to the write-up), just offering my creation.
I have only just saved this 'final' version, and despite hours of my own debugging I can't guarantee anything.
See attached.
(made on pd-extended 0.41.4 for Windows)
-
well it looks nice. and I want to play. But it's unclear. Only when I spied on my MIDI activity did I realize that it's meant to only send out MIDI, And maybe I'm just being silly, but in Logic I couldn't work out how to separate the instruments, it seemed to play all the MIDI information with the same instrument
Can you tell it's been a long time since I bothered with MIDI
Dual 1.8 IBM G5: Mac OSX 10.4.11 -- Asus eeePC 701: Pure:Dyne / eeeXubuntu GNU/Linux -- myspace.com/thearifd
-
I put preset MIDI channels and voices on loadbangs, so it should pay attention to that - What instrument sound (voice) is it playing back with? And does this apply to the drums as well as the three pitched options?
I tested it on a couple of machines and it worked okay - and I really hope nobody tells me otherwise because I've submitted it now! -
well MIDI monitor does read information being sent to channel 1 and channel 10 e.t.c. but In Logic I just open up a virtual instrument track, MIDI arm it, set it to listen to channel 1 and everything comes through. But don't worry, I'm sure I'm just not doing something right.
Dual 1.8 IBM G5: Mac OSX 10.4.11 -- Asus eeePC 701: Pure:Dyne / eeeXubuntu GNU/Linux -- myspace.com/thearifd