Sustain note until other note is played

So I’m trying to duplicate the sound of Coldplay - Viva la Vida, where the staccato strings run on top of a choir.
I want to play the staccato and choir chords by one finger which is no problem, but I want to trigger the choir chords on the first note Bb only and make it sustain without retriggering while I play the rythmic staccato part, until I play the next note C. Then the Bb choir chord should stop and the C choir chord sustains until the next note, and so forth.
I guess I should be working with note on/off settings, but I’m not sure how.
Any ideas? :slight_smile:

Use this, it is very simple with scripting

var
  HAMMOND : MidiInBlock
  Sustainer : AutoSustainer
  
 
Initialization
 AutoSustainer_SetTarget(Sustainer, HAMMOND)
end
  

on NoteOnEvent(m : NoteMessage) matching [C3..E3] from HAMMOND
  AutoSustainer_Stop(Sustainer)
  AutoSustainer_Play(Sustainer, m)
  AutoSustainer_Play(Sustainer,m.Transpose(4))
  AutoSustainer_Play(Sustainer,m.Transpose(7))
end

on NoteOnEvent(m : NoteMessage) matching B2 from HAMMOND
  AutoSustainer_Stop(Sustainer)
end

When you press a note between C3 and E3 a major chord is played.
When you press B2 then the previous played chord is stopped.

2 Likes

It’s definitely a step in the right direction, thanks!
I was thinking to layer the staccato and choir on the same keys. Won’t the choir retrigger together with the staccato when I play the staccato rhythmic part? There’s a slight glide in the beginning of the choir sound that will repeat for each time a press that key, and that’s what I’m hoping to avoid by having it trigger only on the first press of the key, and then sustain and ignore further presses of that key. When I press the next key the sustain stops and a new chord is triggered. And so on.
Is this doable…?

For my understanding:
You press C3 => C-Chord should be triggered and sustained.
You Press D3 => previous played chord should stop and the new D-Chord should played and sustained.
You Press D3 again => previous played chord should remain sustained and not triggered again.

Is that correct?

Spot on!

Try this:

var
  HAMMOND : MidiInBlock
  Sustainer : AutoSustainer
  v_played : integer
  
 
Initialization
 AutoSustainer_SetTarget(Sustainer, HAMMOND)
 v_played = C-1
end
  

on NoteOnEvent(m : NoteMessage) matching [C3..E3] from HAMMOND
  if v_played != GetNoteNumber(m) then
   AutoSustainer_Stop(Sustainer)
   AutoSustainer_Play(Sustainer, m)
   AutoSustainer_Play(Sustainer,m.Transpose(4))
   AutoSustainer_Play(Sustainer,m.Transpose(7))
   v_played = GetNoteNumber(m)
  end 
end

on NoteOnEvent(m : NoteMessage) matching B2 from HAMMOND
  AutoSustainer_Stop(Sustainer)
end
4 Likes

Brilliant! Will try!

I like both the idea and the scripting. Great :+1:

Can this script be changed to sustain C4 note and use the same note later to switch it off?

Just replace B2 by C4 and the press of C4 will stop sustaining notes.

Or do you want this:

Press C4 and C4 is playing forever.
Press C4 again and it is stopped?

Yes I want to do this
Press C4 and C4 is playing forever.
Press C4 again and it is stopped

Thanks paul

1 Like

No script necessary at all

2 Likes

Works but there is 1/2 second delay when first hitting the note to when it sounds.

More exactly, when hitting a note on your MIDI controller or when clicking on the widget?

What buffer size in the audio options?
How far are the loudspeakers located ?

Thinks I may learned the button wrong
Trying again later cheers

Did you learn Note Off?

No , I got it mixed up but I got it working correctly now
Thanks paul

2 Likes