Author Topic: Key velocity to attenuation and env (EG2) attack to filter cutoff issue  (Read 2186 times)

MIDAPMI

  • Guest
I uploaded the soundfont called "M-SF2.sf2" to ftp://ftp.un4seen.com/incoming/ this problems is good ideas for you software.

Have 2 issues with this synthetizer. I like. in the last release, you fixed sound of low frequencies samples

One: Is the key velocity to attenuation: in TIMIDITY++ is parameter -V but take static value, in BASS is ignored this and in synthfont and BEATNIK work perfectly. You can fix this?.

Two: attack to filter. (Preset 81) You can see diferences with POLYPHONE and BASS.

Example: with POLYPHONE the sound is 3 second of attack to filter, but i when test with BASS the sound is 500ms of hold to filter.

Beatnik have better synthesis than BASS, you can see my DLS2+ creation of nokia series 40 encrypted on BSB. i not can develop mobile phones soundfonts for BASS without these fixes.

Other optional is of recomendation, but no is critical.

The hold after the note ends.

You need hold 0.013 seconds exactly after note ends (13ms measured on AUDACITY) timidity/synthfont/Fluidsynth have 0.006 aprox, but BASS uses very short. try it and see diferences.

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 21372
One: Is the key velocity to attenuation: in TIMIDITY++ is parameter -V but take static value, in BASS is ignored this and in synthfont and BEATNIK work perfectly. You can fix this?.

I will look into this and then hopefully come back with an update for you to try.

Two: attack to filter. (Preset 81) You can see diferences with POLYPHONE and BASS.

Example: with POLYPHONE the sound is 3 second of attack to filter, but i when test with BASS the sound is 500ms of hold to filter.

Please note that BASSMIDI generally tries to emulate what Creative/Soundblaster hardware does. In this example, Polyphone sounds quite different to that.

MIDAPMI

  • Guest
Thanks ian. very nice software ;)

MIDAPMI

  • Posts: 21
Ian but attack to filter doesn't work well.

in soundblaster/creative also doesn't work well?

is problem because the preset polysynth of Symbian work in all well but on BASS have bug on attack of filter. look please.

Not is difference of sound, the sound is same, the problem is the attack in modulator.

Ian @ un4seen

  • Administrator
  • Posts: 21372
I've attached a recording of the sound from Creative (1st note), BASSMIDI (2nd note) and Polyphone (3rd note). You can see that the filter attack sounds longer in Polyphone than the other 2. My guess is that Polyphone is probably using a different curve for the attack phase.

Here's an update for you to try regarding the key velocity to attenuation modulator:

   www.un4seen.com/stuff/bassmidi.zip

Please note it only supports the negative unipolar concave curve, which is the default and also what's used in your test SF2 file.

MIDAPMI

  • Posts: 21
sorry the annoyance, but how to imitate this on bass. my last problem is this.

Currently i use two layers with decay for emulate attack but attack work only for pitch.

One decay from not filter to filter
and other decay from filter to not filter

and respect with bassmidi.dll no take the velocity to attenuation parameters and launch error sometimes.

im using the default curve (Negative unipolar concarve)
« Last Edit: 27 Sep '18 - 18:59 by MIDAPMI »

Ian @ un4seen

  • Administrator
  • Posts: 21372
sorry the annoyance, but how to imitate this on bass. my last problem is this.

What I can do is add a BASS_MIDI_FontInit flag to use a linear attack phase on the soundfont's modulation envelopes (which appears to be what Polyphone is doing). Here's an update with such an option:

   www.un4seen.com/stuff/bassmidi.zip

This is the new flag to use in BASS_MIDI_FontInit calls:

Code: [Select]
#define BASS_MIDI_FONT_LINATTMOD 0x100000 // linear attack phase in modulation envelopes

and respect with bassmidi.dll no take the velocity to attenuation parameters and launch error sometimes.

There was a bug in the new velocity to attenuation modulator stuff, which should be fixed in the update above, so please try again. If you still get the crashing, please upload a dump file of it. You can generate a dump file using the ProcDump tool. For example, run "procdump -e -ma -x . your.exe". Then ZIP and upload the generated dump file to have a look at here:

   ftp.un4seen.com/incoming/

MIDAPMI

  • Posts: 21
UPDATE!! WORK FINE THANKS IAN i am very happy :)

0% crash
the velocity to EG2 work fine very fine!
and EG2 to attack work fine!
Bass win to fluidsynth now!

I will starting develop some chipfonts of mobile phones for BASS. !very nice!
« Last Edit: 28 Sep '18 - 18:20 by MIDAPMI »

rv

  • Posts: 249
