- This topic has 3 replies, 2 voices, and was last updated 3 months, 1 week ago by
Pacocreative.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
12 February 2025 at 10 h 31 min #7184
Pacocreative
ParticipantAs I understand:
currentCaseOptionValueInt(0) should return an Integer
currentCaseOptionValueFloat(0) should return a Floatbut it seems each of them return a String and throw error?
Code:
// Looper speed change, args: looper id, speed CaseBranch "LP Spd" //Message {"LP Speed " + currentCaseOptionValueInt(0) + " " + currentCaseOptionValueFloat(1)} // !!! This returns correct values !!! // vars for each channel $k$ = currentCaseOptionValueInt(0) $v$ = currentCaseOptionValueFloat(1) $m$ = $Looper_fx8_rank1_PlayerMode_state$ $b$ = $Looper_fx8_rank1_current_length$ $r$ = $Looper_fx8_rank1_ReverseDirection_state$ Message {"LP Speed " + $k$ + " " + $v$ + " m " + $m$ + " b " + $b$ + " s " + $s$ } // This returns zeros for variables k and v and throws errors in console
Cannot get value for variable $k$. Expecting type class java.lang.Integer, but got value currentCaseOptionValueInt(0) of class class java.lang.String Bad variable type java.lang.String instead of class java.lang.Integer; Ignore value and use default of proper type Cannot get value for variable $v$. Expecting type class java.lang.Float, but got value currentCaseOptionValueFloat(1) of class class java.lang.String Bad variable type java.lang.String instead of class java.lang.Float; Ignore value and use default of proper type Error : Erreur macro: Macro _Nov_LC_XL_v003, slot data_2_insert_2, line 867: track name:No track named fx0 exists. The index value of variable <I>$k$</I> is incorrect for this kind of tracks; for InsertSendMessage Macro _Nov_LC_XL_v003 will be stopped now.
12 February 2025 at 10 h 42 min #7185Pacocreative
ParticipantGenerally something weird is going on.
// In Matrix // in the head Declare Local float $v$ = 0 // Later in case branches CaseBranch "Test" $v$ = currentCaseOptionValueFloat(0) Message {"test CCOVF " + currentCaseOptionValueFloat(0) + " $v$ " + $v$ } BreakCaseBranch
Fails to assign value to the variable, and output is:
currentCaseOptionValueFloat(0) ⇀ correct value
$v$ ⇀ 0I’m using these assignments to tidy up my code and avoid repetitions
Any ideas?
12 February 2025 at 12 h 03 min #7186Philippe
KeymasterHi,
You need to put those { } to evaluate the currentCaseOptionValueFloat(0) value as this :CaseBranch "Test" $mavar$ = {currentCaseOptionValueFloat(0)} Message {"test CCOVF " + currentCaseOptionValueFloat(0) + " $mavar$ " + $mavar$ } BreakCaseBranch
12 February 2025 at 13 h 34 min #7187Pacocreative
ParticipantOh, now that works. Stupid me.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.