Welcome to the new and improved Native Instruments online community. Join our active forum of 40,000+ members for discussions and much more.
stuck on on note

pule_puje
Member Posts: 2 Noise
Hi everybody,
I'm working on a script and I'm kinda stuck on the range of notes played.
on init declare %CMaj[29] := (48,50,52,53,55,57,59,60,62,64,65,67,69,71,72,74,76,77,79,81,83,84,86,88,89,91,93,95,96) declare $key_count on note if($EVENT_NOTE = 36) while ($NOTE_HELD=1) play_note(%CMaj[random(0, 28)]+$key_count, random(10, $Force), 0, -1) if ($key_count # 0 and in_range($EVENT_NOTE, 36, 96)) play_note((%CMaj[random(0, 28)]+$key_count)-12, random(10, $Force), 0, -1) end if wait ($Speed) end while end if end on
$key_count is a counter that increments with different key signatures (C=0, C#=1, D=2, ecc) so that I can randomly play notes within the chosen key signature. My target is that, if the note that comes out of the playnote is over 96 (the limit I've setted for the samples), that note must be played an octave lower, so that it stays within the range. But I can't figure out how to do this. Any help would be really appreciated.
Tagged:
0
Comments
-
random(0, 28)]+$key_count, random(10, $Force)
This should be stored to a variable first, then test that value if it's above 96 and subtract -12 from it if it is.
0
Back To Top
Categories
- 10.6K All Categories
- 20 Welcome
- 442 Hangout
- 58 NI News
- 206 Tech Talks
- 1.1K Native Access
- 4.9K Komplete
- 614 Komplete General
- 1.1K Komplete Kontrol
- 1.8K Kontakt
- 483 Reaktor
- 153 Battery 4
- 268 Guitar Rig & FX
- 204 Massive X & Synths
- 211 Other Software & Hardware
- 2.2K Maschine
- 14 Sampling Room
- 2.6K Traktor
- 2.4K 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