Tagged: During InsertSendMessage
- This topic has 3 replies, 3 voices, and was last updated 10 months, 3 weeks ago by
Philippe.
-
AuthorPosts
-
4 April 2024 at 14 h 39 min #6435
THEZE Morgan
ParticipantBonjour,
Y aurait-il une solution pour contourner l’absence de posibilité de recourir au During avec les InsertSendMessage ?
Par exemple, si je souhaite que mon feedback diminue j’aurais écrit cela :
During 10000 Reach 10 InsertSendMessage fx2 1 FeedbackRightPour le moment je fais des boucles qui baissent ou montent des valeurs de mes LFXs à chaque répétition tant que un temps n’est pas écoulé.
Declare Local int $time$ = 0
Declare Local int $during$ = 20000
Declare Local int $Reach$ = 10
Declare Local int $Delta$ = {$Delay_fx2_rank1_FeedbackRight_state$-$Reach$}
DoRepeat
InsertSendMessage fx2 1 FeedbackRight {$Delay_fx2_rank1_FeedbackRight_state$-1}
$time$ = { $time$+($during$/$Delta$)}
WaitDuration {$during$/$Delta$}
While {$time$ < $during$}Y aurait-il une méthode plus simple ?
Par avance merci
Morgan
9 April 2024 at 8 h 42 min #6441Philippe
KeymasterSalut Morgan,
Effectivement l’absence de fonction During pour les messages vers les inserts est dommage.
Peut-être qu’un jour nous disposerons d’une solution simple, mais pour l’instant, il n’y a pas d’autre solution que de faire sa propre routine.
Routine que tu peux déporter dans un slot macro spécifique qui gérera tous tes cas de during spécifiques.Voici une autre proposition de macro pour faire un during, note qu’elle est encore plus longue que la tienne !
//***********************************************************************************
// Set the total duration of the value change
Declare Local int $duration_ms$ = 1000// Set the start and end value
Declare Local float $startValue$ = 0
Declare Local float $endValue$ = 1Declare Local int $steps$ = 100
Declare Local float $incrementDuration$ = 0
Declare Local float $targetValue$ = $startValue$
Declare Local float $increment$ = {($endValue$ – $targetValue$) / $steps$}// calculate the number of needed steps for the current increment
$steps$ = {($endValue$ – $startValue$) / $increment$}
//Post $steps$Declare Local int $startClock$ = {monotonic_ms()}
DoRepeat
$increment$ = {($endValue$ – $targetValue$) / $steps$}
$incrementDuration$ = { ($startClock$ + $duration_ms$ – monotonic_ms())/ $steps$ }// Current step value calculation
$targetValue$ = {min($endValue$,$targetValue$ + $increment$)}//******************** Put the destination here ********************
InsertSendMessage fx1 1 SpeedFloat $targetValue$WaitDuration {$incrementDuration$}
$steps$ = {$steps$ – 1 }
While {$targetValue$ < $endValue$} //Post {monotonic_ms() - $startClock$} //***********************************************************************************7 June 2024 at 0 h 13 min #6488Maxime Pesquer
ParticipantBonjour,
Comment dois-je modifier le code pour inverser le sens de cette rampe (j’aimerais qu’elle descende plutôt que de monter) ? J’ai beau essayer, je n’y parviens pas…
Bien à vous,
Maxime7 June 2024 at 6 h 53 min #6491Philippe
KeymasterSalut Maxime,
Tu dois changer trois choses :
1 – Tu inverses les valeurs de début et de fin
Declare Local float $startValue$ = 1
Declare Local float $endValue$ = 02 – Ici tu prends la valeur max et non pas la valeur min
$targetValue$ = {max($endValue$,$targetValue$ + $increment$)}3 – Enfin, tu vérifies que la valeur cible est supérieure à la valeur de fin pour autoriser un nouveau tour de boucle
While {$targetValue$ > $endValue$}Voici la macro finale qui décrémente au lieu d’incrémenter :
//***********************************************************************************
// Set the total duration of the value change
Declare Local int $duration_ms$ = 1000// Set the start and end value
Declare Local float $startValue$ = 1
Declare Local float $endValue$ = 0Declare Local int $steps$ = 100
Declare Local float $incrementDuration$ = 0
Declare Local float $targetValue$ = $startValue$
Declare Local float $increment$ = {($endValue$ – $targetValue$) / $steps$}// calculate the number of needed steps for the current increment
$steps$ = {($endValue$ – $startValue$) / $increment$}
//Post $steps$Declare Local int $startClock$ = {monotonic_ms()}
DoRepeat
$increment$ = {($endValue$ – $targetValue$) / $steps$}
$incrementDuration$ = { ($startClock$ + $duration_ms$ – monotonic_ms())/ $steps$ }// Current step value calculation
$targetValue$ = {max($endValue$,$targetValue$ + $increment$)}//******************** Put the destination here ********************
InsertSendMessage fx1 1 SpeedFloat $targetValue$WaitDuration {$incrementDuration$}
$steps$ = {$steps$ – 1 }
While {$targetValue$ > $endValue$} //Post {monotonic_ms() – $startClock$}
//*********************************************************************************** -
AuthorPosts
- You must be logged in to reply to this topic.