Ripple effect sound when releasing sustain pedal
Started by johnbeatle




11 posts in this topic
johnbeatle

6 posts 2 threads Joined: May 2021
15-05-21, 05:20 -
#1
Hi Hans and fellow samplerbox users, great to be here! Just a quick note regarding an issue I've noticed when using my midi keyboard with it's sustain pedal.
I'm using an Alesis q88 keyboard in USB mode through a RP3B+. I am using your samplerbox image and piano samples. Happy to say that all works out of the box, but I've notice an issue when I'm playing a chord of say 5 notes. Whilst the sustain pedal is pressed, it works and a lovely sound it makes! but when i release the pedal, I hear a rippling sound effect of the chord which lasts for about 2 seconds. 

I've attached a sample of the issue. Please note, I had to zip the mp3 sample as it wouldn't let me attach a mp3 or wav file. 

I can reproduce this issue with both the in built sound and my external USB audio interface. The issue is repeatable also - I have tried restarting the pi etc.  Any ideas what the issue could be?
This post was last modified: 15-05-21, 09:38 by johnbeatle.


Attached Files
.zip   sustain.zip (Size: 33.32 KB / Downloads: 3)
hansehv

168 posts 17 threads Joined: Dec 2020
15-05-21, 21:25 -
#2
Hi John,
Thanks for your kind words.
Alas I couldn't read the mp3 (missed header?), but I think I reproduced what you heard.
I played several chords while keeping the pedal pressed, then released and heard the famous "clicks and plops" for which you invented the nicer term "ripple" - I'll add that to the clicks & plops FAQ (thanks and please also read that for another explanation of your problem).

What happens: the release keeps the sounds of all previous notes alive - so when using chords, a multiple of the notes.
When you release a CPU intensive process of reducing the volume of all these sounds starts in the sound module. This module works in a time slot and if the CPU can't chew all the work within that slot, then this can happen.
In my test (which I hope represents your situation) I noticed the CPU peaking in parallel with the "ripple".
So it's not so much a bug as you stated in your separate mail, but rather a limit.

If you intend to use sustain pedal in this way, you may avoid it by lowering the MAX_POLYPHONY in the configuration.txt.

I never tested this before as in my opinion playing with sustain pedal pressed over a longer period isn't a realistic way of playing as the sound gets messy - but your mileage may vary ofcourse.
If you want get a "non damped room" effect, I suggest to experiment with the reverb - this is quite powerful.
This post was last modified: 15-05-21, 21:27 by hansehv.
johnbeatle

6 posts 2 threads Joined: May 2021
15-05-21, 21:40 -
#3
Hi Hans, thanks for the reply. Please rename the file extension from mp3 to ogg. Should work Smile.  if it's a known issue I'll try reducing the max poly and see what happens. By the way, a separate question. There is a button on the alesis q88 keyboard called advance. How could this be programmed for use as a toggle for the voices so piano on 0, harp on 1 etc? Ive got all the samples on your download page on my SD card.  Just increased the partition size in gparted after mounting it RW. 16gb class10 SD.
This post was last modified: 19-05-21, 21:23 by johnbeatle.
hansehv

168 posts 17 threads Joined: Dec 2020
15-05-21, 22:24 -
#4
(15-05-21, 21:40)johnbeatle Wrote: Please rename the file extension from mp3 to ogg. Should work Smile.  if it's a known issue I'll try reducing the max poly and see what happens. By the way, a separate question. There is a button on the alesis q88 keyboard called advance. How could this be programmed for use as a toggle for the voices so piano on 0, harp on 1 etc?
Worked indeed  Cool
Also proved you were using continuously pressed sustain obtaining an effect that can be achieved without running into CPU constraints and (imho) with a nicer and adaptable effect character via reverb - just try & experiment with the parameters.

