Author Topic: Mod Envelope Causing Crackles?  (Read 2295 times)

Anonimo_Llopi

  • Posts: 8
Mod Envelope Causing Crackles?
« on: 18 Jun '18 - 23:01 »
Hi, so I've noticed crackles on a instrument of the OPL-3 FM 128M soundfont ( https://musical-artifacts.com/artifacts/15 ) (it's specially noticeable in this instrument), first I checked the samples themselves but they were fine, then I started erasing instrument settings until the crackles stopped

Turns out erasing "Mod envelope -> filter (c)" and leaving them blank removes the crackles, so this is probably the culprit


The instrument it's 10 (music box) and the crackles are noticeable starting since C-5 or higher notes

I don't really know wherever it's a bug or the soundfont it's just badly set up because I'm not expert at soundfonts

But here's a comparision between the recording (C-5) of BASS (VMS) and the playing the instrument on the sounfont editor:
On "MIX" I've inverted one of the waves to compare both waves and at 50ms something changes (Probably because Mod envelope delay it's set at 0.050 sec)


Also here's a video comparing a MIDI being played through bass (VMS) and comparing the same MIDI with SampleLord
(I think the video recording made the crackles a bit less audible but once you hear it becomes hard to unhear)
https://www.youtube.com/watch?v=94UhHXg-b5M&feature=youtu.be

I've also tried the same midi on SynthFont and it doesn't produce crackles either with the unedited soundfont

I'm positive I've heard more crackles in other intruments in this soundfont and in other soundfonts too

Edit: I just found a android app with the same crackles when using this soundfont, MIDI clef ( https://play.google.com/store/apps/details?id=it.giccisw.midi&hl=en ), I don't know if MIDI clef uses BASS but the crackles sound exactly the same
« Last Edit: 18 Jun '18 - 23:13 by Anonimo_Llopi »

Ian @ un4seen

  • Administrator
  • Posts: 22959
Re: Mod Envelope Causing Crackles?
« Reply #1 on: 19 Jun '18 - 14:57 »
There does indeed seem to be a little "click" when the filter gets enabled after the mod envelope delay. BASSMIDI tries to prime the filter when enabling it to avoid a click, which works reasonably well in most cases, but apparently not so great in this case. I will check if that can be tweaked and then hopefully get back to you with an update to try.

gicci

  • Posts: 67
Re: Mod Envelope Causing Crackles?
« Reply #2 on: 20 Jun '18 - 02:32 »
Yes, that's my app.
Ian, if you release a test version of the libraries for Android I can include it in a beta version of my app for him to try.

Ian @ un4seen

  • Administrator
  • Posts: 22959
Re: Mod Envelope Causing Crackles?
« Reply #3 on: 20 Jun '18 - 17:15 »
OK, here's an Android BASSMIDI update for you to try:

   www.un4seen.com/stuff/bassmidi-android-test.zip

Let me know if you still hear any problem with that.

Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #4 on: 21 Jun '18 - 00:28 »
Ok, I've been testing the beta on midi clef a bit and you can definetly tell the clicks were reduced, they weren't removed but they are less audible on the opl sf so for now it's a nice improvement
Comparision here (everytime I press solo it makes a crackle so ignore those): https://www.youtube.com/watch?v=bT0uPo3vVZ8&feature=youtu.be

The other soundfont (SYNTHGMS.sf2) I was trying that also had crackles didn't improve at all though (the crackles are even worse than on the opl soundfont) and there's 0 change from the current version as far as I can tell,

I've tried erasing instruments settings (I tried mod envelope first then all the other ones) but it didn't help, this preset actually uses 2 instruments but even erasing everything in both doesn't remove the crackles

the instrument (another music box) that's making crackles it's just a short sine wave sample with lots of volume and mod envelopes, even when leaving those blank it still makes crackles


Maybe there's something wrong with the sample:

But in the soundfont editor and on synthfont there is no crackle so I don't really know what's causing them in this case

I will test more tomorrow (well technically today)
Cheers


Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #5 on: 21 Jun '18 - 00:32 »
Also, here's the soundfont if you want to test it yourself, it came with SynthFont and I quite like it, it seems hard to download standalone so here it is, (it's less than a mb when compressed)

Ian @ un4seen

  • Administrator
  • Posts: 22959