Is this page talking about the same thing?
https://github.com/FluidSynth/fluidsynth/issues/153

MIDAPMI, what is the goal of developing soundfonts for old phones?
Do you have some good SF2 to share with me? :)

MIDAPMI

  • Posts: 21
Have 6 / 2 in progress... Symbian and NGAGE QD, and the 3 rd soundfont is the Series 30 OS Platform, currently created encrypted DLS for beatnik and later will are available for bass.

Here the 3220. work perfect with bass (Updated Exclusive for BASS GM2)

https://musical-artifacts.com/artifacts/600

Here the Series 40 Xpress Music (Beatnik and futher version for bass after ian fix others parameters).

https://musical-artifacts.com/artifacts/562


Here the Series 30 (Created with 6230i sources)

https://musical-artifacts.com/artifacts/495

here the 6230i (Updated for BASS)

https://musical-artifacts.com/artifacts/468

And there the BREW OS PLATFORM DLS. (Incomplete because my grandmother are lost the phone)

https://musical-artifacts.com/artifacts/499

Ian you can hold 13 ms after note ends. beatnik use this and the sound is very smoother than bass, and bass have problem because this parameter make synthbass bad! really, and  you wore with the lastest update! :)

I'll upload a video of what I want to say. wait for me.
« Last Edit: 29 Sep '18 - 01:07 by MIDAPMI »

MIDAPMI

  • Posts: 21

show this

https://youtu.be/Xo2jAcCOYXc

and this is one note 1/8 length 700hz Sinusoide FM sample without release. Played on beatnik and midiplayer

the difference is beatnik have 18 ms more than BASS (Measured from audacity)
« Last Edit: 2 Oct '18 - 06:50 by MIDAPMI »

Ian @ un4seen

  • Administrator
  • Posts: 21372
Is this page talking about the same thing?
https://github.com/FluidSynth/fluidsynth/issues/153

Yes, that is the same thing, but the other way round. In that case, they wanted the modulation envelope's attack phase to be convex instead of linear (to match Creative/Soundblaster), while in this case, MIDAPMI wants it to be linear instead of convex (to match Polyphone). Convex will remain the default in BASSMIDI, but linear is now available via the new BASS_MIDI_FontInit flag.

BASSMIDI currently applies the convex curve to SFZ too, but it looks like it should actually be linear then. Here's an update that corrects that:

   www.un4seen.com/stuff/bassmidi.zip

This update also adds support for a bunch more SFZ opcodes: amplfo_fade, delay, fillfo_fade, pitch_random, pitchlfo_fade, trigger, xfin_hivel, xfin_lovel, xfout_hivel, xfout_lovel, xf_velcurve. Some of those were actually already in last week's update.

Ian you can hold 13 ms after note ends. beatnik use this and the sound is very smoother than bass, and bass have problem because this parameter make synthbass bad! really, and  you wore with the lastest update! :)

Do you mean the volume envelope release phase should be delayed by 13ms after the note off event? If so, that does not sound like a good/logical idea; there's nothing in the spec that says "hold for an extra 13ms". If you are seeing an extra hold with other software then that seems like a bug in that software.

Perhaps you can achieve what you want by increasing the release time?

MIDAPMI

  • Posts: 21
sorry i'm wrong sometimes because my english is not well 100%.

[/quote]

Do you mean the volume envelope release phase should be delayed by 18ms after the note off event? If so, that does not sound like a good/logical idea; there's nothing in the spec that says "hold for an extra 18ms". If you are seeing an extra hold with other software then that seems like a bug in that software.

Perhaps you can achieve what you want by increasing the release time?
[/quote]

yes, delayed by 18 ms after note off (measured with audacity on the screenshot of above)

With increase release time value, only i can get impression of slight reverberation and this is different, not is curve, is only delay after note off.

the sound with beatnik with series 40 mobile sound bank is tiny better. But the same sound it can not get with BASS. because the beatnik delay 18 ms after note off.

here the example. which of the two's you like more or have better note off event in your aspect BASS or Beatnik?

and more below have screenshot of dogos.mid + sf2 converted to mxmf in beatnik, is the secret of good sound of beatnik, in some pages it's called as sound exciter. (MXMF is same to rmi and mod).

this + BASS quality is good :) this is reason which the sound of beatnik win on 3 demos. not is bug is one feature.
« Last Edit: 2 Oct '18 - 06:50 by MIDAPMI »

Ian @ un4seen

  • Administrator
  • Posts: 21372
But if the notes were intended to be released later then surely the MIDI file's author would have delayed the note off events? I don't think it is a good idea to override what the MIDI data says to do, and certainly not by default.

