Welcome to the Piano World Piano Forums
Over 2.5 million posts about pianos, digital pianos, and all types of keyboard instruments
Join the World's Largest Community of Piano Lovers (it's free)
It's Fun to Play the Piano ... Please Pass It On!


SEARCH
Piano Forums & Piano World
(ad)
Virtual Sheet Music
Download Sheet Music Instantly
Virtual Sheet Music - Classical Sheet Music Downloads
Sheet Music...
(125ad)
Piano Life Saver - Dampp Chaser
Dampp Chaser Piano Life Saver
(ad)
Modern Piano Moving
Modern Piano Moving
(ad)
Piano Buyer Guide
Piano Buyer Spring 2017
(ad)
Lindeblad Piano
Lindeblad Piano Restorations and sales
Who's Online Now
119 registered members (anotherscott, alfredo capurso, accordeur, apassionata, 26 invisible), 1,417 guests, and 13 spiders.
Key: Admin, Global Mod, Mod
(ad)
Estonia Pianos
Estonia Pianos
Quick Links to Useful Piano & Music Resources
Our Classified Ads
Find Piano Professionals-

*Piano Dealers - Piano Stores
*Piano Tuners
*Piano Teachers
*Piano Movers
*Piano Restorations
*Piano Manufacturers

Quick Links:
*Advertise On Piano World
*Free Piano Newsletter
*Online Piano Recitals
*Piano Recitals Index
*Piano & Music Accessories
*Live Piano Venues
*Music School Listings
* Buying a Piano
*Buying A Acoustic Piano
*Buying a Digital Piano
*Pianos for Sale
*Sell Your Piano
*How Old is My Piano?
*Directory/Site Map
*Virtual Piano
*Music Word Search
*Piano Videos
*Virtual Piano Chords & Scales
Previous Thread
Next Thread
Print Thread
#2048725 - 03/15/13 02:14 PM any mathematical signal experts?  
Joined: Jul 2012
Posts: 573
xorbe Offline
500 Post Club Member
xorbe  Offline
500 Post Club Member

Joined: Jul 2012
Posts: 573
Mt View, CA
If you have 2 *.wav files (or pcm wave data, whatever), what is the proper way to sum them? Seems like straight addition would cause clipping in a hurry, and 2+2=4 but that leads to a quadruple in power, not a doubling right? And is a *.wav sine wave with amplitude 32000 twice as loud as 16000 or what -- what's the relationship (loudness or power).

(ad) ROLAND

Click Here

#2048823 - 03/15/13 06:17 PM Re: any mathematical signal experts? [Re: xorbe]  
Joined: Feb 2013
Posts: 752
Mwm Offline
500 Post Club Member
Mwm  Offline
500 Post Club Member

Joined: Feb 2013
Posts: 752
Originally Posted by xorbe
If you have 2 *.wav files (or pcm wave data, whatever), what is the proper way to sum them? Seems like straight addition would cause clipping in a hurry, and 2+2=4 but that leads to a quadruple in power, not a doubling right? And is a *.wav sine wave with amplitude 32000 twice as loud as 16000 or what -- what's the relationship (loudness or power).


When you sum wave files, it is important to first reduce the amplitudes of each file so that the sum will not clip. Check out Audacity. The online manual and wiki links provides much help in solving your problem.

#2048835 - 03/15/13 06:52 PM Re: any mathematical signal experts? [Re: xorbe]  
Joined: Jul 2012
Posts: 573
xorbe Offline
500 Post Club Member
xorbe  Offline
500 Post Club Member

Joined: Jul 2012
Posts: 573
Mt View, CA
I'm working on real time synthesis generation, so simply slashing the first signal in half suddenly would sound bad on the introduction of a second wave source. I guess I'll hit the Audacity forum to see if the answer is just A+B. That's how I've always done it, but I got to thinking maybe that was incorrect possibly, but I can't derive anything else that would work. 16 bits is not a lot ...

