On Nov 6, 2021, at 12:00 PM, pd-list-request@lists.iem.at wrote:
Hi, I don't really get the optional arguments to the open message (after the filename)
Onset is basically where to start playing but counted in samples from the beginning. If you know the sample rate of the file, you can calculate the onset for a given time, say 1 second in and start paying for there.
The rest are sound file header overrides to force how the format of the file in interpreted, ie. you can force readsf~ to play a stereo file in mono for instance or if you have some sort of raw output which is missing some encoding you can force the format, etc. Those values are similar to the sound filer -raw flag values.
and I don't understand how the mono file input (bell.aif) can output 4 channels of audio!
It doesn't... there are 4 output channels from the object but only the first shows a change in envelope when you play it. The rest output 0 as the file is only mono. This just means the the object is created to play *up to* 4 channel files but that of course depends on the files it gets.
Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
Em sáb., 6 de nov. de 2021 às 16:23, Dan Wilcox danomatika@gmail.com escreveu:
I don't understand how the mono file input (bell.aif) can output 4 channels of audio!
It doesn't... there are 4 output channels from the object but only the first shows a change in envelope when you play it. The rest output 0 as the file is only mono.
But I get the output in the 4 channels when I click the message "open ../sound/bell.aiff 0 200 4 2 b, 1", which is one of the messages from the help file. It also plays the file faster and at a higher pitch. Tested on Pd 0.52-4, macOS 10.14.6
[image: Screen Shot 2021-11-08 at 12.56.36.png]
Something seems funny (should I open an issue on github?), and the documentation may also be improved as to how those arguments work.
cheers
Em seg., 8 de nov. de 2021 às 13:02, Alexandre Torres Porres < porres@gmail.com> escreveu:
But I get the output in the 4 channels when I click the message "open ../sound/bell.aiff 0 200 4 2 b, 1", which is one of the messages from the help file. It also plays the file faster and at a higher pitch. Tested on Pd 0.52-4, macOS 10.14.6
for the record, I tried it in Purr DData and then it just doesn't play the at all and immediately sends the 'didit' bang message... I'm not sure but I think that's also not the correct behaviour
if you just use [open ../sound/bell.aiff( it will play just as dan said, a mono file only on the first channel.
when you use [open ../sound/bell.aiff 0 200 4 2 b, 1(, also as dan said, you are forcing the format as which readsf~ will read the file, using the arguments just as the -raw argument for the [soundfiler] object, so
0 means onset 200 means header size to skip 4 means number of channels (!!, you are asking for 4 channels here) 2 means number of bytes per channel b means big endian
since you asked for 4 channels, you will get interleaved samples for each channel, hence the pitch up, since you are feeding 4 samples at once from the file to feed each channel, if the original is mono, you get 4x faster
Em seg., 8 de nov. de 2021 às 13:11, Alexandre Torres Porres < porres@gmail.com> escreveu:
Em seg., 8 de nov. de 2021 às 13:02, Alexandre Torres Porres < porres@gmail.com> escreveu:
But I get the output in the 4 channels when I click the message "open ../sound/bell.aiff 0 200 4 2 b, 1", which is one of the messages from the help file. It also plays the file faster and at a higher pitch. Tested on Pd 0.52-4, macOS 10.14.6
for the record, I tried it in Purr DData and then it just doesn't play the at all and immediately sends the 'didit' bang message... I'm not sure but I think that's also not the correct behaviour
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list