Link menu items to array
pule_puje
Member Posts: 2 Newcomer
Hi everybody,
I am a newbie on ksp scripting so forgive me if I ask dumb questions. I am working on a kontakt project right now, but I am kinda stuck. I am planning to make a sort of randomizer with musical keys. So my purpose is that when the randomizer is on and a certain key is chosen, only the notes inside that key will play randomly. So I started making a ui_menu including major keys and arrays, each for a specific key. So far I am here:
on init declare %CMaj[22] := (60,62,64,65,67,69,71,72,74,76,77,79,81,83,84,86,88,89,91,93,95,96) declare %GMaj[22] := (60,62,64,66,67,69,71,72,74,76,78,79,81,83,84,86,88,90,91,93,95,96) declare %DMaj[22] := (61,62,64,66,67,69,71,73,74,76,78,79,81,83,85,86,88,90,91,93,95,97) declare %AMaj[22] := (61,62,64,66,68,69,71,73,74,76,78,80,81,83,85,86,88,90,92,93,95,97) declare %EMaj[22] := (61,63,64,66,68,69,71,73,75,76,78,80,81,83,85,87,88,90,92,93,95,97) declare %BMaj[22] := (61,63,64,66,68,70,71,73,75,76,78,80,82,83,85,87,88,90,92,94,95,97) declare ui_menu $Maj_key_menu add_menu_item($Maj_key_menu,"C",0) add_menu_item($Maj_key_menu,"G",1) add_menu_item($Maj_key_menu,"D",2) add_menu_item($Maj_key_menu,"A",3) add_menu_item($Maj_key_menu,"E",4) add_menu_item($Maj_key_menu,"B",5) make_perfview end on on note message($EVENT_NOTE) while ($Maj_key_menu<14 and ($EVENT_NOTE=24)) while ($NOTE_HELD=1) play_note(%CMaj[random(0,22)],10,0,-1) wait(1000000) end while end while end on
is there a way to not repeat the on note part? I am also not so sure that I am doing the array the right way. Sorry for this many questions.
Thanks in advance to whoever will lose their time on this.
Tagged:
0
This discussion has been closed.
Back To Top
Categories
- All Categories
- 19 Welcome
- 1.4K Hangout
- 60 NI News
- 760 Tech Talks
- 4K Native Access
- 16.2K Komplete
- 2K Komplete General
- 4.2K Komplete Kontrol
- 5.6K Kontakt
- 1.6K Reaktor
- 372 Battery 4
- 831 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