[Sounds] How to turn off reverb

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Sounds] How to turn off reverb

Christoph Thiede

Hi all,


I never have dealt with the Sound system in Squeak before so here is a newbie question from my side: How can I turn off the reverb which you hear every time you play an FM sound? Take this example:


AbstractSound dial: '#'.


Either my speakers are broken or there is a reverb that is hidden somewhere in the implementation of FMSound. :-) I can also reproduce this when creating an FMSound manually without defining any envelopes. I also took a look at the ingenious Speech-TTS package from Squeak 3 and could hear a reverb there, too. Is this a bug? Is this a - maybe unfortunate - default setting? How can I turn off this?


Thanks in advance! :-)


Best,

Christoph



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: [Sounds] How to turn off reverb

Eliot Miranda-2
Hi Christoph,  you’ll find a class variable called (IIRC) Reverb or UseReverb or done such in ind of the sound classes.  Use the MessageNames to track it down.

_,,,^..^,,,_ (phone)

On May 24, 2021, at 3:40 PM, Thiede, Christoph <[hidden email]> wrote:



Hi all,


I never have dealt with the Sound system in Squeak before so here is a newbie question from my side: How can I turn off the reverb which you hear every time you play an FM sound? Take this example:


AbstractSound dial: '#'.


Either my speakers are broken or there is a reverb that is hidden somewhere in the implementation of FMSound. :-) I can also reproduce this when creating an FMSound manually without defining any envelopes. I also took a look at the ingenious Speech-TTS package from Squeak 3 and could hear a reverb there, too. Is this a bug? Is this a - maybe unfortunate - default setting? How can I turn off this?


Thanks in advance! :-)


Best,

Christoph




Reply | Threaded
Open this post in threaded view
|

Re: [Sounds] How to turn off reverb

Stéphane Rollandin
In reply to this post by Christoph Thiede
SoundPlayer stopReverb

Stef

Reply | Threaded
Open this post in threaded view
|

Re: [Sounds] How to turn off reverb

Stéphane Rollandin
In reply to this post by Christoph Thiede
> Is this a - maybe unfortunate - default setting?

The default reverb is indeed unfortunate IMO. It is hard-coded in
SoundPlayer>>#startReverb

In muO, I use a much lighter reverb (no reverb would make some FMSounds
end badly):

ReverbState := ReverbSound new
        tapDelays: #(1601 3469 7919)
        gains: #(0.012 0.007 0.001).

Whatever the default, I guess it would be good to have it defined elsewhere.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: [Sounds] How to turn off reverb

Christoph Thiede
> SoundPlayer stopReverb

Fantastic! This was what I was searching for.

> no reverb would make some FMSounds end badly):

Hm ... I just haved tried this out at the example of brass:

        FMSound brass1 play

And I have to tell that, both with default and without reverb, I can hear the abrupt end of the sound very clearly. IMHO it does not make a large difference, except for the fact that a pure tone should not have any reverb by definition.

I am not an expert in sounds at all, but couldn't it be a more elegant solution to adjust the envelopes of the problematic sounds instead and to extend their release phase?

I changed #brass1 like this:

        | snd p env |
        snd := FMSound new modulation: 0 ratio: 1.
        p := OrderedCollection new.
        - p add: 0@0.0; add: 30@0.8; add: 90@1.0; add: 120@0.9; add: 220@0.7; add: 320@0.9; add: 360@0.0.
        + p add: 0@0.0; add: 30@0.8; add: 90@1.0; add: 120@0.9; add: 220@0.7; add: 320@0.9; add: 440@0.0.
        snd addEnvelope: (VolumeEnvelope points: p loopStart: 4 loopEnd: 6).

        p := OrderedCollection new.
        p add: 0@0.5; add: 60@1.0; add: 120@0.8; add: 220@0.65; add: 320@0.8; add: 360@0.0.
        env := Envelope points: p loopStart: 3 loopEnd: 5.
        env target: snd; updateSelector: #modulation:; scale: 5.0.
        snd addEnvelope: env.

        (snd setPitch: 220.0 dur: 1.0 loudness: 0.5) play

