Home › Forums › Macros › lecture aléatoire playlist › Reply To: lecture aléatoire playlist
Salut Nico,
J’ai dû faire appel à Christophe qui m’a rappelé le truc pour concatèner des entiers et des chaines de caractères dans une chaine de caractère.
Voici une macro courte et élégante pour faire ce que tu demandes.
Bonne journée,
Philippe
// the variable $TimeBetweenEachSound$ will set the pause time between each trigger
Declare int $TimeBetweenEachSound$ = 500
Declare string $slot$ = 1_Play
DoRepeat
// The “” is necessary to be sure that we are creating a string
// randomScaleInt(1,16) will calculate a random int between 1 and 16
// the resulting variable $slot$ will have a string value between
// 1_Play and 16_PLay
$slot$ = {“” + randomScaleInt(1,16) + “_Play”}
// This message will start playing the audio on the selected slot
InsertSendMessage trk10 1 $slot$ 1
// This pause is usefull to avoid to block Logelloop
Sleep $TimeBetweenEachSound$
While true