Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

How To Make The Robot Dance To A Song?

I have made 3 different dance steps for 3 different songs. I want to make it in such a way that in the Auto Position window, when i execute an action, it should simultaneously do the action as well as play the song. How to do that?

AI Support Bot
Related Content
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
In the action editor (where you add frames) there's a button to edit the script. go there and type this in;

ControlCommand( "SoundBoard", sound name )
Or, you can add the SoundBoard EZ-B v4 control. That way, you can edit the sound and add scripts to run at any point along the timeline.
Hi guys, Thank for the fast reply. I am able to do it. But my robot has gone "crazy". I am only able to execute only one action instead of multiple actions. If I have to 2nd action, i ve to close and relaunch the ARC. I am thinking is it fault with the software or something else.
what kind of servos are you using? Dynamixels seem to have a small issue with this, however it shouldn't be spazzing out. If you're using normal hobby servos they shouldn't be doing that at all
NYP, what are you "able to do"? There are a few suggestions given to you - which one did you choose?

Can you share your project? Use the Attach File button on the right to share it with us so we can help you
United Kingdom
Trust me, it's not a fault with the software. My guess is you are sending controlcommands too quickly and it's attempting to start one script before the other is finished.

If you are trying to make the robot dance then the best method is to edit the soundboard scripts. I have tried both ways (scripting with ControlCommand() and sleeps and with the soundboard) and the soundboard method was easiest and more accurate.

Here's a quick comparison, Six was done with scripting ControlCommands and JD was done with the Soundboard method, notice which one is quite clearly better.

Hi Rich, I am unable to see the Spider's video, it says "Not available in your country". I ve seen your JD. Its sync well with the song.How do you do that Soundboard method? I have never seen it before.
United Kingdom
Ah, your country must have some kind of issue with Another Level - Freak Me. Six is synced and looks fine but the sequence took longer than JD and is not nearly as advanced.

Add a sound file to the sound board and choose Edit. Along the song's timeline you can add scripts. I don't have ARC at the moment as I'm at work and running on XP but from memory I believe you right click on the point where you want to add the commands.

When I get home (in about 8 hours) I'll have a look at the control and throw some screenshots up unless someone else beats me to it.
I see why your program crashes - because it's an infinite loop.

For some reason you have put code in the Auto Position actions to start the same Auto Position actions. I would recommend sticking to the SoundBoard for dances rather than adding code to actions.

There are blue question marks on the software, everywhere. When you hover over the question mark, it tells you what the feature does. By adding code to the Auto Position Action, you're executing that code every time the Auto Position action starts.

These are your trouble areas. Remove ALL Code from the Action Script Buttons. You have added code to:
- Bollywood Dance
- Dance
- Gorilla
- Hip Hop Dance
User-inserted image

You can tell when there is code because the button is BLUE rather than GREEN. When the button is GREEN, there is no code.

For example, in the BOLLYWOOD DANCE, you have added this code...


ControlCommand("Robot Dancing Music", Track_2)
ControlCommand("Auto Position", AutoPositionAction, "Bollywood Dance")
ControlCommand("Auto Position", AutoPositionAction, "Stop")

So, every time the BOLLYWOOD DANCE action executes, it will execute itself again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, until the software crashes.

For dances, please use the SoundBoard for adding AutoPosition commands to the timeline of the music.

In order to salvage your project, remove ALL Code from the Action Script Buttons. Following that, use the SoundBoard for adding AutoPosition commands for the dance.

I highly recommend following this tutorial: http://www.ez-robot.com/Tutorials/Lesson/52

Follow that tutorial on how to make dances using existing Auto Position actions. Do not add scripts to the Auto Position, instead use the Sound Board. You can find the tutorial here: http://www.ez-robot.com/Tutorials/Lesson/52
@DJ Sures

This is the second time in two days we have heard about someone having serious issues (one actually damaging servos) due to uncontrolled loops in scripts.

The company I used to work for made Automatic Call Distributors (the phone switches used by customer service and sales centers). We had a process where it was possible for customers to create a call flow that caused an infinite loop and it would crash their phone switch (not a good thing in a 500 seat call center).

We did two things in the code.

1) In the most common area, we did loop detection as the scripts were created, and warned the customer about a possible loop. This might be difficult in an app with as many different interfaces as ARC, and of course some loops are valid, and we got lots of false positives too.

2) We put in code to detect a loop in progress, and if we caught a process loop 1000 times, we put in a 1 second pause in the processing to let the queues catch up, and logged it as an error (and sent an SNMP trap) so that we could notify the customer that it needed to be fixed, but it caused no damage. You could do something like that, throwing an error screen when excessive looping is detected.

It's impossible for a programming language to determine what you're trying or not trying to do - ARC provides a scripting environment that allows you to program.

If someone programs incorrectly, there is little that can be done to prevent them. For example, there is no way to determine what someone is doing with programming.

Compiler design has millions of combined efforts across multiple operating systems, rtos and microprocessors for over 30 years - not including Alan Turing's initial symbol recognition and execution theories of logical, which was entirely organized to demonstrate the freedom to do anything - including damage. Imagine the issues Babbage would have had to deal with if his mechanical "computer" was completed - a stack overflow would have meant a gear flying off and hitting you in the eye:)

To answer your question, it's impossible to predict what a user is doing - what you described is a previously defined process with a predictable set of outcomes. A compiler does not have the ability.

What is necessary in robotics or any new environment is following the instructions:) Which is why we have a very awesome Learn section

very good question.i learn from it.

dj indeed ,i get more respect avery time i use ARC.
DJ Sures, i have done the dance successfully using soundboard method.
Nyp, that's great to hear! Do we get to see?:) post a video!
I dont have the spider with me right now. My Roli dance is in process and I still havent done for my JD.
I am free from tomorrow onwards . I ll make the 3 robots's EZB files public for you guys to see it live. But it is not from the account that i'm using. It will be from ezrobot3.