Hi Folks,
First time poster here - having a great time learning Pico-8 and enjoying making a nice maze game and a 36 year old ambition to create a sequel to the ZX Spectrum's Hungry Horace. So...
I have a two channel baseline that I want to keep throughout the game, but would like to fade in channels three and four based on events in game - how far through the level people are, presence of certain beasties, or just at random, etc - and keep it in time with the other channels.
Suspect I could create each variant as a Pattern on its own, but I can't see an ability to control which pattern to move to when one ends.
Any ideas?
Thanks (and looking forward to showing off my first effort in a few weeks :-)
Paul



I've found that changes to patterns via poke don't seem to update immediately (it only applies the next time the pattern is triggered, iirc), but changes to SFX do. So what I'd probably do is have some silent SFXs always playing on those other channels in the pattern, but swap the note data in those SFXs (via memcpy) with other SFXs.
This could mean notes cut in suddenly in ways that sound bad, so you may want to read the SFX data and wait and only swap the SFX in gaps when no notes would be playing on the new SFX. I actually rigged up a system like this for a project but then didn't end up using it :p



Thanks for the tip! Good to know i'd not missed anything in the regular API that could do this.
I'm going to shelve messing with Poke and the like until i'm more comfortable with the basics and have more of a game that justifies the effort :-)
When I do find a solution though i'll report back!



You could just go to the SFX, upon the event, and poke the "Volume" variable accordingly.



I am doing that right now for my X-Wing vs Tie fighter project and @kittenmaster is the only solutin that works.
That is, play a looping sfx and poke the notes/volumes - this is the only solution that work given that playing sounds and _update are not synchronized (eg note duration is not a multiple of 1/30).
[Please log in to post a comment]