i'm very sorry about the newb question, but i've been trying to load a sample into the table for some time now.
after reading the control examples and the audio examples im still lost.
even if i take an already made pd patch. and just put a sound file into the same sound folder as the already refferenced sample and change the message box to it's name i still get nothin. i've tried this with the samplers in the audio folder.
anyone have any idea on how to help me?
-
Loading a sample into a table
-
wow. you really are new here )
stick with it though. you can ask as many Q's as you need. this forum has been way too quiet lately.
a common misconception is that by asking 'silly' questions, you're going to be wasting people's time. but not so. i know that i have got lots of good ideas for new stuff and been reminded of older ideas, just from reading the Q's of other people/
so ahh....sorry about the sidetrack
you wanna be using:
[bang<
|
[openpanel]
|
[read $1 -resize array-L array-R]
|
[soundfiler]
(this assumes you have 2 arrays called 'array-L' and 'array-R' (stereo) ...just use one array if u want mono)
maybe just do a right click on [soundfiler] if u get stuck. pretty sure there's an example in the help file. -
but yeah. a lot of those examples in the docs that use message boxes to load samples don't work for me either...not sure why they don't just use [openpanel]
-
i get the same error. when i copied your diagram. "no such table"
hmm im confused.
here's a link to a rar file using yousendit.
[url=http://s55.yousendit.com/d.aspx?id=20Z09WSFEHIEN2V9UNARGXU1S1 ]http://s55.yousendit.com/d.aspx?id=20Z09WSFEHIEN2V9UNARGXU1S1
oh and by the way thanks for making me feel welcome -
but yeah. a lot of those examples in the docs that use message boxes to load samples don't work for me either...not sure why they don't just use [openpanel]
yeah i tried the sampling tutorials and read the majority of the helpfiles up until the sampling section if not all of them.
i'm still pretty lost. have good ideas about what i want to do but just to do them is confusing now till i get the hang of it. -
managed to load it in this version
[url=http://s48.yousendit.com/d.aspx?id=2A0ITRMAR18S23SLMOA4JHQ8N9 ]http://s48.yousendit.com/d.aspx?id=2A0ITRMAR18S23SLMOA4JHQ8N9
but the it looks funny in the array. how do i use that resize function? gonna look for some refferences on it! -
openfile makes things dead easy but im not sure how to use read with it to send it to an array. is that what the $1 is for?
-
the output of [openfile] just gives the path of your file as a symbol
( for example: /user/audio/milli-vanilli.wav )
if you make a message box, then $1 will be substituted with whatever is sent to the inlet.
ie. [read $1 array84{ becomes [read /user/audio/milli-vanilli.wav array84{
the -resize tag just changes the size of your array to accommodate the entire sample. i think arrays are originally only length 100, so if you don't use -resize, then you will only load the first 100 samples... ..a normal soundfile has 44100 samples per second, so you are not getting very much sound unless you resize it. -
#N canvas 176 147 564 312 10;
#X msg 30 59 bang;
#X obj 29 167 soundfiler;
#N canvas 0 22 450 300 graph1 0;
#X array array1 100 float 0;
#X coords 0 1 99 -1 200 140 1;
#X restore 298 51 graph;
#X obj 30 104 openpanel;
#X msg 29 139 read -resize \$1 array1;
#X connect 0 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 1 0; -
copy that last post to your clipboard and save it in a simple text editor. (notepad , text edit, or whatever)
then just change the .txt extension to .pd and it will open in pd
vice versa you can change .pd patches into .txt just by changing the extension -
WICKED!
so it seems that the -resize tag has to be in a certain order it cant be the last thing? -
meaning that in the read message, it cant be after array1?
-
yeah. the order you do things in is very important.
-
hi again i seem to have a problem with the -resize feature. i can only load the first kick of a drumloop.
here's the patch.. think you can look at it for me?
#N canvas 176 147 568 631 10;
#X msg 30 59 bang;
#X obj 29 167 soundfiler;
#N canvas 0 22 450 300 graph1 0;
#X array array1 302400 float 0;
#X coords 0 1 302399 -1 200 140 1;
#X restore 298 51 graph;
#X obj 30 104 openpanel;
#X msg 29 139 read -resize \$1 array1;
#X obj 67 454 tabwrite~ tabread4-out;
#X floatatom 65 532 0 0 0 0 - - -;
#N canvas 159 26 495 266 output 0;
#X obj 406 192 t b;
#X obj 406 132 f;
#X obj 406 72 inlet;
#X text 413 35 mute;
#X obj 406 222 f;
#X msg 510 214 0;
#X msg 406 102 bang;
#X obj 406 162 moses 1;
#X obj 510 184 t b f;
#X obj 476 140 moses 1;
#X obj 100 178 dbtorms;
#X obj 476 110 r master-lvl;
#X obj 100 50 r master-lvl;
#X obj 406 252 s master-lvl;
#X obj 26 217 inlet~;
#X obj 239 49 inlet;
#X text 239 22 level;
#X obj 239 120 s master-lvl;
#X msg 115 78 set \$1;
#X obj 115 107 outlet;
#X msg 257 77 \; pd dsp 1;
#X obj 100 233 line~;
#X obj 26 254 *~;
#X obj 26 289 dac~;
#X obj 100 205 pack 0 50;
#X text 24 190 audio;
#X text 112 132 show level;
#X connect 0 0 4 0;
#X connect 1 0 7 0;
#X connect 2 0 6 0;
#X connect 4 0 13 0;
#X connect 5 0 13 0;
#X connect 6 0 1 0;
#X connect 7 0 0 0;
#X connect 7 1 8 0;
#X connect 8 0 5 0;
#X connect 9 1 4 1;
#X connect 10 0 24 0;
#X connect 11 0 1 1;
#X connect 11 0 9 0;
#X connect 12 0 10 0;
#X connect 12 0 18 0;
#X connect 14 0 22 0;
#X connect 15 0 17 0;
#X connect 15 0 20 0;
#X connect 18 0 19 0;
#X connect 21 0 22 1;
#X connect 22 0 23 0;
#X connect 22 0 23 1;
#X connect 24 0 21 0;
#X restore 30 566 pd output;
#X msg 100 532 MUTE;
#X text 141 531 <-- output amplitude;
#X obj 30 497 hip~ 5;
#X floatatom 30 196 0 0 0 0 - - -;
#X text 229 387 read from the table;
#X text 79 196 <-- frequency (Hz.);
#X floatatom 58 257 0 0 0 0 - - -;
#X obj 58 290 * 441;
#X obj 30 317 *~ 0;
#X obj 30 347 +~ 1;
#X text 111 422 <-- click to display output;
#X obj 30 228 phasor~ 0;
#X msg 66 419 bang;
#X text 105 256 <-- chunk size (100ths of a second);
#X text 76 316 <-- readjust phase for range 0 - (chunk size);
#X text 75 347 <-- add one to avoid beginning of table;
#X obj 30 384 tabread4~ array1;
#X connect 0 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X connect 6 0 7 1;
#X connect 7 0 6 0;
#X connect 8 0 7 2;
#X connect 10 0 7 0;
#X connect 11 0 19 0;
#X connect 14 0 15 0;
#X connect 15 0 16 1;
#X connect 16 0 17 0;
#X connect 17 0 24 0;
#X connect 19 0 16 0;
#X connect 20 0 5 0;
#X connect 24 0 10 0;
#X connect 24 0 5 0; -
loops load fine for me.
i guess your whole loops are loading too, but you're only playing the first bit.
there's a number box which says: "chunk size (100ths of a second)"
even if you set that to 100, you're still only playing the first 1 second of your loop. you want to set it to about 400 to hear a typical 4 second drumloop.
anyway, stick with it. everyone feels really bewildered at first...but you get these aha! moments when things just fall into place in your mind. -
hehe ok cool will do gonna go to bed and try some more tomorrow
-
any idea how i could just have pd auto detect the sample length?
-
the output of [soundfiler] gives the sample length in bits. for a 44100hz sample, divide by 44.1 to give the length in milliseconds
[soundfiler]
|
(sample length comes out here) -
do i put one of these after the soundfiler?
/ 44.1 -
read $1 -resize drum
should be:
read -resize $1 drum
other than that you seem to be doing fine...
what you can now do, is take that bit of code you just made, and use it to load new files into arrays in the help docs. (just swap 'drum' for the array names in the docs)
remember though, if you modify the help files, make sure you save *as a copy* , cos you don't wanna go monging up your documentation.