Stopping the Foxdot player in a script

Hello everyone, i’ve been looking through the documentation but i couln’t find an answer to my question.

Is there a way to stop the foxdot player during a script?

I am trying to make a python script that generates music, and i am using the Go() function to start foxdot from the script, and that works fine, but i don’t know if the player can be stopped so that the python script can continue running past the Go() fuction after a certain amount of time or something like that.

I hope my question is clear and thanks in advance.

I’m also keen to know if this is a possibility. You can use time.sleep() followed by p1.stop() but it’s messy and will cause musical timing issues. Surely there is a way to set an instrument to stop after an allotted amount of time within the API?

you can stop a player after 8beats with
p1 >> blip().after(8, "stop") or
p1 >> blip().stop(8)

2 Likes