Home › Forums › General › Spatialisation magique! › Reply To: Spatialisation magique!
Salut Michel,
Réponse à la question du 12/08/2015. Je répondrai plus tard à la question du 10/08/2015
************
Durant la formation qui aura lieu en octobre prochain, nous étudierons de près l’écriture des macros. Je conseille donc à ceux qui ont du mal à comprendre la syntaxe des macros de s’intéresser à cette formation.
************
Si tu mets un WaitUserAction, tu stoppes la boucle dans la macro, les pannes ne sont donc plus mises à jour en fonction du nombre de pistes utilisées. Ça n’est donc pas approprié dans le cas présent.
Si tu veux lancer une autre macro à partir de celle-ci, tu utilises :
MacroStartIfNeededOnSlot
Pour faire quelque chose à la fin d’une macro, il me semble préférable d’utilise une boucle basée sur (plutôt que MacroRestart qui relance la macro depuis le début) :
DoRepeat
// le contenu de code à mettre en boucle
While {true}
Dans ce cas, si tu insères un SignalCatchBlock, tu pourras arrêter la boucle et exécuter une sorte de coda. C’est dans cette coda que les panners se remettent au centre. la macro devient donc :
//Début de la macro
Redeclare boolean $user_action_received$ = false
BeginSignalCatchBlock
DoRepeat
If {$current_full_tracks_count$ == 1}
TrackPanMono trk1 = 0.
EndIf
If {$current_full_tracks_count$ == 2}
TrackPanMono trk1 = -0.4
TrackPanMono trk2 = 0.4
EndIf
If {$current_full_tracks_count$ == 3}
TrackPanMono trk1 = -0.4
TrackPanMono trk2 = 0.4
TrackPanMono trk3 = 0.
EndIf
If {$current_full_tracks_count$ == 4}
TrackPanMono trk1 = -0.6
TrackPanMono trk2 = 0.6
TrackPanMono trk3 = -0.4
TrackPanMono trk4 = 0.4
EndIf
If {$current_full_tracks_count$ == 5}
TrackPanMono trk1 = -0.6
TrackPanMono trk2 = 0.6
TrackPanMono trk3 = -0.4
TrackPanMono trk4 = 0.4
TrackPanMono trk5 = 0.
EndIf
If {$current_full_tracks_count$ == 6}
TrackPanMono trk1 = -0.8
TrackPanMono trk2 = 0.8
TrackPanMono trk3 = -0.6
TrackPanMono trk4 = 0.6
TrackPanMono trk5 = -0.4
TrackPanMono trk6 = 0.4
EndIf
If {$current_full_tracks_count$ == 7}
TrackPanMono trk1 = -0.8
TrackPanMono trk2 = 0.8
TrackPanMono trk3 = -0.6
TrackPanMono trk4 = 0.6
TrackPanMono trk5 = -0.4
TrackPanMono trk6 = 0.4
TrackPanMono trk7 = 0.
EndIf
If {$current_full_tracks_count$ == 8}
TrackPanMono trk1 = -0.8
TrackPanMono trk2 = 0.8
TrackPanMono trk3 = -0.6
TrackPanMono trk4 = 0.6
TrackPanMono trk5 = -0.4
TrackPanMono trk6 = 0.4
TrackPanMono trk7 = -1.
TrackPanMono trk8 = 1.
EndIf
If {$current_full_tracks_count$ == 9}
TrackPanMono trk1 = -0.8
TrackPanMono trk2 = 0.8
TrackPanMono trk3 = -0.6
TrackPanMono trk4 = 0.6
TrackPanMono trk5 = -0.4
TrackPanMono trk6 = 0.4
TrackPanMono trk7 = -1.
TrackPanMono trk8 = 1.
TrackPanMono trk9 = 0.
EndIf
If {$current_full_tracks_count$ == 10}
TrackPanMono trk1 = -0.8
TrackPanMono trk2 = 0.8
TrackPanMono trk3 = -0.6
TrackPanMono trk4 = 0.6
TrackPanMono trk5 = -0.4
TrackPanMono trk6 = 0.4
TrackPanMono trk7 = -1.
TrackPanMono trk8 = 1.
TrackPanMono trk9 = -0.2
TrackPanMono trk10 = 0.2
EndIf
Sleep 100
While {!$user_action_received$}
EndSignalCatchBlock OnSignalCatched Do Set $user_action_received$ = true
TrackPanMono trk1 = 0.
TrackPanMono trk2 = 0.
TrackPanMono trk3 = 0.
TrackPanMono trk4 = 0.
TrackPanMono trk5 = 0.
TrackPanMono trk6 = 0.
TrackPanMono trk7 = 0.
TrackPanMono trk8 = 0.
TrackPanMono trk9 = 0.
TrackPanMono trk10 = 0.
//Fin de la macro