Progress on fluidsynth - first questions to consider regarding note crescendo

Posted 7 years ago

Good news everyone,
today I discovered that MuseScore's internal variant of fluidsynth supports midi CC11 (aka expression pedal). I did this by adding this line to mscore/musescore.cpp:

 void MuseScore::midiCtrlReceived(int controller, int value)
       {
       seq->setController(0, controller, value);
       if (!midiinEnabled())
             return;
       ...

Now every midi CC gets send to the synth (on channel one - have a look at the implementation). I played around a bit with KORG nanoPad and could change sound's volume via CC11 on during a note.

I wasn't sure if fluidsynth had been incorporated into MuseScore before this feature was added. But now I know for sure! So the next step is "just" adding something to libmscore/rendermidi.cpp. But before this can be done some aspects have to be considered!

I had a nice little discussion with jeetee and Jojo-Schmitz on IRC about when to use this feature - crescendo on one note doesn't make sense for a grand piano for example! I thought it would maybe be nice to add information to instruments.xml - on the other hand it makes sense to use already defined categories in instruments.xml. Instruments that should definitely have this feature are wind instruments, bowed instruments, voice and some organs (which have a swell pedal). Than there were instruments we were not so sure about - mainly electronic instruments like e-guitars and electronic keyboards. In my opinion a guitarist would normally not use a volume pedal if he or she reads a crescendo - but I might be wrong. Furthermore I'm not sure if CC11 should be used for all crescendos or if should just used during a note (and velocity for changes between different notes). Also jeetee said it would make sense for drum rolls - but I think if you have actually separate events for the drum roll using velocity makes more sense (if the roll is a looped sample using CC11 seams reasonable of course!). Last but not least there are instruments that would probably not use CC11 (and thus should have this feature disabled by default) like grand piano, plucked instruments, percussion and so on.

Next thing to consider is - how many (or better in which frequency) do we need these messages? I think it will depend on how drastic the change is and how fast it shall change. It might be different for different synthesizers (hopefully not to different for different instruments or soundfonts?). That is something that needs to be investigated in the next days. Other question if it should be "curved" or flat.

Let me know your thoughts!


Comments

Hello.

Thanks for doing that.
Regarding crescendo on one note: it's possible for electric guitars/violins/keyboards and other instruments with volume knob (no pedal needed). This knob is not always staying in one position. For example it allows to create more dynamic solos, so we definitely need crescendo.

I don't think we should prohibit adding crescendo to piano and other instruments that don't physically allow to do that. In the era of electronic music user could create any composition. Crescendo can mean fade-in or fade-out for electronic music. It could mean getting closer to an instrument for 3D-music (see SSMN project https://blog.zhdk.ch/ssmn/faq/).

There is a very simple example of adding MIDI Events for the smooth change of pitch in my bend playback implementation: https://github.com/musescore/MuseScore/blob/master/libmscore/rendermidi…

Keep in mind that not all external synthesizers support Expression events.

I was working on Jack and MIDI support in MuseScore while participating GSoC 2014/15, feel free to ask me if you have any questions.

Hi @hpfmn, I'm another GSoC student.

I agree with your original analysis: volume should only be adjustable during a note for instruments where this is physically possible in real life. At least that should be the default - of course the user should be able to override the default setting to create something more modern as @igevorse suggested.

I also agree that electronic instruments are in a grey area, but I think that means either choice is acceptable so it's not something you need to worry too much about. The decision probably rests on how realistic the keyboard or guitar sound is attempting to be - it should probably be enabled by default only for more stylised instruments.

In terms of how little or how much to change the volume, for hairpins the change during a note should be the same as the change between notes. However, if a note has a gate time less than 100% (if it gets cut off sooner than its value appears to indicate - e.g. staccato notes have ~50% gate time) then the dynamic change should also be gated. So, during a legato crescendo each note begins at the same volume as the previous note ended, but during a staccato crescendo each note would begin at a higher volume than the previous one ended.

Regarding electric guitar, there is a technique (called violining I think) where the attack is taken off the plucked note either with the volume knob (hence it's position on a Strat) or a volume pedal.

Whether this means CC#11 should be enabled by default though is debatable. The option to enable it for electric guitar should be there, however.

Most professional synth players would have an Expression pedal somewhere in their setup - I used to have two when I was gigging with a band - one for each keyboard - some sounds having velocity disabled on them such as Hammond organs etc where velocity was inappropriate other than to perhaps invoke a velocity split for percussion sounds. So, again, the option for CC#11 should be there for all synth sounds.

Pianos, celestas, vibraphones, acoustic guitars, harps and other instruments that are struck or plucked and so use velocity as a volume control should not, in my view, be able to enable CC#11, apart from electric versions (eg the Rhodes piano) which would have a volume control.

Regarding the speed of change that will vary considerably depending on what is required. IMO there should be three parameters passed to the (de)crescendo routine - start volume, end volume and the number of bars, beats and ticks between the two, possibly with the option to express this either numerically as above or in conventional rhythm notation.

HTH