Getting a single tune to play continuously over multiple cards


OK so: I was contacted on bsky about how to keep a tune playing across multiple cards. And I was like "hmm I haven't thought of that" but like I worked out a way to do it. And I thought I should write it here in case anyone else needs it!

So: let's say you have a Jankytunes contraption on a card. Normally you'll only hear it if you're on that card, but we can take advantage of the animation pump function to get it to play when you're on other cards.

Let's say Jankytunes is playing on card1 but we want to hear it on card2 as well. On card2 we just need to add a button or a canvas and set it to "animated" and "show none" in the widgets menu.

Then we just put this code inside the button

on view do
  card1.widgets.jankytunes1.animate[]
end
and you can put this on basically any card where you need the tune to still be playing.

And you can call the "play" and "stop" and other methods from code anywhere else just using like card1.widgets.jankytunes1.play[] or such.

I don't think it'll work nicely with like if you're using transitions - since they won't be calling the animation pump the music will pause while that happens. But yeah otherwise it seems to work!

Let me know if you have any questions!

Get JankyTunes: The Contraption

Leave a comment

Log in with itch.io to leave a comment.