[Nyquist-users] snd-fetch-array, part 2
Nyquist is a language for sound synthesis and music composition.
Brought to you by:
rbd
From: <edg...@we...> - 2008-04-29 10:27:23
|
> For the particular problem of saving samples to a file, I think it would > be simpler and an order of magnitude faster to call snd-save. Several problems: with "s-save" [and also tried "snd-save" directly] all samples smaller or bigger than the range from -1.0 to +1.0 get clipped to -1.0 or +1.0. This could be circumvented by scaling the sound down by a certain factor, write it into a 32-bit float sound file and scale it in the graphical viewer to the original value (the floating point rounding error is ridiculous small compared to the graphical pixel rounding error). I had tried this the way you suggested: > ... you can specify a float format with no headers, which should > be equivalent to explicitly writing each sample to a binary file. The problem is: (s-save ... :mode snd-head-mode-float :bits 32) (s-save ... :format snd-head-none :mode snd-head-mode-float :bits 32) all ":format ..." variations of ":mode snd-head-mode-float" together with ":bits 32" on Linux write pure nonsense files. E.g. with "snd-head-none" I get a file where only the first half of the sound file is filled with nonsense data while the second half of the file is always padded with 0.0. On Windows XP Pro, with "s-save ... :mode snd-head-mode-float :bits 32" Nyquist 3.01 (console version) just simply crashes. So, I'm sorry but the only reliable way to write floating point samples on ALL systems (or at least on Win/Linux/Mac) seems to be "write-float". Any other solutions welcome. - edgar P.S. I only got the mail sent to me directly, but not the copy from the nyquist-users list, so in case of doubt: edgar-rft [at] web [dot] de -- The author of this email does not necessarily endorse the following advertisements, which are the sole responsibility of the advertiser: _______________________________________________________________________ EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine Homepage mit eigenem Namen. Jetzt starten! http://unddu.de/?kid=kid@mf2 |