-
Notifications
You must be signed in to change notification settings - Fork 3
ResidentSf2Synth: Note Velocity #29
Comments
Hi :) I can't find I have a side issue with velocity: when I fire a noteOn, the velocity is not taken into account. outputGain.linearRampToValueAtTime(this.volume * (1 - instrument.volSustain), volDecay); by this line: outputGain.linearRampToValueAtTime(this.volume * (this.velocity / 127) * (1 - instrument.volSustain), volDecay); But I don't know if it's correct. |
1. Note volume level is now related exponentially to NoteOn velocity. 2. Note volume sustain level is now related to the volume level.
Thanks very much for your interest in this code, and for the suggestions! Sorry about the delay, but I've been away. The missing velocityFactorI remember removing the exponential response to velocity again, but forgot to update this issue. I made the response linear again because the quietest volumes are inaudible in Arachno Preset 0 (Grand Piano) when the response is exponential. Nevertheless, I've now made the response exponential again, and the result sounds very similar to my reference Synth (the VirtualMIDISynth). (Listen to the perceived volume of the ppp chords in Study 1, staves 30-33 on both Synths in the Assistant Performer, and to the inaudible GrandPiano velocity 1 in the WebMIDISynthHost).
But the spec also says;
So I suspect that this is not the final answer to this issue. As I said at the top of this thread:
volSustainI think you are right, that the sustain value should be related to the volume level used in the previous line, so I've updated the file accordingly. The AssistantPerformer and the WebMIDISynthHost use different copies of the ResidentSf2Synth. I've updated both to the latest version in this repository. Thanks again for helping to improve this code! |
February 2016:
Currently, note velocity always affects outputGain as follows (in soundFontSynthNote.js):
Account should be taken of parameters (Substitution Generators) defined in the sf2 file.
See sfspec24.pdf §8.1.1, §8.1.2, §8.2.1, §8.4.1 and §8.4.2.
Edit March 2016:
I have now changed the way MIDI velocities are handled:
Gain now changes exponentially with velocity. The above code has changed to
This gets much closer (maybe is identical to?) the way velocity is handled by other online MIDI synths such as the Virtual MIDI Synth and the Microsoft GS Wavetable Synth.
After this change, Study 1 (played on this synth in the Assistant Performer) sounds much more like the original recordings made with capella and Moritz.
See http://james-ingram-act-two.de/compositions/study1/study1.html.
The text was updated successfully, but these errors were encountered: