I want to produce Audio in Pure data using pure text files (TXT versions), I have already managed to convert the file that I wan tto use (in this case Football commentary) into TXT versions using another software and want to see if I can produce some sort of music (or any sort of sound really) using such a file. I was wondering If anyone has any patches/links/helpful advice that could guide me in the write direction for such a patch. Thank you.
-
How do I produce Audio using Text Files
-
well if you save the pd file as a text file it comes up with a bunch of stuff that looks like
#N canvas 674 51 634 542 10;
#X msg 10 48 ; pd dsp $1;
#X obj 105 108 soundfiler;
#X floatatom 131 130 5 0 0 0 - - -;
#X floatatom 140 198 5 0 0 0 - - -;
#X obj 112 227 phasor~;
#N canvas 0 0 450 300 (subpatch) 0;
#X array lc 1.31563e+006 float 0;
#X coords 0 1 1.31563e+006 -1 200 140 1 0 0;
#X restore 425 -29 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array rc 1.31563e+006 float 0;
#X coords 0 1 1.31563e+006 -1 200 140 1 0 0;
#X restore 420 136 graph;
#X obj 421 289 hsl 195 15 0.2 1 0 0 empty empty empty -2 -8 0 10 -204800
-1 -1 0 1;
#X obj 117 415 *~;
#X obj 154 416 *~;
#X obj 115 452 dac~ 1 2;
#X obj 329 342 vsl 15 128 1 10 1 0 empty empty empty 0 -9 0 10 -204786
-1 -1 0 0;
#X obj 238 195 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X floatatom 237 277 10 0 0 0 - - -;
#X obj 234 303 /;
#X obj 241 250 snapshot~;
#X floatatom 236 333 5 0 0 0 - - -;
#X obj 81 -20 loadbang;
#X text 354 448 volume;
#X text 419 305 progress bar of the wav file;
#X obj 119 351 tabread4~ lc;
#X obj 139 378 tabread4~ rc;
#X obj 54 0 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 241 223 metro;
#X obj 11 4 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X text 150 -34 this will loop continuously;
#X obj 130 254 r sampleRateSize;
#X obj 131 150 s sampleRateSize;
#X obj 265 304 r sampleRateSize;
#X text 152 -19 its not a great track!;
#X text 154 -7 followed this tutorial
;
#X obj 106 173 expr 44100/$f1;
#X text 106 57 doesn't sound anything like the original track (which
was 48000 - even though i resampled it in Audition!);
#X obj 113 285 *~ 4;
#X msg 98 35 read -resize data/vantastivalmusic.wav lc rc;
#X connect 1 0 2 0;
#X connect 1 0 31 0;
#X connect 2 0 27 0;
#X connect 4 0 33 0;
#X connect 8 0 10 0;
#X connect 8 0 10 1;
#X connect 9 0 10 1;
#X connect 11 0 8 1;
#X connect 12 0 23 0;
#X connect 13 0 14 0;
#X connect 14 0 16 0;
#X connect 15 0 13 0;
#X connect 16 0 7 0;
#X connect 17 0 22 0;
#X connect 20 0 8 0;
#X connect 21 0 9 0;
#X connect 22 0 34 0;
#X connect 22 0 11 0;
#X connect 22 0 24 0;
#X connect 23 0 15 0;
#X connect 24 0 0 0;
#X connect 26 0 33 1;
#X connect 28 0 14 1;
#X connect 31 0 3 0;
#X connect 31 0 4 0;
#X connect 33 0 15 0;
#X connect 33 0 20 0;
#X connect 33 0 21 0;
#X connect 34 0 1 0;which when pasted into notepad and saved as a pd (as 'all files' will give you an audio patch. Is that what you mean?
-
the above is actually one of my own patches - i didn't realise the comment i made in the file would actually bring up the real youtube link!
-
@musicproject I think I might have confused you somewhat,
So I have a a txt file and I am using the Q list object box to make it output certain numbers, I want those numbers to correspond to lets say a drum set. How would I go about creating such a drum set per se in order to make my numbers correspond to particular tunes.
-
in the puredata help browser
3.audio.examples/C05.sampler.oneshot.pd
you could then use [route ] to trigger the samples. -
There are lots of different ways that you could go about this project, but the simplest would seem to be to use the [select] or [route] objects to match given words with the desired outcomes. For example, [select orange blue] will fire on the first outlet if it receives the symbol "orange" and on the second outlet if it receives the symbol "blue". You can connect these to specific musical events and program your music to respond to the text that way.
You'll also have to find a way to separate sentences into individual words and to "drip" them at the speed that you want. [list-dripslow] from the [list-abs] library would manage this, as would [qlist] and [text get].
If you want the sequence to be less language based and more "random", then another option would be to turn the words themselves into numbers using [list fromsymbol] or [any2bytes] from the moocow library. This converts keyboard characters into numbers according their ascii value, so "a b c" become "97 32 98 32 99" (32 being the ascii value for a space). You can then manipulate the numbers using math objects like [moses], [>], etc., in any way you like.