#2048854 - 03/15/13 08:04 PM Re: any mathematical signal experts? [Re: xorbe]  
Joined: Dec 2012
Posts: 3,593
Charles Cohen Online content
3000 Post Club Member
Charles Cohen  Online Content
3000 Post Club Member

Joined: Dec 2012
Posts: 3,593
Richmond, BC, Canada
You just sum the numbers in the .WAV file. Audio mixers just add voltages together; you need to do the same.

16 bits may not seems like a lot, but it's something like a 90 dB range from hex "0001" to "FFFF".

Audacity's _internal_ representation use 32-bit _floating point_ numbers, which is more than enough.

24-bit sound cards _use_ 24 bits (fixed-point, not floating-point)because some of those bits are going to be "lost" during editing, levelling, and so on.

. Charles


. Charles
---------------------------
PX-350 / microKorg XL+ / Pianoteq / Lounge Lizard / Korg Wavedrum / EV ZXA1 speaker
(ad)
Piano & Music Accessories
piano accessories music gifts tuning and moving equipment
#2048856 - 03/15/13 08:07 PM Re: any mathematical signal experts? [Re: xorbe]  
Joined: Feb 2013
Posts: 39
Wess. Chr. K. Offline
Full Member
Wess. Chr. K.  Offline
Full Member

Joined: Feb 2013
Posts: 39
Sofia, Bulgaria
0db+0db=+6db

This is the equitation if the 2 picks are reaching 0db simultaneously each one (which happens only theoretically).

If you have 2 audio files with pick level of 0 db and you want to mix them together just put the leveler to -3 of each stereo file and export or bounce them realtime.
That is it.
-3.5 db is good for precaution.


Best regards,
Wess
#2048908 - 03/15/13 10:38 PM Re: any mathematical signal experts? [Re: xorbe]  
Joined: Jul 2012
Posts: 573
xorbe Offline
500 Post Club Member
xorbe  Offline
500 Post Club Member

Joined: Jul 2012
Posts: 573
Mt View, CA
Yes, but this is for my software dp kernel, and there can be a LOT more than 2 keys sounding at a time ... like, I need to knock it back to 12 bits to handle the summation of say 16 notes (the other 4 bits, 2^4) as a reasonable peak.

#2049471 - 03/17/13 03:16 AM Re: any mathematical signal experts? [Re: xorbe]  
Joined: Dec 2012
Posts: 3,593
Charles Cohen Online content
3000 Post Club Member
Charles Cohen  Online Content
3000 Post Club Member

Joined: Dec 2012
Posts: 3,593
Richmond, BC, Canada
Quote
Yes, but this is for my software dp kernel, and there can be a LOT more than 2 keys sounding at a time ... like, I need to knock it back to 12 bits to handle the summation of say 16 notes (the other 4 bits, 2^4) as a reasonable peak.


That's why Audacity uses 32-bit _floating-point_ numbers, not fixed-point numbers, for all its internal manipulations.

You should do the same.

[I have an old memory that digital synths (e.g., the DX-7) with 12-bit or 16-bit computational sound generators could get into problems with "graininess". It's a peculiar digital artifact, and doesn't sound nice. ]

. charles


. Charles
---------------------------
PX-350 / microKorg XL+ / Pianoteq / Lounge Lizard / Korg Wavedrum / EV ZXA1 speaker
#2049549 - 03/17/13 08:37 AM Re: any mathematical signal experts? [Re: Charles Cohen]  
Joined: Dec 2009
Posts: 4,675
dewster Offline
4000 Post Club Member
dewster  Offline
4000 Post Club Member

Joined: Dec 2009
Posts: 4,675
Northern NJ
Originally Posted by Charles Cohen
[I have an old memory that digital synths (e.g., the DX-7) with 12-bit or 16-bit computational sound generators could get into problems with "graininess". It's a peculiar digital artifact, and doesn't sound nice. ]

The DX-7 chips did many calculations in the log domain so that multiplications were simple additions. IIRC, earlier models used 12 bit converters, giving an SNR of ~12 bits * 6dB = 72 dB. I don't believe any of them tried to control aliasing.

