Asked
— Edited
Resolved by CochranRobotics!
Hi guys.
I have a quick question regarding the RGB animator config "Settings" menu. At the moment I have 4 animator actions and would like to know if I can asign a soundboard file to just one of these actions, and not have all four actions play the sound file on the "Positioner start script"?
Or is it a case of having 2 animator controls, one with sounds and one without?
Thanks in advance.
Steve.
1 quick additional question, what script command do I need to use to automaticly start an animation action after the EZ-B establishes a connection. I don't mean straight after connection (connection control config menu), I mean after the start up script has been run from the connection control.
I hope you can understand what I mean. If not, let me know.
in the connect box, click the gear. from there, you can use the 0-connection Established Cmd to set the script that would run when the connection establishes.
oops, didnt read the entire post. will re-read and then answer.
What I do is generate an init script that fires after the connection is established which then sets up everything to run as I need it to. In that script, I do things like set the movement action to stop, start monitoring power, set led's and start monitoring everything by calling a monitor script which is setup to loop.
@d.cochran.
Thanks for your (edited) reply my friend.
I thought there might be a way so thanks for confirming. I haven't had much experience (or luck) with init scripts yet. Could you post a small example of one for me if you wouldn't mind?
Cheers, Steve.
Read this lesson, it'll help you https://synthiam.com/Tutorials/Lesson/23
Apply what you learn from that lesson to the Connection Control's Configuration Menu. And as @d.cochran said, you're code will go into the Connection Established
I haven't looked at these in a while but here is what I have on my project
Startup Script
Here are the other scripts Battery Monitor - This script is from Rich and is old. I am replacing it with the abilities that the V4 has built into it already. I was using this when I was passing only 5 volts to the V4 but was using 7.4 volt batteries. Now I pass 7.4 volts to the V4 and regulate power after the V4.
Set LED's for power
Light monitor
tilt monitor
temp monitor
Personality Generator
Let me know if you have any questions.
Thanks David
@DJ.
Thanks for your reply. I will have a look. I didn't think I could add a long running script in the connection config as it would block other commands from executing. I already have a connection script that runs for about 10 seconds, but what I want to add would run for a lot longer (blinking eye animation). I will check out the lesson though.
@d.cochran.
Wow, didn't expect that much. Thanks very much for that. I will go through it and see if I can figure out what I need.
ARC is multi-threaded. This allows multiple scripts to run at one time without affecting each other.
Also, I wanted to make sure you had enough to learn from. Each of these scripts either calls other scripts or movements. I dont have an example of calling the rgb component but it would be done the same way. Also, in ARC, when you are editing a script, you can use the Cheat Sheet tab which will allow you to add other scripts or actions that you have programmed to be called by your script by clicking on the command you want to add. You will see this done above through the use of the ControlCommand command.
Things like the Auto Position and RGB Animator are background threaded - this means once you ask them to start, they run the loop for ever. The script doesn't "wait" for the animation to run. The script will merely nudge the animator and say "hey, run" and the animator will run in the background for ever until told to stop.
Of course, it will only run for ever if the checkbox is set for "repeat" on Auto Position or RGB Animator
It isn't great practice to through loops and such in the connection control - that's too much overhead for the connection established feature. However, nudging another script to "start" with the ControlCommand() is safe.
Essentially, ControlCommand() is the same effect as a human pressing the buttons on the control that you are directing it too. As a human, you don't press a button, sit, stare and wait for it to finish... You move on to other things - and that's how the ControlCommand() was designed.
I have used the control commands for a lot of my project, some of which are already being used in connection established command. If I can run my ControlCommand() "eyes" script straight from there then that's cool. But the reason why I ask is the message on the top of the event EZ script editor.
"You are editing an event with EZ-Script. While this code executes, it will block other events of this control from executing. Make sure you are not performing any time-consuming operations in this event code."
What u want to run will run for quite a while as I mentioned, is for a pair of eyes that will blink, roll ect on a loop, so I didnt think this was the right place to put this script.
I have already gone through the scripting lesson a while back and got a lot from it, but there are still some things I just can't get the hang of. confused
Almost forgot. Can anyone help with the question in my first post?
That's what we're doing
Are we? confused I thought we were talking about starting a script after the connection status issue (post #2). The first post (post #1) was regarding RGB editor playing sounds on selected actions (unless I missed something).
Ah, well you have 2 ways to do it...
-or-
I have spent the day "repairing" the robots that my class uses. I am getting them back to 100% working order as after multiple classes with students working in teams, some of the servo motors have been stripped, and some of the parts have been moved from the left side to the right side of the robots and such. I have just finished putting JD back in working order and am looking at the RGB Animator right now. It is the first time that I have seen placing the script inside the Soundboard V4 control and it is really cool. I wish I had this for something I was doing a few months back. Nice addition DJ.
I would call your script from within the Soundboard V4. It is a very easy way to make the script start at a specific time in the song, or call one script and then another later. The script would be something like this.
This is added to the song in a location you specify by right mouse clicking in the sound section (black background with green line) and then selecting Add Script. In the Script section (bottom of the control) you can click the Edit Script button and put in the code above. It will call the Banana RGB Animation Action. Just replace Banana with the RGB sequence you want to use.
Now, in your startup script, when you are ready for the sound file to play, just add
replacing Track_0 with the location of the track you want to play.
That should get you what you want. If you want multiple RGB Animations to run, just add those to the Soundboard V4 song where you want them to activate.
Let us know if you have any questions.
Thanks for that guys. Those solutions worked great. The deeper I dive in to ARC, the more smiles it puts in my face.
Haven't had a look in regards to my second question about the auto script start after my connection script has run, but I will do shortly and hopefully figure it out.
Thanks again d.cochran and DJ for your help.
@DJsures.
Just a quick update. Tried the RGB start ControlCommand() in the connection script, and works like a charm. Thanks once again for your assistance. Bit of a Homer Simpson moment for me as that was really easy to set up. eyeroll love the ControlCommand() option. Nice job.
Hey, K-9 2.0 will be up in the project showcase within a couple of weeks if your interested. I know your a Dr Who fan. Just need to do some finishing touches and knock up a video or 2 to show him off. cool cool cool . Can't wait to see what you and others will think of him.
@Steve G... Of course we're interested!... We wanna' see what the rookie can do...
Wow. No pressure then lol. sick
Super excited to see a video of your k9. Im a serious doctor who fan!
Cool. The weeping angles. I'm 41 years old and they scare the heck out of me. But you gotta love them Darleks though. Seriously cool bad guys.
Don't remember the cool dude duck in DW though. Must of missed that episode.
No spoilers but that Hollywood duck is the master in the latest season!
:D You rotten spoilsport. Now you've ruined the surprise . I think he would be good at playing the part. Who knows what evil genius lurks behind them shades? eek
@DJ.
I'm having an issue with RGB animator and sound files. Can you have a look post #6 here and suggest what the problem could be. Thanks.