Csound Csound-dev Csound-tekno Search About

Amplitude!

Date2006-01-30 15:30
From"Greg M. Johnson"
SubjectAmplitude!
Hello,
I'm about to get back into the saddle and pick up csound after about a year's hiatus.  I had two problems before that frustrated me enough to set aside the program:

1) I'd make files and share them with others. It would be loud enough to hurt my ears with headphones on my PC, but others would complain they couldn't hear anything wi th the volume turned up. 

2) Sometimes, my impression is that I would have multiple things going on and it would be maxed-out distorted.

Can't win.

Is there a guideline for
i) what amplitude level to shoot for (see, it's so long since I touched the program i've forgotten the right term).

ii) what you have to do when more than one instrument is playing-- do you say have to plan to cut each one's volume in half so total <= 10000 or something?

Thanks for any help.


See my links at
http://www.geocities.com/pterandon/index.html



What are the most popular cars? Find out at Yahoo! Autos

Date2006-01-31 13:53
FromMichael Bechard
SubjectRe: Amplitude!
Ideally, your song should peak at just below the
loudest db (0); anything higher than that is going to
clip. When you compile your song in csound and it
shows you some sound info on a per 5-second basis (or
whatever it is), it will also show you the number of
samples in that period that "peaked," meaning they
went above the zero db ceiling. However, in csound
it's not in db's but in something else (help me out,
guys) which peaks at somehting like 25,000. I know
that sounds sketchy, but it's the best I can do for
now.

So, what I do is watch for that when compiling, but I
find it necessary to use an audio file editor like
Audacity (free) that shows you the sound waves as they
actually are produced in the file. That way I can see
if my problem is just with one 2-second interval
peaking very badly, or the whole song is just too
loud.

Which segues into compressors. Compressors help keep
wildly erratic soundwaves relatively constant in
volume by dynamically "compressing" the sound when it
passes a certain threshold for a certain period of
time (configurable). Csound, wouldn't you know, has a
compressor opcode (I can't remember what it's called
now) that does a decent job. Just search the manual
for compressor.

Now, the problem you describe with the difference in
volume between the different sound systems is probably
due to any one (or more) of several factors; the
speakers in one system may not be as loud as the
other, the volume knob may be set differently, etc. As
long as you produce your music so that it peaks just
below zero db like I said, you'll guarantee that the
nut who wants to crank your music will get the most
bang for his buck, while everyone else has plenty of
room to turn it down all they want. In every sound
system, you can always turn it down more, but you
can't always turn it up more, right?

Hope this helps,
Michael Bechard

--- "Greg M. Johnson"  wrote:

> Hello,    [input]   [input]   [input]   [input]     
>      I'm about to get back into the saddle and pick
> up csound after about a year's hiatus.  I had two
> problems before that frustrated me enough to set
> aside the program:
> 
> 1) I'd make files and share them with others. It
> would be loud enough to hurt my ears with headphones
> on my PC, but others would complain they couldn't
> hear anything with the volume turned up.  
> 
> 2) Sometimes, my impression is that I would have
> multiple things going on and it would be maxed-out
> distorted.
> 
> Can't win.
> 
> Is there a guideline for 
> i) what amplitude level to shoot for (see, it's so
> long since I touched the program i've forgotten the
> right term).
> 
> ii) what you have to do when more than one
> instrument is playing-- do you say have to plan to
> cut each one's volume in half so total <= 10000 or
> something?
> 
> Thanks for any help. 
> 
> 
> See my links at 
> http://www.geocities.com/pterandon/index.html
> 		
> ---------------------------------
>  
>  What are the most popular cars? Find out at Yahoo!
> Autos 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Date2006-01-31 14:12
From"Dale Stewart"
SubjectRe: Amplitude!
CD-quality digital audio is stored as a series of signed 16-bit values, and
so would have a range of -32768 to 32767.

-----Original Message-----
From: Michael Bechard [mailto:gothmagog@yahoo.com] 
Sent: Tuesday, January 31, 2006 7:53 AM
To: csound@lists.bath.ac.uk
Subject: Re: [Csnd] Amplitude!

Ideally, your song should peak at just below the
loudest db (0); anything higher than that is going to
clip. When you compile your song in csound and it
shows you some sound info on a per 5-second basis (or
whatever it is), it will also show you the number of
samples in that period that "peaked," meaning they
went above the zero db ceiling. However, in csound
it's not in db's but in something else (help me out,
guys) which peaks at somehting like 25,000. I know
that sounds sketchy, but it's the best I can do for
now.

So, what I do is watch for that when compiling, but I
find it necessary to use an audio file editor like
Audacity (free) that shows you the sound waves as they
actually are produced in the file. That way I can see
if my problem is just with one 2-second interval
peaking very badly, or the whole song is just too
loud.

Which segues into compressors. Compressors help keep
wildly erratic soundwaves relatively constant in
volume by dynamically "compressing" the sound when it
passes a certain threshold for a certain period of
time (configurable). Csound, wouldn't you know, has a
compressor opcode (I can't remember what it's called
now) that does a decent job. Just search the manual
for compressor.

Now, the problem you describe with the difference in
volume between the different sound systems is probably
due to any one (or more) of several factors; the
speakers in one system may not be as loud as the
other, the volume knob may be set differently, etc. As
long as you produce your music so that it peaks just
below zero db like I said, you'll guarantee that the
nut who wants to crank your music will get the most
bang for his buck, while everyone else has plenty of
room to turn it down all they want. In every sound
system, you can always turn it down more, but you
can't always turn it up more, right?

Hope this helps,
Michael Bechard

--- "Greg M. Johnson"  wrote:

> Hello,    [input]   [input]   [input]   [input]     
>      I'm about to get back into the saddle and pick
> up csound after about a year's hiatus.  I had two
> problems before that frustrated me enough to set
> aside the program:
> 
> 1) I'd make files and share them with others. It
> would be loud enough to hurt my ears with headphones
> on my PC, but others would complain they couldn't
> hear anything with the volume turned up.  
> 
> 2) Sometimes, my impression is that I would have
> multiple things going on and it would be maxed-out
> distorted.
> 
> Can't win.
> 
> Is there a guideline for 
> i) what amplitude level to shoot for (see, it's so
> long since I touched the program i've forgotten the
> right term).
> 
> ii) what you have to do when more than one
> instrument is playing-- do you say have to plan to
> cut each one's volume in half so total <= 10000 or
> something?
> 
> Thanks for any help. 
> 
> 
> See my links at 
> http://www.geocities.com/pterandon/index.html
> 		
> ---------------------------------
>  
>  What are the most popular cars? Find out at Yahoo!
> Autos 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
Send bugs reports to this list.
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2006-01-31 14:18
Fromschwaahed
SubjectRe: Amplitude!
AttachmentsNone  

Date2006-02-01 20:25
FromTobiah
SubjectRe: Amplitude!
> 
> ii) what you have to do when more than one instrument is playing-- do 
> you say have to plan to cut each one's volume in half so total <= 10000 
> or something?

In my experience, two instruments playing should be made to have an
amplitude that is half as loud as one.  You generally have a max
amplitude of 32767 for all of the output together.  Since two signals 
playing together are simply summed, then you are bound to get some
overages unless you knock both down to 16383.  My general way of
working is to continually adjust a master volume global variable by 
which all outputs in the orchestra are multiplied.

Now as for when the piece is finished, you will notice that csound reports
the max peak amplitude for your piece.  You can divide that number 
into 32767 and multiply the current level of your maximum volume
global variable by the result.  This should get you right to the
top of the allowable range without going over.  Doing this should
ensure that the resulting sound file will play at a suitable volume
on other people's equipment.

Date2006-02-01 20:43
Fromjlato@mail.utexas.edu
SubjectRe: Amplitude!
Keep in mind that although the total amplitude will never be greater than the
sum of each individual instrument's amplitude, in practice things often get
more complicated.  If two instruments are playing that have a peak amplitude of
10000 each, although their sum may be as much as 20000, it often will be less,
depending on each instrument's frequency components and phase.  I've
occasionally had situations where there were no levels out of range until after
I removed an instrument.  Also some instruments (esp. granular types) may not
have an absolute control on the final amplitude.

Because of these complications, Tobiah's suggestion of a master volume control
is often the easiest way to control overall level for pieces.

John Lato

Quoting Tobiah :

>
> >
> > ii) what you have to do when more than one instrument is playing-- do
> > you say have to plan to cut each one's volume in half so total <= 10000
> > or something?
>
> In my experience, two instruments playing should be made to have an
> amplitude that is half as loud as one.  You generally have a max
> amplitude of 32767 for all of the output together.  Since two signals
> playing together are simply summed, then you are bound to get some
> overages unless you knock both down to 16383.  My general way of
> working is to continually adjust a master volume global variable by
> which all outputs in the orchestra are multiplied.
>
> Now as for when the piece is finished, you will notice that csound reports
> the max peak amplitude for your piece.  You can divide that number
> into 32767 and multiply the current level of your maximum volume
> global variable by the result.  This should get you right to the
> top of the allowable range without going over.  Doing this should
> ensure that the resulting sound file will play at a suitable volume
> on other people's equipment.
>
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>