If you want, it is possible to change the time of the note off events. You would use BASS_MIDI_StreamGetEvents to get all of the events, then increase the "tick" values of the MIDI_EVENT_NOTE events that have velocity=0, and then pass the modified event array to BASS_MIDI_StreamCreateEvents. For example, something like this:

Code: [Select]
float ppqn;
BASS_ChannelGetAttribute(midi1, BASS_ATTRIB_MIDI_PPQN, &ppqn); // get PPQN value
int eventc = BASS_MIDI_StreamGetEvents(midi1, -1, 0, NULL); // get number of events
BASS_MIDI_EVENT *events = new BASS_MIDI_EVENT[eventc + 1]; // allocate event array
BASS_MIDI_StreamGetEvents(midi1, -1, 0, events); // get the events
// look for and delay note off events
for (int a = 0; a < eventc; a++) {
if (events[a].event == MIDI_EVENT_NOTE && !HIBYTE(events[a].param)) // found a note off
events[a].tick += 4; // delay by 4 ticks
}
// add end event
events[eventc].event = MIDI_EVENT_END;
events[eventc].tick = BASS_ChannelGetLength(midi1, BASS_POS_MIDI_TICK);
midi2 = BASS_MIDI_StreamCreateEvents(events, (int)ppqn, 0, 0); // create a new stream from the events
delete[] events; // free the event array
BASS_ChannelPlay(midi2, 0); // start playing

One thing to note is that the event array must be in chronological order when passed to BASS_MIDI_StreamGetEvents, so you may need to reorder (sort by tick) the events after delaying the note offs.

MIDAPMI

  • Posts: 21
in beatnik if default, inclusive the fluidsynth synthfont and timidity++ have 9 ms difference than bass by default, beatnik make perfect with 18ms approx.

if no is difficult, ¿you can build with this option enabled for test only? i don't know c++
« Last Edit: 2 Oct '18 - 18:44 by MIDAPMI »

rv

  • Posts: 249
Maybe it depends on the release time of amp enveloppe that has different curve? :)

MIDAPMI

  • Posts: 21
not, in this used the same midi and the same sample in both players. beatnik have 18 ms delayed, if you see above, the sound of both's midi it's more soft on beatnik. inclusive timidity/fluidsynth/synthfont is more soft than bass. BASS uses a instant note off event.

Increasing much release time on preset causes reverb only.

below have screenshot of curve on both players with soundfont of sinusoide wave.
« Last Edit: 3 Oct '18 - 00:24 by MIDAPMI »

MIDAPMI

  • Posts: 21
anything method to cause this?

Ian @ un4seen

  • Administrator
  • Posts: 21372
I just don't like to idea of arbitrarily delaying note-off events. In my opinion, the release phase should begin when the MIDI data says it should. Does Beatnik always delay them or is it optional/configurable? If it always does it then that sounds like a limitation rather than a feature, eg. it could be a result of processing/updating the volume envelope at fairly long intervals. You may happen to like how it sounds in this case but there could be other cases where you don't.

MIDAPMI

  • Posts: 21
i showed the beatnik and bass

is delayed note release.

but you have reason, if is delayed note off event with high BPM midis can be cause problems.

but if is delayed note release event no cause this problem because this running according the BPM.

i tryto change note length and calcule the diffence of note length before release event. wait a few minutes.

a few minutes after calculated note length this is difference of same midi with note length value of 48 (1/8) (tested with midi BPM 120 and BPM 140)


In Beatnik, the note with 48 length is equivalent to length 52 in BASS. and i not know why bass make 3 ms attack in soundfont without attack ¿could be bug?
« Last Edit: 6 Oct '18 - 23:16 by MIDAPMI »

Ian @ un4seen

  • Administrator
  • Posts: 21372
i showed the beatnik and bass

is delayed note release.

but you have reason, if is delayed note off event with high BPM midis can be cause problems.

but if is delayed note release event no cause this problem because this running according the BPM.

I have not tried Beatnik but if my guess is correct that its delayed release is related to its envelope processing interval then the delay will vary depending on the length of the note, ie. it will not always be 18ms. In fact, you've mentioned 13ms and 18ms in this thread :)

You can calculate the expected note duration (until release) like this: ticks / PPQN x 60 / BPM. For example, if PPQN = 120 and BPM = 120, then a 48 tick note should last 0.2s (200ms).

and i not know why bass make 3 ms attack in soundfont without attack ¿could be bug?

BASSMIDI will ramp-in the start, even if the volume envlope has no attack, if the sample data begins with a non-0 value (further from 0 = longer ramp), to prevent a "click" sound. If that does not explain your case, please upload the soundfont (and state the bank/preset number) to have a look at here:

   ftp.un4seen.com/incoming/