It is currently Fri Mar 29, 2024 3:55 am


Stereo to Mono conversion, excessive amplification

Hauptwerk software technical support only. Please make sure you have read the manual, tutorials and FAQ pages before requesting support.
  • Author
  • Message
Offline
User avatar

elia

Member

  • Posts: 125
  • Joined: Mon Oct 27, 2008 1:11 pm
  • Location: Italy , Padova

Stereo to Mono conversion, excessive amplification

PostMon Oct 24, 2016 5:11 am

from Martin, viewtopic.php?f=3&t=14406&p=106927
If you load/route a stereo pipe in mono then Hauptwerk picks the loudest of its sample's two channels and plays just that one (to avoid phase cancellation through mixing the channels together), with its amplitude adjusted to match the average amplitude of the original two stereo channels.


1966 Casavant Frères, Exemplum Organum
https://www.hauptwerk.com/instruments/e ... nt-fr-res/

With this pipe organ almost all registers sound weaker than the original wave files except with Trumpete Heroique 8 CH. You will immediately notice this fact because the sound is amplified greatly.

I have documented this fact through the Hauptwerk audio recorder (mono, 32bit) and with middle C sound (MIDI 60) with a duration of about 5 seconds. The following are the comparisons between the recorded mono single sound and the original stereo sound:
GT-Principal8 (p8)
CH-KrumHorn8 (k8)
CH-TrumpeteHeroique8 (th8)
.

Hauptwerk was used with Volume=100 and Trim_dB=0.

C:\Program Files (x86)\sox-14-4-2>sox 060-C-th8.wav -n stats
Overall Left Right
DC offset 0.000009 -0.000006 0.000009
Min level -0.339172 -0.339172 -0.313293
Max level 0.531342 0.300476 0.531342
Pk lev dB -5.49 -9.39 -5.49
RMS lev dB -15.50 -16.22 -14.89
RMS Pk dB -14.26 -15.74 -14.26
RMS Tr dB -47.98 -47.98 -46.15
Crest factor - 2.19 2.95
Flat factor 0.00 0.00 0.00
Pk count 2 2 2
Bit-depth 15/16 15/16 15/16
Num samples 306k
Length s 6.938
Scale max 1.000000
Window s 0.050

C:\Program Files (x86)\sox-14-4-2>sox 60-th8.wav -n stats
DC offset -0.010679
Min level -0.806540
Max level 1.000000
Pk lev dB -0.00
RMS lev dB -7.32
RMS Pk dB -6.80
RMS Tr dB -38.45
Crest factor 2.32
Flat factor 20.93
Pk count 18.5k
Bit-depth 24/24
Num samples 305k
Length s 6.922
Scale max 1.000000
Window s 0.050

C:\Program Files (x86)\sox-14-4-2>sox 060-C-p8.wav -n stats
Overall Left Right
DC offset -0.000003 -0.000003 -0.000001
Min level -0.422882 -0.334625 -0.422882
Max level 0.299011 0.277313 0.299011
Pk lev dB -7.48 -9.51 -7.48
RMS lev dB -15.64 -16.58 -14.87
RMS Pk dB -13.51 -15.66 -13.51
RMS Tr dB -44.77 -44.77 -42.34
Crest factor - 2.26 2.34
Flat factor 0.00 0.00 0.00
Pk count 2 2 2
Bit-depth 15/16 15/16 15/16
Num samples 330k
Length s 7.490
Scale max 1.000000
Window s 0.050

C:\Program Files (x86)\sox-14-4-2>sox 60-p8.wav -n stats
DC offset -0.000001
Min level -0.279128
Max level 0.197439
Pk lev dB -11.08
RMS lev dB -18.54
RMS Pk dB -17.11
RMS Tr dB -46.28
Crest factor 2.36
Flat factor 0.00
Pk count 2
Bit-depth 23/24
Num samples 248k
Length s 5.619
Scale max 1.000000
Window s 0.050

C:\Program Files (x86)\sox-14-4-2>sox 060-C-k8.wav -n stats
Overall Left Right
DC offset -0.000001 -0.000001 0.000000
Min level -0.103516 -0.103516 -0.087677
Max level 0.093536 0.093536 0.082214
Pk lev dB -19.70 -19.70 -21.14
RMS lev dB -28.90 -28.19 -29.74
RMS Pk dB -26.99 -26.99 -28.68
RMS Tr dB -72.86 -66.89 -72.86
Crest factor - 2.66 2.69
Flat factor 0.00 0.00 0.00
Pk count 2 2 2
Bit-depth 13/16 13/16 13/16
Num samples 121k
Length s 2.733
Scale max 1.000000
Window s 0.050