The only difference is that I moved the last envelope point 80 ms to the right. I can't hear any "plop" now any longer.

My proposal is to turn off reverb in the SoundPlayer by default and to adjust the most problematic FMSounds manually instead. What do you think? :-)

Best,
Christoph

Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: [Sounds] How to turn off reverb

Stéphane Rollandin
> FMSound brass1 play
>
> And I have to tell that, both with default and without reverb, I can hear the abrupt end of the sound very clearly.
Well without reverb there is a definitely non-musical harsh noise. With
reverb on, the sound still does stop abruptly, but more musically. This
makes all the difference to me.

But I do agree that overall the FMSounds releases are not graceful :)


> IMHO it does not make a large difference, except for the fact that a pure tone should not have any reverb by definition.

A FMSound is not a pure tone. A pure tone is a sinusoid, which ends with
a clear click (a very non-musical noise).

Now anyway the reverb is used only when playing a sound, not when
processing it - here it is not part of the FMSound itself: you will not
see the reverb in the waveform or the spectrogram.

 From a musical perspective, there is always some reverb. Nobody plays a
concerto in an anechoic chamber. So you can think of the default reverb
setting as the sound of the Squeak room itself - when just playing
sounds like, for a game, it is nicer to have one. And when we need
Squeak to behave like an anechoic chamber, we can just turn the reverb off.

>
> I am not an expert in sounds at all, but couldn't it be a more elegant solution to adjust the envelopes of the problematic sounds instead and to extend their release phase?
>
> I changed #brass1 like this:
>
> | snd p env |
> snd := FMSound new modulation: 0 ratio: 1.
> p := OrderedCollection new.
> - p add: 0@0.0; add: 30@0.8; add: 90@1.0; add: 120@0.9; add: 220@0.7; add: 320@0.9; add: 360@0.0.
> + p add: 0@0.0; add: 30@0.8; add: 90@1.0; add: 120@0.9; add: 220@0.7; add: 320@0.9; add: 440@0.0.
> snd addEnvelope: (VolumeEnvelope points: p loopStart: 4 loopEnd: 6).
>
> p := OrderedCollection new.
> p add: 0@0.5; add: 60@1.0; add: 120@0.8; add: 220@0.65; add: 320@0.8; add: 360@0.0.
> env := Envelope points: p loopStart: 3 loopEnd: 5.
> env target: snd; updateSelector: #modulation:; scale: 5.0.
> snd addEnvelope: env.
>
> (snd setPitch: 220.0 dur: 1.0 loudness: 0.5) play
>
> The only difference is that I moved the last envelope point 80 ms to the right. I can't hear any "plop" now any longer.
Right, but the duration of the sound cannot be considered to be one
second anymore - it is much closer to 0.9 seconds (where it was around
0.95 before, so already too short).

See the attached pictures: SoundElementEditor1.png is the current
waveform, SoundElementEditor2.png the one you propose. See how it ends
prematurely?

I would say 390@0.0 for the last point is better. It still sounds good,
but does not shorten the sound as much.

For composition, it is important that a sound lasts as long as it claims
to last. Else, the phrasing articulations cannot be right - you would
hear a staccato when a legato is asked for.

So a sound release should happen after the sound nominal duration (which
is not the case at the moment)


> My proposal is to turn off reverb in the SoundPlayer by default and to adjust the most problematic FMSounds manually instead. What do you think? :-)

My counter-proposal would be to keep the default reverb and give it the
settings it has in muO :)

And then, if you want to tweak some sounds, have their nominal duration
respected. So I would vote for having releases after nominal duration,
but this means a mechanism would then be needed to differentiate the
nominal duration from the duration you get from the raw number of samples.

This mechanism exists in muO.

In fact it is rather difficult for me to give any specific piece of
advice about how music should be handled in Squeak proper, because my
own way to do this has been to implement a much vaster and deeper
framework where many different perspectives work together. Not to say it
is perfect, but it is thorough - one thing lead to another and I could
talk for hours...


Best,

Stef



SoundElementEditor1.png (9K) Download Attachment
SoundElementEditor2.png (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Sounds] How to turn off reverb

marcel.taeumel
Hi Stéphane.

From a musical perspective, there is always some reverb. Nobody plays a
> concerto in an anechoic chamber. So you can think of the default reverb
> setting as the sound of the Squeak room itself - when just playing
> sounds like, for a game, it is nicer to have one. And when we need
> Squeak to behave like an anechoic chamber, we can just turn the reverb off.

Aha! Thanks for this explanation. :-)

Best,
Marcel

Am 31.05.2021 09:36:10 schrieb Stéphane Rollandin <[hidden email]>:

> FMSound brass1 play
>
> And I have to tell that, both with default and without reverb, I can hear the abrupt end of the sound very clearly.
Well without reverb there is a definitely non-musical harsh noise. With
reverb on, the sound still does stop abruptly, but more musically. This
makes all the difference to me.

But I do agree that overall the FMSounds releases are not graceful :)


> IMHO it does not make a large difference, except for the fact that a pure tone should not have any reverb by definition.

A FMSound is not a pure tone. A pure tone is a sinusoid, which ends with
a clear click (a very non-musical noise).

Now anyway the reverb is used only when playing a sound, not when
processing it - here it is not part of the FMSound itself: you will not
see the reverb in the waveform or the spectrogram.

From a musical perspective, there is always some reverb. Nobody plays a
concerto in an anechoic chamber. So you can think of the default reverb
setting as the sound of the Squeak room itself - when just playing
sounds like, for a game, it is nicer to have one. And when we need
Squeak to behave like an anechoic chamber, we can just turn the reverb off.

>
> I am not an expert in sounds at all, but couldn't it be a more elegant solution to adjust the envelopes of the problematic sounds instead and to extend their release phase?
>
> I changed #brass1 like this:
>
> | snd p env |
> snd := FMSound new modulation: 0 ratio: 1.
> p := OrderedCollection new.
> - p add: 0@0.0; add: 30@0.8; add: 90@1.0; add: 120@0.9; add: 220@0.7; add: 320@0.9; add: 360@0.0.
> + p add: 0@0.0; add: 30@0.8; add: 90@1.0; add: 120@0.9; add: 220@0.7; add: 320@0.9; add: 440@0.0.
> snd addEnvelope: (VolumeEnvelope points: p loopStart: 4 loopEnd: 6).
>
> p := OrderedCollection new.
> p add: 0@0.5; add: 60@1.0; add: 120@0.8; add: 220@0.65; add: 320@0.8; add: 360@0.0.
> env := Envelope points: p loopStart: 3 loopEnd: 5.
> env target: snd; updateSelector: #modulation:; scale: 5.0.
> snd addEnvelope: env.
>
> (snd setPitch: 220.0 dur: 1.0 loudness: 0.5) play
>
> The only difference is that I moved the last envelope point 80 ms to the right. I can't hear any "plop" now any longer.

Right, but the duration of the sound cannot be considered to be one
second anymore - it is much closer to 0.9 seconds (where it was around
0.95 before, so already too short).

See the attached pictures: SoundElementEditor1.png is the current
waveform, SoundElementEditor2.png the one you propose. See how it ends
prematurely?

I would say 390@0.0 for the last point is better. It still sounds good,
but does not shorten the sound as much.

For composition, it is important that a sound lasts as long as it claims
to last. Else, the phrasing articulations cannot be right - you would
hear a staccato when a legato is asked for.

So a sound release should happen after the sound nominal duration (which
is not the case at the moment)


> My proposal is to turn off reverb in the SoundPlayer by default and to adjust the most problematic FMSounds manually instead. What do you think? :-)

My counter-proposal would be to keep the default reverb and give it the
settings it has in muO :)

And then, if you want to tweak some sounds, have their nominal duration
respected. So I would vote for having releases after nominal duration,
but this means a mechanism would then be needed to differentiate the
nominal duration from the duration you get from the raw number of samples.

This mechanism exists in muO.

In fact it is rather difficult for me to give any specific piece of
advice about how music should be handled in Squeak proper, because my
own way to do this has been to implement a much vaster and deeper
framework where many different perspectives work together. Not to say it
is perfect, but it is thorough - one thing lead to another and I could
talk for hours...


Best,

Stef