Asked — Edited
Resolved Resolved by DJ Sures!

Passing A Variable To Soundboard V4

I would like to do something like the following but can't get it to work.


$SongID = "Track_0"
ControlCommand("Soundboard v4", $SongID)

I could do something like this but want to avoid it if possible because this becomes static instead of dynamically driven.



if($SongID = "Track_0")
   ControlCommand("Soundboard v4", Track_0)
elseif($SongID = "Track_1")
   ControlCommand("Soundboard v4", Track_1)
.
.
.
endif


So the question is, how would one go about passing a variable into the SoundBoard V4 command?

Thanks for any advice in advance. This one has me stumped.


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

United Kingdom
#1  

That should work to be honest unless there's an issue with the variable being a string but the control not asking for quotes surrounding the text.

I need to spend some quality time with a robot so give me a couple of hours and I'll play and see what I discover.

United Kingdom
#3  

I just tried everything I could think of trying to use a variable in place of the track number however had no success, which leads me to believe that it's not currently possible (however I suspect it may be once DJ sees this).

There's a challenge to the community, find out something which I failed to find (it happens, it's rare but it happens) :)

What is it that you are trying to achieve anyway? Somewhere in the script you must be setting $songID. I know it's a little more coding (although it is click & paste) but couldn't you use the ControlCommand in place of the setting of the variable?

PRO
Synthiam
#4  

Added to the next release

#5  

The song Id is set by a call to a database. The list of songs resides there and is called at intervals. I log what has been played in the database so that the same thing isn't played again for the same person until they have completed all of them.

I'm not actually using it for songs, but stories for a teacher to use in a classroom type setting.

Thanks DJ. Also, Thanks Rich for looking.

#6  

Someone who saw what had been done with Teddy last night asked if I could do the same for an office type setting. You wouldn't want the same "elevator music" played over and over again or else you might have a few less employees... It could be used for office announcements or really anything. It could be used at a store to repeat the special sales for the day, but you would want it to go through all of them before repeating them.

I also have age ranges in the database so that the call to the database retrieves the tracks that are only appropriate for the age of the user. If a first grade teacher is using the robot, it would recognize that teachers face, and only play tracks that are for 1st grade students. If the 6th grade teacher was using the robot, it would play tracks appropriate for sixth grade students.

This all goes back to the project that was for my granddaughter. I want the robot to change what it does when she is 1 vs 6 years old without me having to go make the changes in the project when she turns 6.

#7  

Had to make a comment to mark it as resolved. Its going to take a modification to ARC. Rich, thanks again for looking into it. Marking as resolved as I am sure DJ will resolve it with the next release as stated.