Drum Machine that works like an arranger
What i have achieved:
-Instrument that triggers drum sample loops that sync to tempo And end at sample end point
What i WANT to achieve:
-I want the drum loop to play Endlessly untill i press the NOTE it was triggered by or by another note (But it will let the sample Finish before going to the next one)
-If it's possible to make some Notes(FILLS) go back to the main loop after finishing one cycle and some notes(MAIN DRUM Varients)keep going after being triggered
What im trying to replicate:
-Arrangers Accompaniment Drums that you can trigger and they go on and if you want for example to trigger a FILL Drum loop you press another button and then it goes back to the main loop.For example KORG PA 700 .
——THANK YOU SO MUCH FOR ANY HELPI am learning KSP Atm, but i think it will take alot of time,meanwhile i will keep on learning but if anyone can help with this it will be great.
Comments
-
To stop the loop from playing when you hit the note that started it, you need to ignore the event in the release callback. This way, you won't release the event that triggered the loop. You'll need a flag to check if the loop is triggered, and then use
note_off
orignore_event
in the note callback to stop the loop. Here's an example:on init
declare $loop_flag
declare $loop_id
declare const $loop_key := 36
end on on note ignore_event($EVENT_ID) if ($EVENT_NOTE=$loop_key and ($loop_flag=0))
$loop_id := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,0)
end if if ($EVENT_NOTE=$loop_key and ($loop_flag=1))
$loop_flag := -1
fade_out($loop_id,100000,1)
end if end on on release ignore_event($EVENT_ID) if ($EVENT_NOTE=$loop_key and ($loop_flag=0))
$loop_flag := 1
end if if ($EVENT_NOTE=$loop_key and ($loop_flag=-1))
$loop_flag := 0
end if end onThe second part with the fills is a bit trickier. You'll either need to track the timing of the fill to restart the loop after the fill sample plays or use the on listener callback for accurate timing. However, the listener approach can be more complex. A simpler workaround might look like this:
on note
if ($EVENT_NOTE=$fill_id)
fade_out($loop_id,100000,1)
$fill_id := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,0)
wait($DURATION_QUARTER)
fade_out($fill_id,10000,1)
$loop_id := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,0)
end if
end on on release ignore_event($EVENT_ID) end on0
Categories
- All Categories
- 19 Welcome
- 1.4K Hangout
- 60 NI News
- 759 Tech Talks
- 4K Native Access
- 16.2K Komplete
- 2K Komplete General
- 4.2K Komplete Kontrol
- 5.6K Kontakt
- 1.5K Reaktor
- 371 Battery 4
- 830 Guitar Rig & FX
- 423 Massive X & Synths
- 1.2K Other Software & Hardware
- 5.6K Maschine
- 7.1K Traktor
- 7.1K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators