More than 16 custom event parameters
Currently, you can have only up to 16 values stored with $EVENT_PAR_CUSTOM. Unfortunately, my program is really complicated and needs probably double that for most events. I need the parameters so that I can communicate a lot of information between the NCB and the LCB (a lot of weird per-voice modulation stuff). I'm essentially trying to create a C struct for events... I can't do something with polyphonic variables (which are only visible in NCB/RCB anyways) because there will be many independent events fired within a single NCB call. The best solution I can come up with is as follows:
on init declare polyphonic $new_id declare polyphonic $tmp_idx define MAX_VOICES := 500 declare %EVENT_PAR_CUSTOM_16[MAX_VOICES] := (0) declare %EVENT_PAR_CUSTOM_17[MAX_VOICES] := (0) declare %EVENT_PAR_CUSTOM_18[MAX_VOICES] := (0) ... declare %EVENT_PAR_CUSTOM_50[MAX_VOICES] := (0) end on on note ignore_event(EVENT_ID) new_id := play_note(...) // Note that next available spot will be the same in all arrays, so im just using CUSTOM_16. tmp_idx := next available spot in %EVENT_PAR_CUSTOM_16 set_event_par_arr(new_id, EVENT_PAR_CUSTOM, tmp_idx, 0) EVENT_PAR_CUSTOM_16[tmp_idx] := something EVENT_PAR_CUSTOM_17[tmp_idx] := something EVENT_PAR_CUSTOM_18[tmp_idx] := something ... EVENT_PAR_CUSTOM_50[tmp_idx] := something end on on listener if EVENT_PAR_CUSTOM_35[get_event_par_arr(some_event_id, EVENT_PAR_CUSTOM, 0)] = something // do something end if end on
Has anyone ever done this before? Any ideas for a more elegant/efficient solution? Thanks 😵
Comments
-
Yeah the only way to do this if 16 event pars is not enough is to have your own data structures to handle additional parameters with.
1
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 785 Tech Talks
- 4.1K Native Access
- 16.6K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 379 Battery 4
- 845 Guitar Rig & FX
- 429 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.3K Traktor
- 7.3K 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