Skip to Content

Popping Sound

18 replies [Last post]
C_Bomb
Offline
Joined: 04/17/2010

My hydrogen has a popping sound when a sound plays...

But when i export the drum loop, then it doesn't have the popping sound...it's irritating compiling a drum loop with the popping sound.

Any ideas why it'll be making this sound?

gabriel
Offline
Joined: 04/17/2010

What OS are you using? What sound driver are you using?

C_Bomb
Offline
Joined: 04/17/2010

I'm using Ubuntu 9.04 Jaunty

Sound card would be Alsa...I never installed a driver

gabriel
Offline
Joined: 04/17/2010

It means that your system is not keeping up with the audio. Possibly because you're using large samples or have a lot of notes playing at once.

Some steps to improve it with ALSA:

Go to Tools -> Preferences -> Audio System. Set the driver to alsa, and set buffer size to 1024 or 2048. UN-check the "create per-instrument outputs." Press OK and give it a try.

FWIW, with JACK you can have more control over latency and load issues.

Hope this helps! (BTW, I'm assuming you're using Hydrogen 0.9.4)

sireasoning
Offline
Joined: 04/17/2010

I am having the same problem and am using jack with a high buffer, etc. Here is the issue. If I want to try and create a drum rhythm via MIDI at some point one or more of the individual instruments in the library will get a "popping" noise extension at the end of the sampled note. This extension will actually clip at 20k of a 30 band EQ and it appears at each step below that in downward sloping pattern till around 200 or so.

This popping extension will play on that instrument, even if it is the only note being hit once it has attached. One can play the wave file associated with that instrument through hydrogen (via edit layer) without the trailing popping attachment.

If I then save the recorded pattern (with some instruments having the trailing popping) and close and then reopen hydrogen, the popping extension disappears, even after reloading the saved pattern.

This problem makes it very difficult to use hydrogen in live settings and very frustrating to use in a studio setting.

I am using a compiled hydrogen 0.9.5-svn1568 but I also had this problem (with a lot of instability) with 0.9.4 Ubuntu Karmic version.

I am also running a compiled jack 1.9.5 and ffado-2.0-svn

gabriel
Offline
Joined: 04/17/2010

SI Reasoning: can you provide an audio sample of the popping noise? Bonus points if you can also provide some kind of MIDI stream that will recreate it. :-)

sireasoning
Offline
Joined: 04/17/2010

how would I be able to record the MIDI stream?

gabriel
Offline
Joined: 04/17/2010

Might be able to do something with arecordmidi/aplaymidi. Maybe use a different sequencer. But like I said... it's just bonus points. It's over and above the call of duty. :-)

sireasoning
Offline
Joined: 04/17/2010

This was way too easy to do, as a matter of fact, I got a popping noise on one instrument loaded up on first load, so even a fresh loading does not always remove the popping sound.

I recorded 4 instruments from the default drum library. The first 3 have a trailing pop, while the fourth (snare rock) was added as a clean example. It was recorded as a loop and played twice.
If you can give me step-by-step instructions on the midi recording I can try that too, but it has been pretty trivial for me to reproduce it, I don't even have to do anything sometimes.

sireasoning
Offline
Joined: 04/17/2010

Here is the same loop (except I made it longer so that you could hear the delayed pop on the last item.)

Notice that the pop extension has moved around and is now on the "kick" and "snare rock" with the other 2 clean.

The only thing I did differently is that I loaded several different drum kits (where the popping would be attached to some instruments in an equally random pattern) and then reloaded the original default GMkit.

wolke
wolke's picture
Offline
Joined: 03/30/2010

hi,
bd and snare samples from gmkit are popping free.i mean there is no dc offset at the sample end. imo, in your example we can hear offset popping.
i think your problem is an error if hydrogen load the files from disk into ram.
i study your wav file. do you record the output with external audio hardware?
because the popping you have record looks like a typical dc popping if the audio signal run true a couple condenser. this will remove all dc offset and only display the point if dc offset will go to zero(normally at sample end).

to create a driver and hardware independent example file, you can make a export by using the hydrogen audio export function (file->export song).

if you get popping results via export song, the error is audio driver independent. and if you study the audio curve(audacity), the popping have to looks different against your last example. more like a ramp.

question.
did you get the poppings also if you load wav based samples? gmkit is based on flac files.
if not, install the newest libflac.

it is possible that the 9.04 Jaunty libflac do not collaborate correct with hydrogen.

