I was reading through the GP sequencer doc and it struck me that it does not look like there is a clean way to stop a sequence playing when it finishes the end of a loop. If I missed this some where, please tell me how to do this.
What I am thinking is this. I will load a sequence into one of the GP players for walking and set the bot walking. But when it is time to stop walking, it seems to me a lot cleaner if one can stop it when it reaches the end of a stride rather than just at some random point in the stride. Now I could poll the QPL command over an over and look for the player to reach the end of the loop, but that seems a bit rough and prone to error.
Perhaps the PL command could be modified to add the ability to specify the index of the current sequence where you want it to stop
PL 0 – stops player 0 immeadiately
PL 0 IX 0 – stop the player when it reaches index 0 of the current sequence.
I realize that this could be confusing (PL 0 IX 0 looks like play at index 0)
OR, perhaps it is better to add a real stop command instead of piggy backing it on the play command (Play is play, stop is stop). So, add a true STop command:
ST 0 – stops player 0 instantly
ST 0 IX 3 – stops player 0 when it reaches index 3 of the current seq
Just some suggestions, but I think it might be handy if there were some better ways to stop sequences so you can leave the bot in a known position (or did I miss something). I am just thinking ahead to some of the things I will need to do with the GP. It will be very handy.
I’ve not had time to play with the new GP player. But after reading the manual I totaly agree with you about the stopping part. Your suggestions about a real stop command with the possiblity to define where to stop sounds great.
I was wondering, after a immediate stop ( PL 0 ) does the QPL work? It would be nice to know where the player actually stopped.
Jim drew my attention to this thread last week but I have been negligent in posting. I appreciate any suggestions for improvements and enhancements for future releases of the GP sequencer and am compiling a list for the next firmware release.
The idea of a command like
ST 0 IX 3
is appealing, and it does seem useful. Here is what I think the behavior would be. Let me know if it is what you are thinking of.
The player would stop immediately the next time the index transitioned to the specified index, from either direction. (e.g. with the above command, it would stop on a transition 2->3 or 4->3.)
When the player stops it will be at the position for the specified index.
If the index did not exist in the current sequence, then it would not stop at all. This would give a way to effectively cancel a stop command: ST 0 IX 255.
If the player is reversed repeatedly, it may take a long time to reach the specified index. For example, you could have it stop at index 3 but reverse the direction over and over to make it stay in index 2.
What should it do if the player is currently on the specified index when the command is received? It could:
Wait until the next time it transitions to the index, which would be one complete cycle of the sequence;
Stop immediately, maybe not exactly at the position for the specified index;
Back up to the position for the specified index (at the current speed) and then stop.
I don’t like the third option above because it would be the hardest to implement, but if that is what you want say so and I’ll see what I can do.
There was also a question about whether QPL works after the player is stopped. I confess I don’t remember, but off the top of my head I think it should. I’ll need to check on this one. The source of my doubt is that once the player is stopped, it is no longer associated with a particular sequence. But it would be nice if it returned the status of the last sequence played.
Thanks for getting back. I think your ideas for how the ST command should work sound fine. As for your question about what to do if the ST command arrives while the player is executing the desired stop index, I understand that somethings are hard to implement. I think I would go with option #1, wait until the player comes back around to the start of the specified index. This keeps the meaning of ST 0 IX n simple: stop when the player reaches a certain point in the sequence, i.e. the start of index n). If the user wanted to stop at the end of a given index, they can specify n+1. If they want to stop at the end of the current sequence, they can use ST 0 IX 0.
I must admit that I am very new to the GP sequencer, which looks to be very handy. The difficult thing to me seems to be how to make transitions between sequences. A very common one must be walk, turn, walk again. It seems that many users are adopting the plan of starting and ending very sequence with a home position. That way the blends between different sequences (walk, turn right, walk again) can be smooth. But this makes some sequences like walk more difficult to design. Again, I have no experience with this, but it would seem that if your walk sequence is:
0) Lean Left
Step Right Leg Forward
Lean Right
Step Left Leg Forward
Home Position
And your turn sequence is something like this:
0) Lean
Left forward, right back
Change L & Right
Home Pos
This might lead to smooth transitions between Walking and Turning, but there would be all these Home Positions in the way and that might look funny when you are just doing continuous walking or turning. Another command you might consider is a repeat from index n to m. Then, the user could repeat steps 0 - 3 in the walk when they just want to do some walking.
Just some random thoughts based on very little experience, but thanks for considering them and thanks for adding the ST command, I think it will be useful.