C:\Program Files (x86)\sox-14-4-2>sox 60-k8.wav -n stats
DC offset -0.000001
Min level -0.087194
Max level 0.077392
Pk lev dB -21.19
RMS lev dB -29.08
RMS Pk dB -28.43
RMS Tr dB -49.84
Crest factor 2.48
Flat factor 0.00
Pk count 2
Bit-depth 21/24
Num samples 275k
Length s 6.226
Scale max 1.000000
Window s 0.050



Elia
Offline
User avatar

mdyde

Moderator

  • Posts: 15444
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Stereo to Mono conversion, excessive amplification

PostMon Oct 24, 2016 9:36 am

Hello Elia,

I've been studying what happens within Hauptwerk when loading the Exemplum Casavant's CH-TrumpeteHeroique8 middle C sample in mono (with Hauptwerk's output set to be entirely mono, which I think is what you're doing, if I understand correctly), and so far I haven't found any evidence of anything awry, in that Hauptwerk is correctly calculating the RMS values for both of the original sample file's two channels, picking the correct channel (the right-hand one, since it's louder), and it appears also to be calculating and applying the correct amplification to it based upon the mean RMS of the two original channels, and upon the per-pipe voicing settings that are embedded for the virtual pipe within the organ definition file, together with the overall user level adjustment settings.

Note that the Casavant sample set has voicing adjustments (for both amplitudes and EQs) stored within its organ definition that vary significantly from pipe to pipe for that rank. Hence levels in the raw sample files themselves can't directly/simply be compared to the output levels heard when the samples are played in Hauptwerk.

For a more valid test, you would need to disable all randomisations on the Organ Preferences screen, then to compare the virtual pipe's level when recorded by Hauptwerk's buil-in recorder, with Hauptwerk set for stereo output throughout (i.e. with stereo selected on the 'General settings | Audio outputs' screen and stereo also selected on the 'Organ | Load organ, adjusting rank ... options' screen) to its level when recorded in the same way but with Hauptwerk set for mono output.

Is that what you were doing, or were you comparing the levels in the original raw sample files? (The latter isn't a valid comparison, as above.)

Also bear in mind that the levels of the harmonics may be significantly different between the left and right channels of the original sample file, and there may DC offsets and other differences between the channels. Hence perceived loudness could mislead as a basis for comparing mono vs. stereo loading.

A truly valid test could be to edit all of the sample files in the rank so that their right channels were exact copies of their left channels, then load them in Hauptwerk with Hauptwerk set throughout for stereo output, use Hauptwerk's built-in recorder and measure the recorded levels, then compare them with the values obtained by repeating the test whilst loading in mono. Since the raw channels would be identical perceived loudness when playing the virtual rank should also be comparable for loading in mono vs. stereo.

I haven't gone to that length yet, but I have spent a few hours checking and haven't found any evidence so far of anything misbehaving within Hauptwerk. A brief recording made in mono for that pipe also seemed comparable in levels to one made in stereo.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline
User avatar

mdyde

Moderator

  • Posts: 15444
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Stereo to Mono conversion, excessive amplification

PostMon Oct 24, 2016 9:51 am

P.S. Here's a very quick comparison of two trimmed recorded files from Hauptwerk for that particular virtual pipe when loading in mono vs. stereo:

Code: Select all
C:\Temp>"C:\Program Files (x86)\sox-14-4-2\sox" mono.wav -n stats
DC offset  -0.000002
Min level  -0.127899
Max level   0.212524
Pk lev dB     -13.45
RMS lev dB    -25.59
RMS Pk dB     -22.70
RMS Tr dB     -32.50
Crest factor    4.05
Flat factor     0.00
Pk count           2
Bit-depth      14/16
Num samples    1.92M
Length s      43.519
Scale max   1.000000
Window s       0.050


Code: Select all
C:\Temp>"C:\Program Files (x86)\sox-14-4-2\sox" stereo.wav -n stats
             Overall     Left      Right
DC offset  -0.000008 -0.000008  0.000002
Min level  -0.140594 -0.140594 -0.132477
Max level   0.228302  0.134033  0.228302
Pk lev dB     -12.83    -17.04    -12.83
RMS lev dB    -23.99    -24.64    -23.43
RMS Pk dB     -21.53    -22.91    -21.53
RMS Tr dB     -32.74    -32.74    -31.63
Crest factor       -      2.40      3.39
Flat factor     0.00      0.00      0.00
Pk count           4         5         3
Bit-depth      14/16     14/16     14/16
Num samples    2.68M
Length s      60.808
Scale max   1.000000
Window s       0.050


Those figures seem within reasonable tolerances (allowing for randomisations, multiple loop playback, keys held for slightly different lengths of time, slightly different trims, etc.).
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline
User avatar

elia

Member

  • Posts: 125
  • Joined: Mon Oct 27, 2008 1:11 pm
  • Location: Italy , Padova

Re: Stereo to Mono conversion, excessive amplification

PostTue Oct 25, 2016 6:18 am

Hello Martin,
I'm sorry if I made you waste so much time. I was comparing the levels in the original raw stereo sample files. It is not a valid test for the reasons you said. Exemplum has very amplified TrumpeteHeroique8 register (the highest global user level is Trim_db = -4). This fact is independent of the mono/stereo loading and mono/stereo audio output!

I redid the measures (Trim_db=-10) as you have indicated and the mono file has an average RMS level than the stereo file 16,695=(17.29+16.10)/2 .

To complete the "stereo-> mono" speech you might want to use only the left channel or the right channel for the tonal reasons or microphones positioning in order to achieve greater consistency. Hauptwerk has its logic as has been said, but nobody forbids to rework the raw stereo wave files to prepare them for the Hauptwerk elaboration, for example as pure mono raw files.
I just wanted to make sure I consider the "RMS lev dB" parameter as a reference to calculate the amplification (of course with a script or a dedicated audio processing program) in order to get closer to what he does Hauptwerk.

Thanks again for clarity and I apologize again for my mistake.

C:\Program Files (x86)\sox-14-4-2>sox th8c60-stereo.wav -n stats
Overall Left Right
DC offset 0.000009 -0.000005 0.000009
Min level -0.280401 -0.280401 -0.274634
Max level 0.456286 0.270840 0.456286
Pk lev dB -6.82 -11.04 -6.82
RMS lev dB -16.65 -17.29 -16.10
RMS Pk dB -15.50 -16.84 -15.50
RMS Tr dB -39.15 -39.15 -37.61
Crest factor - 2.05 2.91

C:\Program Files (x86)\sox-14-4-2>sox th8c60-mono.wav -n stats
DC offset 0.000010
Min level -0.255045
Max level 0.423954
Pk lev dB -7.45
RMS lev dB -16.70
RMS Pk dB -16.14
RMS Tr dB -43.46
Crest factor 2.90
Elia
Offline
User avatar

mdyde

Moderator

  • Posts: 15444
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Stereo to Mono conversion, excessive amplification

PostTue Oct 25, 2016 6:56 am

Thanks, Elia.

No problem, and glad to hear you now have the information needed for your intended purpose.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Stereo to Mono conversion, excessive amplification

PostTue Nov 05, 2019 12:51 am

Deleted
Last edited by engrssc on Tue Nov 05, 2019 12:58 am, edited 1 time in total.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Stereo to Mono conversion, excessive amplification

PostTue Nov 05, 2019 12:54 am

Important points in Martin's answer:

mdyde wrote:Hauptwerk is correctly calculating the RMS values for both of the original sample file's two channels, picking the correct channel (the right-hand one, since it's louder), and it appears also to be calculating and applying the correct amplification to it based upon the mean RMS of the two original channels, and upon the per-pipe voicing settings that are embedded for the virtual pipe within the organ definition file, together with the overall user level adjustment settings.

Also bear in mind that the levels of the harmonics may be significantly different between the left and right channels of the original sample file, and there may DC offsets and other differences between the channels. Hence perceived loudness could mislead as a basis for comparing mono vs. stereo loading.


In this area off perceived loudness, or dynamic efficiency, it follows that the use of high pitches have an important function in changing the perceived level of loudness. Dynamic increase will be accompanied by an increase in the proportion of upper pitches. This is true when combining the left and right channels of a stereo image. What I'm reading is that Hauptwerk is doing the math in this case.

There is an interesting method of creating the effect of a crescendo. For instance, playing on the Great with the Swell coupled having 8' and 4' stops drawn on the Great. On the Swell having a "brilliant" ensemble with reeds and mixtures, containing a much larger proportion of high pitches. In this case, opening the Swell expression pedal effectively has the effect of increasing the perceived loudness due to inclusion of these higher pitched stops which are in a range where the ear is more sensitive.

The closed "Swell box" filters out a large proportion of the upper partials and to some extent the fundamentals of smaller pipe sounds. In a real pipe organ, as the swell shades open, the transmission of these high pitches is less impeded causing an increased perception of loudness.

Some of these features are involved in what is known as voicing which also involves the space where the instrument is to play. Hence on my "wish list" is greater voicing capabilities in future versions of Hauptwerk.

In this regard, referring to real pipe organs, a comparison of recent instruments with former installations shows a smaller proportion a eight-foot stops, a larger number of mutations and mixtures, fewer heavy flutes, more brilliant voicing of the diapasons and reeds, and a large number of four-foot reeds.

The bottom line, the ear still is the final element as to our perception.

Rgds,
Ed

Return to Technical support

Who is online

Users browsing this forum: No registered users and 5 guests