egli [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=4737 Two Songs: A Dynamic Music Engine Demo <p> <table><tr><td> <a href="/bbs/?pid=66709#p"> <img src="/bbs/thumbs/pico8_two_songs-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=66709#p"> two_songs</a><br><br> by <a href="/bbs/?uid=4737"> egli</a> <br><br><br> <a href="/bbs/?pid=66709#p"> [Click to Play]</a> </td></tr></table> </p> <p>This cart is a few things:</p> <p>It&rsquo;s <strong>a branching music demo</strong> featuring music from <a href="https://twitter.com/robbyduguay">Robby Duguay</a>&rsquo;s excellent &ldquo;<a href="https://www.lexaloffle.com/bbs/?pid=15486">Nine Songs in PICO-8</a>&rdquo; cart.</p> <p>It&rsquo;s <strong>a proof of concept</strong> for my PICO-8 dynamic music engine, which I have dubbed &ldquo;Zero-Track&rdquo;.</p> <p>And finally, this cart is <strong>an invitation:</strong></p> <p>If you write music and would like to try out writing something non-linear for the PICO-8, feel free to drop me a line; it would be awesome to work with music written explicitly for this sort of use.</p> <p>If you are working on a game and would like to include music dynamically tied to what's happening in the game, I'd love to see if my music engine could be a good fit for your game, as well.</p> <h3>Zero-Track</h3> <p>For those interested in using the Zero-Track engine, I'm happy to chat about it, but here's some light documentation as well:</p> <p>First, you should include a call to ZERO:UPDATE() from your _UPDATE() or _UPDATE60() function.</p> <p>Then, ZERO:PLAY() functions like MUSIC(), except that instead of a pattern number, it takes a special track object.</p> <p>The track object needs to implement two functions:</p> <ul> <li>TRACK:PATTERN() : for now, your track object should return a four byte number where each byte is the ID of one SFX (basically the format used for storing patterns in memory, minus the special flag bits which will be ignored if included in the return value). Nothing is stopping you at this point from building and poking the SFX you desire into memory, but helper functions for that aren&rsquo;t included yet.</li> <li>TRACK:NEXT() : return the track object that will provide the next pattern after the one provided by this track. Your track can return an independent object, or for flexibility can at this point just return itself and update its internal state so that the next call to PATTERN() will return a different value. This function is called &ldquo;just in time&rdquo; as the music engine needs the next pattern, so the returned track can be based on realtime game stats.</li> </ul> <p>For now that's it! I'll add more functionality as it looks like I need it.</p> <p>Thanks and enjoy!</p> <p>&ndash;Mark</p> https://www.lexaloffle.com/bbs/?tid=35088 https://www.lexaloffle.com/bbs/?tid=35088 Fri, 16 Aug 2019 05:08:42 UTC Floppy Launcher <p> <table><tr><td> <a href="/bbs/?pid=66238#p"> <img src="/bbs/thumbs/pico8_floppy_launcher-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=66238#p"> floppy_launcher</a><br><br> by <a href="/bbs/?uid=4737"> egli</a> <br><br><br> <a href="/bbs/?pid=66238#p"> [Click to Play]</a> </td></tr></table> </p> <p>I built a Raspberry Pi <a href="http://markegli.com/pi">PICO-8 console that uses floppy disks</a>, but SPLORE doesn't work great for browsing a floppy: you have to wait for the preview image of a cart to load before you can scroll past it. For a disk with more than one or two cartridges on it, this is a frustrating experience. Additionally, SPLORE is a little finicky about reloading the floppy contents if you swap out the disk.</p> <p>To get around this, I boot this cartridge instead of booting into SPLORE, which provides a quicker floppy browsing experience and correctly picks up a new disk if you choose &quot;reset cart&quot; from the menu. It's a pretty rough hack, but I'm sharing it here in case anyone finds any pieces of it useful.</p> <p>Obviously running it here on the BBS is an exercise in futility.</p> <h4>Revision 1 (2019-08-03)</h4> <p>Added: scrolling when there are more than 15 carts</p> <h4>Revision 2 (2022-11-27)</h4> <p>Added: ability to load subdirectories<br /> Changed: update usage of <code>ls</code> and <code>cd</code> to account for changes in PICO-8 v0.2.2 and v0.2.5<br /> Fixed: minor scroll indictor bug<br /> Fixed: crash when loaded from the BBS or SPLORE</p> https://www.lexaloffle.com/bbs/?tid=34910 https://www.lexaloffle.com/bbs/?tid=34910 Wed, 31 Jul 2019 08:17:55 UTC