Edit Values

Is it possible to make a control remember a value and return automatically?
For example:
If (%CC[3] = 0)
Change values like these
$switch_1 := 1
$knob_1 := 6
$value_edit_1 := 87
And if (%CC[3] = 1)
All values return to 0 to edit again and do the same with (%CC[3] = 2) etc.
But when returning to (%CC[3] = 0)
Return the values as they were then.
Comments
-
It is possible.
It is a matter of managing storage of data in case you need to retrieve them later.
I say in case because you said "All values return to 0 to edit again" which is not clear why they would need to go to zero.
Still think that, as you presented, in the condition %CC[3] = 0 evaluating to true, you would need to retrieve 3 values, one for swtich_1, one for knob_1 and one for value_edit_1. So you need a way to store these 3 values neatly together. And you need 3 more for the condition %CC[3] = 1 and so on.
So you need 3 (values) times however many conditions you have. Let's say you have 3 conditions.
To store values together you usually use an array. In this case:
declare %skv_values [9]
%skv_values [0] := 1
%skv_values [1] := 6
%skv_values [2] := 87
%skv_values [3] := 0
%skv_values [4] := 7
%skv_values [5] := 89
{ ficticious values, for the sake of the example }
then later you would use, I believe in the controller callback:
if (%cc[3] = 0)
$switch_1 := %skv_values [0]
$knob_1 := %skv_values [1]
$value_edit_1 := %skv_values [2]
end if
if (%cc[3] = 1)
$switch_1 := %skv_values [3]
$knob_1 := %skv_values [4]
$value_edit_1 := %skv_values [5]
end if
which of course you would reduce to:
$i := 0
while ($i < 3)
if (%cc[3] = i)
$switch_1 := %skv_values [3*i + 0]
$knob_1 := %skv_values [3*i + 1]
$value_edit_1 := %skv_values [3*i + 2]
end if
inc($i)
end while
in this version of the code you can manage all possibilities from %CC[3] = 0 to 127 in one neat loop.
0 -
Ok... it's very well explained and it seems like it can help me, I'll try it right away, thank you very much.
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 65 NI News
- 797 Tech Talks
- 4.1K Native Access
- 16.8K Komplete
- 2K Komplete General
- 4.4K Komplete Kontrol
- 5.8K Kontakt
- 1.6K Reaktor
- 386 Battery 4
- 854 Guitar Rig & FX
- 434 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.9K Maschine
- 7.4K Traktor
- 7.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