Re: [PD] getting sample rate of file loaded into an array
Hi Patrice and Rick Unfortunately, there are several different types of wav files, also the header size is not always the same. IIRC, [ext13/wavinfo] assumes a fixed size of the typical 44 byte header and probably because of other reasons as well does not recognize many real-world wav-files. Sometimes it gives totally strange numbers instead of reporting an error. [iemlib/soundfile_info] seems to support a much wider range of wav-files around and also I reported once a bug and it got fixed. For reasons above I encourage you to use [iemlib/soundfile_info]. Roman On Wed, 2012-10-03 at 14:09 -1000, Rick T wrote: Thanks On Wed, Oct 3, 2012 at 1:45 PM, Patrice Colet colet.patr...@free.fr wrote: [ext13/wavinfo] or more complicated for the fun, with [mrpeach/binfile] and https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ it's attached ^^ Colet Patrice - Mail original - De: Rick T ratull...@gmail.com À: PD List pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 00:26:15 Objet: [PD] getting sample rate of file loaded into an array Greetings All I load a wavefile into an array using openpanel but how can I go about getting the sample rate of the wav file? I'm trying to load the sample rate data into an expr object Example: expr (sample rate) / f$1 Aloh Rick ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
Thank you roman, didn't try this one... I'd like to know what was the bug because it gives wrong sample resolution Colet Patrice - Mail original - De: Roman Haefeli reduz...@gmail.com À: pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 15:49:25 Objet: Re: [PD] getting sample rate of file loaded into an array Hi Patrice and Rick Unfortunately, there are several different types of wav files, also the header size is not always the same. IIRC, [ext13/wavinfo] assumes a fixed size of the typical 44 byte header and probably because of other reasons as well does not recognize many real-world wav-files. Sometimes it gives totally strange numbers instead of reporting an error. [iemlib/soundfile_info] seems to support a much wider range of wav-files around and also I reported once a bug and it got fixed. For reasons above I encourage you to use [iemlib/soundfile_info]. Roman On Wed, 2012-10-03 at 14:09 -1000, Rick T wrote: Thanks On Wed, Oct 3, 2012 at 1:45 PM, Patrice Colet colet.patr...@free.fr wrote: [ext13/wavinfo] or more complicated for the fun, with [mrpeach/binfile] and https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ it's attached ^^ Colet Patrice - Mail original - De: Rick T ratull...@gmail.com À: PD List pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 00:26:15 Objet: [PD] getting sample rate of file loaded into an array Greetings All I load a wavefile into an array using openpanel but how can I go about getting the sample rate of the wav file? I'm trying to load the sample rate data into an expr object Example: expr (sample rate) / f$1 Aloh Rick ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
On Thu, 2012-10-04 at 16:23 +0200, Patrice Colet wrote: Thank you roman, didn't try this one... I'd like to know what was the bug http://sourceforge.net/tracker/?func=detailatid=478070aid=2950978group_id=55736 because it gives wrong sample resolution Didn't know about this one. Please report it, so that hopefully it gets fixed. Does it work correctly with [ext13/wavinfo]? Roman - Mail original - De: Roman Haefeli reduz...@gmail.com À: pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 15:49:25 Objet: Re: [PD] getting sample rate of file loaded into an array Hi Patrice and Rick Unfortunately, there are several different types of wav files, also the header size is not always the same. IIRC, [ext13/wavinfo] assumes a fixed size of the typical 44 byte header and probably because of other reasons as well does not recognize many real-world wav-files. Sometimes it gives totally strange numbers instead of reporting an error. [iemlib/soundfile_info] seems to support a much wider range of wav-files around and also I reported once a bug and it got fixed. For reasons above I encourage you to use [iemlib/soundfile_info]. Roman On Wed, 2012-10-03 at 14:09 -1000, Rick T wrote: Thanks On Wed, Oct 3, 2012 at 1:45 PM, Patrice Colet colet.patr...@free.fr wrote: [ext13/wavinfo] or more complicated for the fun, with [mrpeach/binfile] and https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ it's attached ^^ Colet Patrice - Mail original - De: Rick T ratull...@gmail.com À: PD List pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 00:26:15 Objet: [PD] getting sample rate of file loaded into an array Greetings All I load a wavefile into an array using openpanel but how can I go about getting the sample rate of the wav file? I'm trying to load the sample rate data into an expr object Example: expr (sample rate) / f$1 Aloh Rick ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
De: Roman Haefeli reduz...@gmail.com On Thu, 2012-10-04 at 16:23 +0200, Patrice Colet wrote: Thank you roman, didn't try this one... I'd like to know what was the bug http://sourceforge.net/tracker/?func=detailatid=478070aid=2950978group_id=55736 because it gives wrong sample resolution Didn't know about this one. Please report it, so that hopefully it gets fixed. Does it work correctly with [ext13/wavinfo]? Yes it does, but anyway, my bad, I didn't read carefuly enough the help file that is saying sample resolution in *bytes*, not in *bits*. maybe one day [soundfile_info] will read aiff files as well... ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
On 10/04/2012 11:27 AM, Patrice Colet wrote: De: Roman Haefeli reduz...@gmail.com On Thu, 2012-10-04 at 16:23 +0200, Patrice Colet wrote: Thank you roman, didn't try this one... I'd like to know what was the bug http://sourceforge.net/tracker/?func=detailatid=478070aid=2950978group_id=55736 because it gives wrong sample resolution Didn't know about this one. Please report it, so that hopefully it gets fixed. Does it work correctly with [ext13/wavinfo]? Yes it does, but anyway, my bad, I didn't read carefuly enough the help file that is saying sample resolution in *bytes*, not in *bits*. maybe one day [soundfile_info] will read aiff files as well... There are two separate issues here: 1. it would be lovely to have a single [soundfile_info] that gets the meta data from any soundfile, like how [readanysf~] will play any soundfile 2. People should be free to write whatever software they want. If existing objects don't work for them, they write new ones. Therefore we have [wavinfo] and [soundfile_info]. So really, I think the best solution would be to leave both [wavinfo] and [soundfile_info] as they are, and focus efforts on making a [anysfinfo] based on gmerlin using [readanysf~] as a template. .hc ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
On Thu, 2012-10-04 at 12:05 -0400, Hans-Christoph Steiner wrote: On 10/04/2012 11:27 AM, Patrice Colet wrote: De: Roman Haefeli reduz...@gmail.com On Thu, 2012-10-04 at 16:23 +0200, Patrice Colet wrote: Thank you roman, didn't try this one... I'd like to know what was the bug http://sourceforge.net/tracker/?func=detailatid=478070aid=2950978group_id=55736 because it gives wrong sample resolution Didn't know about this one. Please report it, so that hopefully it gets fixed. Does it work correctly with [ext13/wavinfo]? Yes it does, but anyway, my bad, I didn't read carefuly enough the help file that is saying sample resolution in *bytes*, not in *bits*. maybe one day [soundfile_info] will read aiff files as well... There are two separate issues here: 1. it would be lovely to have a single [soundfile_info] that gets the meta data from any soundfile, like how [readanysf~] will play any soundfile Agreed. 2. People should be free to write whatever software they want. If existing objects don't work for them, they write new ones. Therefore we have [wavinfo] and [soundfile_info]. That is someone speaking from a developers point of view. Of course, it seems feasible to write your own class, if you have the abilities. However, it (IMHO, at least) creates major pains for future users, as they have to deal with the specifics of every class. I, as a receiver of patches from others, might have to several implementations installed, because the patch authors decided to use different advantages in this. I'm all for freedom of the developers - don't get me wrong, but I think some mechanism to forget stuff that does not seem to proof useful is crucial. Otherwise we end up with a whole lot of half-working cruft in the future. In my opinion, it is already the case now: so many libraries that are not maintained anymore or which are broken in one way or the other. It all boils down: How to get rid of stuff? Certainly not by packaging everything into Pd-extended and saying we cannot remove stuff because of backwards compatibility. This is not at all a rant. But I'm convinced we will need to figure this out at some point in the future. Probably this analogy is way off, but I think it is not unlike the issue with space debris in low earth orbit. The later you think about that, the more expensive it is going to be to deal with it. So really, I think the best solution would be to leave both [wavinfo] and [soundfile_info] as they are, and focus efforts on making a [anysfinfo] based on gmerlin using [readanysf~] as a template. Actually, I think [readanysf~] could do it. It already provides information about length of the audio file and its original samplerate. However, there are some pieces missing like number of channels. Roman ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
- Original Message - From: Hans-Christoph Steiner h...@at.or.at To: pd-list@iem.at Cc: Sent: Thursday, October 4, 2012 12:05 PM Subject: Re: [PD] getting sample rate of file loaded into an array On 10/04/2012 11:27 AM, Patrice Colet wrote: De: Roman Haefeli reduz...@gmail.com On Thu, 2012-10-04 at 16:23 +0200, Patrice Colet wrote: Thank you roman, didn't try this one... I'd like to know what was the bug http://sourceforge.net/tracker/?func=detailatid=478070aid=2950978group_id=55736 because it gives wrong sample resolution Didn't know about this one. Please report it, so that hopefully it gets fixed. Does it work correctly with [ext13/wavinfo]? Yes it does, but anyway, my bad, I didn't read carefuly enough the help file that is saying sample resolution in *bytes*, not in *bits*. maybe one day [soundfile_info] will read aiff files as well... There are two separate issues here: 1. it would be lovely to have a single [soundfile_info] that gets the meta data from any soundfile, like how [readanysf~] will play any soundfile 2. People should be free to write whatever software they want. If existing objects don't work for them, they write new ones. Therefore we have [wavinfo] and [soundfile_info]. So really, I think the best solution would be to leave both [wavinfo] and [soundfile_info] as they are, and focus efforts on making a [anysfinfo] based on gmerlin using [readanysf~] as a template. Part of those efforts should include updating the old external docs to point users to the newer, better external once it reaches some level of stability. Since it's impossible for the devs of the existing objects to poll svn for newer, better objects, this is the responsibility of the developer of the newer, better objects. Again-- this is only black-and-white for situations where the new external inherits the same essential features as the old external and any of its new features don't introduce any significant drawbacks for a potential user. If the new external writes to a text file in JSON format instead of outputting messages from an outlet that's a different story. -Jonathan .hc ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
[ext13/wavinfo] or more complicated for the fun, with [mrpeach/binfile] and https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ it's attached ^^ Colet Patrice - Mail original - De: Rick T ratull...@gmail.com À: PD List pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 00:26:15 Objet: [PD] getting sample rate of file loaded into an array Greetings All I load a wavefile into an array using openpanel but how can I go about getting the sample rate of the wav file? I'm trying to load the sample rate data into an expr object Example: expr (sample rate) / f$1 Aloha Rick ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list #N canvas 1231 538 450 300 10; #N canvas 0 0 948 727 fileinfo 1; #X obj 172 151 mrpeach/binfile; #X obj 172 131 until; #X obj 172 193 f; #X obj 201 192 + 1; #X obj 172 215 pack; #X msg 209 172 0; #X obj 172 170 t b a; #X msg 172 110 37; #X obj 172 89 t b a b; #X text 259 46 grab wave info into file header; #X obj 171 48 inlet; #X obj 84 508 outlet; #X msg 171 69 read \$1; #X obj 123 377 *; #X obj 203 403 *; #X obj 203 463 /; #X obj 203 443 f; #X obj 203 423 t b a; #X obj 111 358 / 8; #X obj 84 339 t a a; #X obj 209 270 * 256; #X obj 209 289 +; #X obj 191 337 +; #X obj 190 311 * 65536; #X obj 191 357 t a a; #X obj 267 334 * 1.67772e+007; #X obj 267 353 +; #X obj 282 314 +; #X obj 282 295 * 65536; #X obj 300 254 * 256; #X obj 300 274 +; #X obj 138 358 t a a; #X obj 172 234 route 34 26 25 24 22 7 6 5 4; #X obj 84 487 pack f f f f f; #X connect 0 0 6 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 2 0 4 0; #X connect 3 0 2 1; #X connect 4 0 32 0; #X connect 5 0 2 1; #X connect 6 0 2 0; #X connect 6 1 4 1; #X connect 7 0 1 0; #X connect 8 0 7 0; #X connect 8 1 0 0; #X connect 8 2 5 0; #X connect 10 0 12 0; #X connect 12 0 8 0; #X connect 13 0 14 0; #X connect 14 0 17 0; #X connect 15 0 33 3; #X connect 16 0 15 0; #X connect 17 0 16 0; #X connect 17 1 15 1; #X connect 18 0 13 0; #X connect 19 0 33 0; #X connect 19 1 18 0; #X connect 20 0 21 0; #X connect 21 0 22 1; #X connect 22 0 24 0; #X connect 23 0 22 0; #X connect 24 0 33 1; #X connect 24 1 14 1; #X connect 25 0 26 0; #X connect 26 0 16 1; #X connect 26 0 33 4; #X connect 27 0 26 1; #X connect 28 0 27 0; #X connect 29 0 30 0; #X connect 30 0 27 1; #X connect 31 0 13 1; #X connect 31 1 33 2; #X connect 32 0 19 0; #X connect 32 1 23 0; #X connect 32 2 20 0; #X connect 32 3 21 1; #X connect 32 4 31 0; #X connect 32 5 25 0; #X connect 32 6 28 0; #X connect 32 7 29 0; #X connect 32 8 30 1; #X connect 33 0 11 0; #X restore 147 48 pd fileinfo; #X obj 147 29 openpanel; #X obj 147 10 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X floatatom 147 189 5 0 0 0 - - -; #X floatatom 170 162 5 0 0 0 - - -; #X floatatom 193 134 5 0 0 0 - - -; #X floatatom 216 111 5 0 0 0 - - -; #X text 181 190 bitrate; #X text 204 161 samplerate; #X text 227 136 number of channels; #X text 252 111 size in seconds; #X obj 147 67 unpack f f f f f; #X floatatom 240 88 5 0 0 0 - - -; #X text 276 88 size in samples; #X connect 0 0 11 0; #X connect 1 0 0 0; #X connect 2 0 1 0; #X connect 11 0 3 0; #X connect 11 1 4 0; #X connect 11 2 5 0; #X connect 11 3 6 0; #X connect 11 4 12 0; ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] getting sample rate of file loaded into an array
Thanks On Wed, Oct 3, 2012 at 1:45 PM, Patrice Colet colet.patr...@free.fr wrote: [ext13/wavinfo] or more complicated for the fun, with [mrpeach/binfile] and https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ it's attached ^^ Colet Patrice - Mail original - De: Rick T ratull...@gmail.com À: PD List pd-list@iem.at Envoyé: Jeudi 4 Octobre 2012 00:26:15 Objet: [PD] getting sample rate of file loaded into an array Greetings All I load a wavefile into an array using openpanel but how can I go about getting the sample rate of the wav file? I'm trying to load the sample rate data into an expr object Example: expr (sample rate) / f$1 Aloha Rick ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list