@pianopaul I’ve now given your original script to the AI and told it to modify it for three tones. After a few attempts, it got it done. Amazing! But it didn’t stop at simply duplicating the delay command.
var
d : Discrete Parameter “1/16”, “1/8”, “1/4” = “1/16”
l : Discrete Parameter “1/32”, “1/16”, “1/8”, “1/4” = “1/16”
delay : double
duration : double
// Wir erstellen frische Echos
m_echo1 : NoteMessage
m_echo2 : NoteMessage
// Scriptlets brauchen KEIN “from MIDI_BLOCK” am Ende!
On NoteOnEvent(m : NoteMessage) matching [C4..B4]
Select
d == “1/16” do delay = 60000.0 / GetBPM() / 4
d == “1/8” do delay = 60000.0 / GetBPM() / 2
d == “1/4” do delay = 60000.0 / GetBPM()
End
Select
l == “1/32” do duration = 60000.0 / GetBPM() / 8
l == “1/16” do duration = 60000.0 / GetBPM() / 4
l == “1/8” do duration = 60000.0 / GetBPM() / 2
l == “1/4” do duration = 60000.0 / GetBPM()
End
// Klone erzeugen
m_echo1 = MakeNoteMessageEx(GetNoteNumber(m), GetVelocity(m), GetChannel(m))
m_echo2 = MakeNoteMessageEx(GetNoteNumber(m), GetVelocity(m), GetChannel(m))
// — 1. TON (Sofort) —
SendNow(m)
SendLater(MakeNoteOffMessage(GetNoteNumber(m), 0), duration)
// — 2. TON (Erste Wiederholung) —
SendLater(m_echo1, delay)
SendLater(MakeNoteOffMessage(GetNoteNumber(m_echo1), 0), delay + duration)
// — 3. TON (Zweite Wiederholung) —
SendLater(m_echo2, delay * 2.0)
SendLater(MakeNoteOffMessage(GetNoteNumber(m_echo2), 0), (delay * 2.0) + duration)
End