#2049749 - 03/17/13 03:45 PM Re: any mathematical signal experts? [Re: Charles Cohen]  
Joined: Jul 2012
Posts: 573
xorbe Offline
500 Post Club Member
xorbe  Offline
500 Post Club Member

Joined: Jul 2012
Posts: 573
Mt View, CA
Originally Posted by Charles Cohen
That's why Audacity uses 32-bit _floating-point_ numbers, not fixed-point numbers, for all its internal manipulations.

You should do the same.

Well, I use 32-bit int with the value shifted up by 8. That gives me resolution to 0.004 and 7 bits of headroom at the top, plus int operations are quicker than fp, though maybe I am out of date wrt new simd fp instructions (added to todo list). But all of that is not the problem.

The problem is at the end where the output value to the sound card is -32768 to 32767, and the final temp value that's held (as 32-bit fp or 32-bit fixed point int) is out of that range. I can think of a few strategies to deal with this:

(1) Scale the final output such that a single key peaks at 12 bits, etc.
(2) Some sort of gradual signal compression that equates 32767 with a larger value.
(3) Some combination of 1 and 2.
(4) Buy a 24-bit sound card.

#2052679 - 03/22/13 07:03 PM Re: any mathematical signal experts? [Re: Charles Cohen]  
Joined: Jul 2012
Posts: 573
xorbe Offline
500 Post Club Member
xorbe  Offline
500 Post Club Member

Joined: Jul 2012
Posts: 573
Mt View, CA
Originally Posted by Charles Cohen
16 bits may not seems like a lot, but it's something like a 90 dB range from hex "0001" to "FFFF".

This is a very interesting read, and demonstrates a -105dB tone using only 16 bits:
http://people.xiph.org/~xiphmont/demo/neil-young.html


Moderated by  Piano World 

Piano Acc. & Gift Items in
Piano World's Online Store
In PianoSupplies.com ,(a division of Piano World) our online store for piano and music gifts and accessories, party goods, tuning equipment, piano moving equipment, benches, lamps Caster Cups and more.


Free Shipping on Jansen Artist Piano Benches
ad
Pierce Piano Atlas


(ad)
Pianoteq
Grotrian Concert
Royal
for Pianoteq out now
What's Hot!!
Why Do You Play The Piano?
-------------------
Posting Pictures on the Forums
-------------------
Forums RULES & HELP
-------------------
ADVERTISE on Piano World
-------------------
Piano Classified Ads
New Topics - Multiple Forums
Phoenix D-232 and Chopin
by Mark Polishook. 05/27/17 09:07 AM
On legato and slurs
by Fede. 05/27/17 02:49 AM
What makes a piece difficult
by Emeraldz. 05/27/17 01:12 AM
Rach 3 with our own Jeffrey Biegel
by Piano World. 05/27/17 12:21 AM
(ad)
Sheet Music Plus
Sheet Music Plus Featured Sale
(ad)
Accu-Tuner
Sanderson Accu-Tuner
Report Problems With New Forums
Report Problems with New Forums Here!
Forum Statistics
Forums44
Topics179,915
Posts2,630,227
Members87,895
Most Online15,252
Mar 21st, 2010
Visit our online store for gifts for music lovers

 
Help keep the forums up and running with a donation, any amount is appreciated!
Or by becoming a Subscribing member! Thank-you.
Donate   Subscribe
 
Our Piano Related Classified Ads
| Dealers | Tuners | Lessons | Movers | Restorations | Pianos For Sale | Sell Your Piano |

Advertise on Piano World
| Subscribe | Piano World | PianoSupplies.com | Advertise on Piano World |
| |Contact | Privacy | Legal | About Us | Site Map | Free Newsletter |


copyright 1997 - 2017 Piano World ® all rights reserved
No part of this site may be reproduced without prior written permission
Powered by UBB.threads™ PHP Forum Software 7.6.0