|
From: Mark K. <mar...@co...> - 2003-10-27 15:34:09
|
On Mon, 2003-10-27 at 02:52, be...@ga... wrote: > Hi, > I was wondering what's the correct way to handle the sustain pedal when > implementing a MIDI sound generating module. In my experience it is implementation dependent. There is no 'right' or 'wrong' way to handle it. Different synths do this differently, and it depends on what you are going to use them for. See below... I think the term to use in this discussion is 'retrigger'. > > from the MIDI specs: > ----------- > Hold Pedal, controller number: 64: > When on, this holds (ie, sustains) notes that are playing, even if the musician > releases the notes. (ie, The Note Off effect is postponed until the musician > switches the Hold Pedal off). If a MultiTimbral device, then each Part usually > has its own Hold Pedal setting. > Note: When on, this also postpones any All Notes Off controller message on the > same channel. > Value Range: 0 (to 63) is off. 127 (to 64) is on. > -------------- > > My question is about ".... holds (ie, sustains) notes that are playing, even if > the musician releases the notes." > > Assume I play a chord, press the hold pedal, which causes the notes to be > sustained. When I play new notes those are sustained too. > So far so good. > The question arises when I press the same key two times. > Assume no sustain pedal for now. > When I press C2 I hear the note. When I release it the sound does not vanish > immediately but takes a small amout of time to decay due to the release > envelope. If after releasing C2 I immediately press C2 again I hear two C2 notes > for a brief time. > > Now same situation as above but with the sustain pedal pressed. > You hear the first C2, release it (the corresponding note-off is postponed) and > then press C2 again. > In that case is it correct that you must hear two sustained C2 notes. > Or must the first C2 be forced to get faded out / muted ? > If not (eg you hear two sustained C2 notes), how far can this go ? > Can there be 3, 4 etc sustained notes on the same key too ? In GSt there are multiple sustained notes using the same sample. You can see it in the voice usage info. Hit the first C2 (with sustain pedal down) and voice count goes to 2.(Stereo library) Let go and wait the FULL length of the sample with the sustain pedal down and *eventually* the voice count goes back to 0. (After the sample length of 30 seconds on the Bardstown piano.) Now, push sustain, hit C2, voice count = 2, release, voice count still = 2, push C2 again, voice count = 4, release, still = 4, push C2 again, voice count = 6, release, still 6. This can go as far as you let it. In GSt96 it can go to 96 voices. (And it can crash GSt too!) ;-) This will build up for roughly 30 seconds. At that point the sample from the very first key press runs out, and voice count reduces by 2, then 2 again, then 2 again as each key press runs out. > > While I am not a piano player,common sense says me thatpiano has only one string > per key so IMHO it would sound unnatural to play two > notes on the same key. Yes, for a piano it would see unnatural. However, the keyboard you are pressing has to work for all instruments, not just piano... Let's consider trumpets. Is the sample library which is mapped to the keyboard representing one trumpet player? Or is it representing as many trumpet players as you need. Often I will score 3-5 trumpet (or sax, trombone, etc.) tracks and send all of them on the same MIDI channel. By setting the dynamics and timing of each track a bit differently I get something that sounds more like a real horn section: MIDI Track 1 - C2-velocity=85 MIDI Track 2 - C2-velocity=65, delay 5mS MIDI Track 3 - C2-velocity=75, delay 13mS If you didn't like me doing this (for whatever reason) then I could place the same library on different MIDI channels in LinuxSampler, but that would likely require you to load the same samples into memory and that's a bit of a waste. The above technique works even better when you use different libraries for each track, so that the trumpet samples sound even more different, but works fine with a single library. The orchestral guys use a single library, like Garritan's string stuff, but score 20-30 tracks of violins building up the sound of an orchestra. (Or so I'm told!) ;-) > > As you might have guessed I ask this stuff because we want to add > support of sustain in linuxsampler. I might have guessed! ;-) > > thanks for your infos. You're welcome. > > PS: a new CVS repository for linuxsampler is up: cvs.linuxsampler.org > interested developers and users please check it out and give us feedback > via mailing list. Cool! Will do! - Mark |