As for the q88 operation: just read the q88 manual as it has standard program change as supported by samplerbox:
Code:
Incremental/Decremental Program Change:
1. Press the Advanced button.
2. Press the black key labeled "PROGRAM" (F#2).
3. Now the Octave “+” and “-” keys can be used to change the program.
4. Press “+” and continue to play notes until you find the instrument you want.
Other midi controls are available as well if I understood correctly after my quick glance - but I'm not an Alesis support engineer  Tongue
Anyway: have fun !
This post was last modified: 15-05-21, 22:25 by hansehv.
hansehv

168 posts 17 threads Joined: Dec 2020
16-05-21, 12:47 -
#5
Hi John,
After some more thinking:
If you're looking for a way to have the sound less 'thin' (=having more resonance sound from the instruments body), you could also consider changing (=adding) the %retrigger parameter to "Y".
Perhaps I should add that to the grandpiano sample - please feedback your opinion / finding.
Hans
johnbeatle

6 posts 2 threads Joined: May 2021
17-05-21, 10:52 -
#6
(16-05-21, 12:47)hansehv Wrote: Hi Hans, thank you so much for looking into this issue.  Just to let you know, reducing the max poly has not fixed the issue. I tried reducing it to as low as 40, without success.

I want to use this setup as a simple stage piano. Your variant of samplerbox works perfect for me apart from that sustain issue.

I've done a bit more research around the sustain issue. The ripple effect only happens if the pedal is pressed down for circa 10seconds. Anything under that, the issue doesn't manifest itself. I found that taking the pedal off 5 seconds into a lead piano break and then back on reduces occurences of this ripple effect happening.

Why do i need the sustain on the pedal? 

I don't need it for all of the songs i perform, but if you think of a song like "Let it Be" that little piano run before the guitar solo is a must for the sustain pedal...and it works beautifully until i take the foot off the pedal!

If this is only happening when pedal is pressed for circa 10 seconds, it is as you say, a CPU or memory issue?.
Hans, is there any way in software to clear the memory buffer if it detects a long sustain keypress?  It would probably take a few mS to clear in memory and generate a click in the process but still, thats better than a rippling sound! 
This post was last modified: 19-05-21, 21:25 by johnbeatle.
hansehv

168 posts 17 threads Joined: Dec 2020
Bug  17-05-21, 21:55 -
#7
Hi John,
Your "let it be" example (remains a good song..) led me to the root cause.
When having the sustain pedal pressed, notes keep piling up when replayed (you may have noticed an unwanted volume increase).
This ends up in too many (same) notes to be damped when releasing the pedal.
So CPU surely is a factor, but it's significantly increased by missing housekeeping = a bug which also caused artificial volume increase.
I'll investigate what I can do about that and keep you posted.
For now thanks for reporting!
This post was last modified: 17-05-21, 22:15 by hansehv.
johnbeatle

6 posts 2 threads Joined: May 2021
18-05-21, 11:45 -
#8
(17-05-21, 21:55)hansehv Wrote: Hi John,
Your "let it be" example (remains a good song..) led me to the root cause.
When having the sustain pedal pressed, notes keep piling up when replayed (you may have noticed an unwanted volume increase).
This ends up in too many (same) notes to be damped when releasing the pedal.
So CPU surely is a factor, but it's significantly increased by missing housekeeping = a bug which also caused artificial volume increase.
I'll investigate what I can do about that and keep you posted.
For now thanks for reporting!

******
Thank you Hans! and again appreciate your time and effort to fix.

I didn't want to complicate matters further, but i have tried

Incremental/Decremental Program Change:
1. Press the Advanced button.
2. Press the black key labeled "PROGRAM" (F#2).
3. Now the Octave “+” and “-” keys can be used to change the program.
4. Press “+” and continue to play notes until you find the instrument you want.


Unfortuantely, the process above kills the sound output all together. It's seems like the program gets into a locked state that only a reboot can fix. I did also try the Advanced > "Transpose (F#) key > +    This also kills the sound output all together.  Hope that feedback is useful?
hansehv

168 posts 17 threads Joined: Dec 2020
19-05-21, 21:04 -
#9
Hi John,
I found a solution and could sneak it in the release I'm preparing, so you can download it quite soon.
If you can't wait, the fix is here. The line numbers will differ as it it's in the new version, but it can applied to your version too.

It's very well possible that you switched to an empty preset and lost track of where you were in the preset numbering. I know this happens easily  Rolleyes
It may help to use the gui to see the status of the box / what preset was requested by you when trying.
Furthermore you can debug your instruments output with the midimon as well as see samplerbox reactions via commandline (refer to the docs for both remarks).
It may be a hard message: stating that you pushed buttons and the samplerbox seems to stop is not useful. If the box gets proper input it works - it does for years for many people.
Bottom line: configuring local setup is local DIY.
hansehv

168 posts 17 threads Joined: Dec 2020
19-05-21, 23:00 -
#10
(19-05-21, 21:04)hansehv Wrote: Bottom line: configuring local setup is local DIY.

But if you have gathered some more info and still stuck, remote help is usually possible.
It isn't always that easy...