sireasoning
Offline
Joined: 04/17/2010

I used jack2 to record the sounds from hydrogen to rezound.... but the sounds are there if I use hydrogen from a midi source also.

As I mentioned earlier in this thread, if I ave the project and bring it back up, then the popping extensions are gone from where they were. However, sometimes they will just pop up elsewhere.

I also mentioned that I can play the sampled file from within hydrogen without having the popping attachment. I may compile libflac to the latest version and see if that makes a difference, but I am skeptical because they do sound clean when I play the file cleanly using the edit layer feature. I had assumed it was a wav file with the standard drum in my previous description.

I have tried almost every other drumkit available on your site and have problems with all of them. I am uncertain if any of them use wav or not.

gabriel
Offline
Joined: 04/17/2010

I can recreate the issue with the 0.9.4 branch of Hydrogen. In order to recreate the issue, you have to do something to cause a resample. Steps to recreate:

* Start jack (48kHz)
* Start Hydrogen with the stock GMkit (note that samples are 44.1kHz)
* Go to prefs and select "Ignore Note Off"
* Pick an instrument and set "random pitch" to a high value
* Play that instrument over MIDI. Sometimes get a pop at the end.

It might work locally, I only tried over MIDI. I couldn't get it to happen when "Random Pitch" was set to zero.

Hypothesis: The pop looks and sounds like it's a single sample (maybe two) with a value of about .25 to .5 (or -.25 to -.5). This indicates some manner of off-by-one noise at the end of the sample. My guess is that there's an error in the resampling code (Sampler::__render_note_resample()).

SI Reasoning: Can you retry with a system sample rate of 44.1kHz and confirm that "Random Pitch" is off for all your instruments?

sireasoning
Offline
Joined: 04/17/2010

I set jack to 44.1k and confirmed random pitch is off for all instruments and had no noticeable issues. I even loaded several other kits without issue.

jack at 48k causes hydrogen to crash when I start trying to play via the midi keyboard.

jack at 96k is what I have had it on previously with the same results that I previously had.

My guess is that the problem is when jack is at a different khz setting than hydrogen's kit samples.

gabriel
Offline
Joined: 04/17/2010

FYI, I'm trying to isolate this bug, but haven't had much time to work on it.

wolke
wolke's picture
Offline
Joined: 03/30/2010

@gabriel.
i think we have still problems with the linear interpolation.
in change set http://trac.assembla.com/hydrogen/changeset/1253 i have change the precision from float to double. maybe this is not enough to fix all resample popping sond problems. before this changes, tests with long sinus samples, produce klicks and popping in samplerate dependent intervals if hydrogen resample a sample. after changing to double this problem was done.

in moment i can reproduce significant pops and clicks on all samples (format independent) if they ends really short without a silent on sample end.

also i can detect not nice results on clippings into samples. clippings produce also noises if hydrogen resample this samples . and here not necessarily at sample end.

for testing this i use 96khz sample rate.

i think the linear interpolation algorithms is a bit to simple on this place. but he is really fast.
short latency as possible is very important in resample process. else you can not play drums.

gabriel
Offline
Joined: 04/17/2010

All: I think I have found the bug. (At least, I've found *a* bug, and I think it's causing this problem.) Please update to Rev 1616 of the branches/0.9.4 and see if it still happens.

The patch is a 2-line patch, so it's trivial for someone (wolke) to check and apply this to trunk.

wolke
wolke's picture
Offline
Joined: 03/30/2010

hihi,
i also found the same problem. linear interpolation between the last frame and and a zero value makes no sense. because we have reach the sample end (the last frame) we try to interpolate this with a not existing value. that produce a wrong ghost value.

my patch remove the interpolation in this case and set the last frame to zero by default.
fVal_L = 0.0;
fVal_R = 0.0;

edit:
peculiar, your commit produce no notification mail.

gabriel
Offline
Joined: 04/17/2010

Hi wolke,

Yeah, that works, too. However, linear interpolation does make sense because after the end of the sample... all of the samples that follow are assumed to be zero. The code was trying to make sure we come down to zero sensibly (in case the envelope or the resample left us with something non-zero at the end). But, I won't argue that 1 or 2 samples makes much difference, especially since most samples already have zero-crossovers at the end. I'll let your ear be the judge. :-)

BTW, I did get the assembla e-mail for the commit.

Peace,
Gabriel