Csound Csound-dev Csound-tekno Search About

Re: avoid samples out of range?

Date2006-05-21 01:54
From"Michael Gogins"
SubjectRe: avoid samples out of range?
Output to a floating-point soundfile at a fairly low level, such as -20 dB 
or -40 dB. Then just normalize the file to -1 or -3 dB after the soundfile 
has been rendered. The signal to noise ratio of floating point samples is 
extreme so little if any precision will be lost or noise introduced by doing 
this. Audacity, the free cross-platform sound editor, can easily normalize 
soundfiles.

Regards,
Mike

----- Original Message ----- 
From: "David Kamp (sent by Nabble.com)" 
To: 
Sent: Saturday, May 20, 2006 7:46 PM
Subject: [Csnd] avoid samples out of range?


>
> Hello everybody.
>
> I have a multiinstrument orchestra, where levels can get quite high some
> times, so i am getting samples out of range.
>
> What would be the most elegant way to have my levels always at maximum, 
> but
> no samples out of range?
>
>
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/avoid+samples+out+of+range--t1656507.html#a4488077
> Sent from the Csound - General forum at Nabble.com.
>
> -- 
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
> 

Date2006-05-21 13:02
From"David Kamp (sent by Nabble.com)"
SubjectRe: avoid samples out of range?
Thanks Michael,  the bad thing is, i am generating my scores automatically,
so i render, change the code,
render, change the code, etc.

Having to import it into audacity everytime seems not very attractive to
me...

Also playback of floating point soundfiles seems to be problematic on OSX,
at least with the command line player PAPLAY from composers Desktop Project.
(which is the only 4-channel command-line player on OSX i know) 
--
View this message in context: http://www.nabble.com/avoid+samples+out+of+range--t1656507.html#a4491898
Sent from the Csound - General forum at Nabble.com.

Date2006-05-21 14:08
Fromluis jure
SubjectRe: avoid samples out of range?
el Sun, 21 May 2006 05:02:38 -0700 (PDT)
"David  Kamp (sent by Nabble.com)"  escribió:

> 
> Thanks Michael,  the bad thing is, i am generating my scores
> automatically, so i render, change the code,
> render, change the code, etc.

i'd suggest sending the outputs of all instruments (via global variables) to
a mixer and scaling down by a safe margin. you can turn on the mixer and
easily adjust the gain factor depending on the output.


--

Date2006-05-21 14:31
FromRichard Dobson
SubjectRe: avoid samples out of range?
David Kamp (sent by Nabble.com) wrote:
..
> Also playback of floating point soundfiles seems to be problematic on OSX,
> at least with the command line player PAPLAY from composers Desktop Project.
> (which is the only 4-channel command-line player on OSX i know) 
> --


Can you be more specific (I am the author of paplay; uses PortAudio 
v18)? Is it problems reading a file or rendering? I had problems on 
Jaguar playing to external devices such as the Firewire 410, but the 
current version (v1.1) plays fine on Panther and Tiger, and even on an 
Intel iMac via Rosetta. I will update it to PortAudio19, but it hasn't 
been a priority. It acts as the default file player for SoundLoom on OS 
X. Contact me offlist as its not a Csound topic as such.

Richard Dobson


Date2006-05-21 15:38
FromJulian Peterson
SubjectRe: avoid samples out of range?
Have you looked at ecasound?  It doesn't have coreaudio playback  
(that I know of) but works with jackosx.  I believe it can playback  
an arbitrary number of channels, and works with floating point  
soundfiles.

On May 21, 2006, at 8:02 AM, David Kamp (sent by Nabble.com) wrote:

>
> Thanks Michael,  the bad thing is, i am generating my scores  
> automatically,
> so i render, change the code,
> render, change the code, etc.
>
> Having to import it into audacity everytime seems not very  
> attractive to
> me...
>
> Also playback of floating point soundfiles seems to be problematic  
> on OSX,
> at least with the command line player PAPLAY from composers Desktop  
> Project.
> (which is the only 4-channel command-line player on OSX i know)
> --
> View this message in context: http://www.nabble.com/avoid+samples 
> +out+of+range--t1656507.html#a4491898
> Sent from the Csound - General forum at Nabble.com.
>
> -- 
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>

Date2006-05-21 19:52
From"David Kamp (sent by Nabble.com)"
SubjectRe: avoid samples out of range?
i just found out out the problems do not occur with floating point WAV.

So i will just render to wav from now on.
--
View this message in context: http://www.nabble.com/avoid+samples+out+of+range--t1656507.html#a4495369
Sent from the Csound - General forum at Nabble.com.

Date2006-05-22 00:45
FromRichard Dobson
SubjectAIFF_C bug (was: Re: [Csnd] avoid samples out of range?)
On investigating David's report, it transpires that the AIFF-C files 
output by csound (presumably only using AIFF-C for floats) do not 
include the required FVER version chunk, and my program is reporting 
this as an error - correctly IMO as the AIFF-C spec makes it clear that 
this is a "required" chunk.

Now I know it is highly unlikely Apple will ever announce a new AIFF-C 
version (in effect, it is the new CAF format), and many applications 
will tolerate the absence of FVER, but I nevertheless think that it is 
worth including for writing, just to be on the safe side. In any event, 
I want to keep my own code as is, as I need to be able to verify the 
correct formation of file headers for my own work.

I know a new Csound release is imminent; might this be an easy addition 
to libsndfile - Eric?

Richard Dobson



David Kamp (sent by Nabble.com) wrote:
> i just found out out the problems do not occur with floating point WAV.
> 
> So i will just render to wav from now on.


Date2006-05-22 00:49
FromErik de Castro Lopo
SubjectRe: AIFF_C bug (was: Re: [Csnd] avoid samples out of range?)
Richard Dobson wrote:

> I know a new Csound release is imminent; might this be an easy addition 
> to libsndfile - Erik?

Can you send me (by private email) a small example file with the 
required chunk present?

Also, is this FVER chunk required for all AIFF_C files or just the
the float files?

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"O'Caml ... a "language designed for smart people" if there 
ever was one." -- Mike Vanier

Date2006-05-22 01:12
FromBen Collver
SubjectRe: AIFF_C bug (was: Re: [Csnd] avoid samples out of range?)
AttachmentsNone  

Date2006-05-22 09:05
FromErik de Castro Lopo
SubjectRe: AIFF_C bug (was: Re: [Csnd] avoid samples out of range?)
Ben Collver wrote:

> I have one at
> http://terrorpin.net/~ben/docs/alt/music/soundfont/sfubar-3/test-success/aif.aif

Thanks Ben. I have  now updated the test suite so it screams if libsndfile
creates an AIFC file without an FVER chunk and also added code to write 
the FVER chunk when appropriate.

This will be in the next release and here's a pre-release as well:

    http://www.mega-nerd.com/tmp/libsndfile-1.0.17pre4.tar.gz

Feel free to test this code for the FVER issue, but please don't ship
this pre-release version with anything.

Cheers,
Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
Good advice for everyone : stay away from churches, mosques and
synagouges.