Re: Mod Envelope Causing Crackles?
« Reply #6 on: 21 Jun '18 - 15:18 »
I'm not sure I'm hearing any crackles with that soundfont, so perhaps it depends on the MIDI file that's being played. Please upload the MIDI file that you're testing with. Please also confirm what voice limit is being used (BASS_CONFIG_MIDI_VOICES and/or BASS_ATTRIB_MIDI_VOICES setting), in case that is making a difference. If you're also running Windows, you could also try the pre-compiled MIDITEST.EXE and SYNTH.EXE examples from the Windows BASSMIDI package (C\BIN folder) for comparison.

Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #7 on: 21 Jun '18 - 17:11 »
To be clear I've been testing the crackles on the current version with Coolsoft's Virtual Midi Synth (he is the one that told me to write a post here, og post about this here https://coolsoft.altervista.org/en/forum/thread/666)

And the crackles are audible not only on the midi played on Windows Media Player but also on Virtual Midi Piano Keyboard, I never used BASS MIDI standalone before nor am I a programmer but I managed to get those midi tests programs to run and the crackles are still there (it's WAY more audible if you activate the reverb on synth.exe)

there were 0 changes between the current version and the beta as far as I can tell on this instrument at least (the problem here it's definetly not related to mod evelope), on synthfont/polyphone the instrument sounds different but it doesn't makes a click everytime, the instrument making the crackles is the sine wave (the one called musicbox), if I remove it from the soundfont's preset it doesn't make crackles anymore

Here's a comparision where you can hear the difference, in bass beta (midi clef) and in current (VMS) it makes a click/crackle in every note while in synthfont it's a smooth sine wave: https://www.youtube.com/watch?v=BMe83n-OAdU&feature=youtu.be

Here I use the midi player test program to play the midi with the edited soundfont with just musicbox in the music box preset and I also removed all the settings inside the instrument, so now it's just a simple sinewave and the crackles are more audible this way, later I put the unedited soundfont for comparision: https://www.youtube.com/watch?v=eWyBGjnYacM&feature=youtu.be

I would say that this is a problem of the sample in the soundfont but, because it isn't audible in non bass players I don't know if that's the real problem

I have included the midi and the edited soundfont on the .7z

Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #8 on: 22 Jun '18 - 00:27 »
I have found another instrument on the Synth soundfont with similar issues to the music box on the OPL soundfont:

In this instrument (slap bass 1) in certain notes like F2 or F4 you can hear a crackle, this whole mod envelope crackle issue seems to happen more on certain notes, in this one you can notice the improvement between the beta an the current:
https://www.youtube.com/watch?v=u_KELFDGeeo

The crackles in this one are also removed when mod envelope settings are erased on the instrument so it's the exact same problem with mod envelope, here a screenshot of the settings:
https://i.imgur.com/YxNbtKv.png

Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #9 on: 22 Jun '18 - 01:24 »
I've found out what is the cause of the crackles on the sinewave music box after checking the recordings, BASS seems to increase the volume of the sample the first 0.5 seconds and that sudden change of volume is the "crackle"
https://i.imgur.com/0NjpE9e.png

the sample used it's a completely flat sine wave, I don't know why it's doing that

btw I think slap bass 2 on the synth font also has crackles, but I haven't tested it on the beta yet, I've been testing every single instrument one by one on this soundfont, for now I've checked up to this instrument, I will test more tomorow

Cheers

Ian @ un4seen

  • Administrator
  • Posts: 22959
Re: Mod Envelope Causing Crackles?
« Reply #10 on: 22 Jun '18 - 17:04 »
Here's a BASSMIDI update that I think will help with the SYNTHGMS soundfont:

   www.un4seen.com/stuff/bassmidi.zip

It's a Windows build this time, so you can quickly try it with the pre-compiled examples.

Here I use the midi player test program to play the midi with the edited soundfont with just musicbox in the music box preset and I also removed all the settings inside the instrument, so now it's just a simple sinewave and the crackles are more audible this way, later I put the unedited soundfont for comparision: https://www.youtube.com/watch?v=eWyBGjnYacM&feature=youtu.be

In this case, the click sound is in the instrument's sample data and the removal of the volume envelope's attack phase is making it audible. In the original SYNTHGMS soundfont, the volume envelope's attack phase mutes the click.

Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #11 on: 23 Jun '18 - 01:27 »
Here's a BASSMIDI update that I think will help with the SYNTHGMS soundfont:

   www.un4seen.com/stuff/bassmidi.zip

It's a Windows build this time, so you can quickly try it with the pre-compiled examples.

Here I use the midi player test program to play the midi with the edited soundfont with just musicbox in the music box preset and I also removed all the settings inside the instrument, so now it's just a simple sinewave and the crackles are more audible this way, later I put the unedited soundfont for comparision: https://www.youtube.com/watch?v=eWyBGjnYacM&feature=youtu.be

In this case, the click sound is in the instrument's sample data and the removal of the volume envelope's attack phase is making it audible. In the original SYNTHGMS soundfont, the volume envelope's attack phase mutes the click.

I see, so basically that pointy start that sine wave has it's the "crackle" but on the unedited soundfont it's removed with instruments' config, I was suspecting of that odd start that sample has but because It didn't make a "crackle" on polyphone I was dubious about it.

And for the opl music box it's seems it's not crackly at all now, It's just that the samples/instrument of it have a slight "punch" to it and I mistaked it for a crackle so that was afaik already 100% fixed in the first beta

As for the new version, all right, now that music box from the synth soundfont sounds smooth as silk, nice job

And most other instrumets are fine too, except for some instruments that make slight crackles when played at a note it's not meant to be played, like slap bass 1 playing E3 makes a very slight crackle and at F4 it makes a really audible crackle, but normally a slap bass won't be using a octave as high as 4 so it doesn't really matter

Do you want me to tell you about all the remaining crackles I can find so you can try to fix them or do you want to leave as it is and release a new official version?

Also if you do want me to tell you about crackles I found, how much info do you need, telling the soundfont/instrument and the notes at which the crackle it's audible is enough? (this would be the fastest way to report them) and does it helps you if I also record them into a video? and what about the screenshots? do you want video comparisions between the betas and the current?

Anyway, Thanks for everything you have done so far, and for making BASS MIDI, I probably wouldn't have got into midis at all if it wasn't for BASS MIDI

Cheers

Ian @ un4seen

  • Administrator
  • Posts: 22959
Re: Mod Envelope Causing Crackles?
« Reply #12 on: 26 Jun '18 - 13:49 »
Good to hear that things are generally sounding better now. Here's another update that should help with the SYNTHGMS "slap bass 1" case:

   www.un4seen.com/stuff/bassmidi.zip

Let me know if you still hear any problems.

Anonimo_Llopi

  • Posts: 8
Re: Mod Envelope Causing Crackles?
« Reply #13 on: 28 Jun '18 - 01:03 »
Good to hear that things are generally sounding better now. Here's another update that should help with the SYNTHGMS "slap bass 1" case:

   www.un4seen.com/stuff/bassmidi.zip

Let me know if you still hear any problems.
NICE, I didn't have much time to test but by just hearing it I can't really hear any crackles/clicks in the first 80 instruments

I will test more deeply once I've got the time to do so

Cheers