Log In  


Cart #machine_yearning_port-2 | 2026-10-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

This is a PICO-8 port of Linus Åkesson's 4-kilobyte album Machine Yearning, which was originally written for a Commodore 64 outfitted with two SID chips. It uses PICO-8's PCM capability to crudely emulate the SID chip, which is driven by the same "mini-programs" that constitute the original album. The VM that executes these programs was reverse-engineered from the C64 machine code and re-implemented in Lua for this cart.

My original goal with this project was to incorporate the music into my under-development game Nimble Knights, but as the project ended up being both large and CPU-intensive, it may or may not actually end up there. But I still felt pleased enough with the result that I wanted to post it as a standalone cart.

The original version of Machine Yearning was released under a CC4-BY-NC license and is used here under that license. Note that Åkesson was not directly involved in this creating this port and bears no responsibility for any of its flaws.

The PCM SID-emulation code in this cart is partially based on code from Andre Weissflog's chips and Attila Grosz's "tedplay".

Thanks to bikibird, Packbat, and SmellyFishstiks from the PICO-8 Discord for their help with debugging!

P.S.: My personal favorite tracks, and the ones that I think probably survived the porting the best, are 1, 2, and 6.

14


1

wow, this is so cool, ive just gotten into demos and making music barely a few months ago and im discovering new stuff every week that makes me want to hear even more. i havent gotten into the code for this cart (i havent even finished listening to the whole album yet) but i had a question, whats the board with all the numbers, im halfway guessing it has something to do with pico 8 memory but im really not sure and i dont think you had written it (though it might also be a commodore thing in which case i absolutly have no clue whats going on) but in any case this is just so cool


2

Thanks! The numbers at the bottom are basically a view of the data being written to the emulated SID-chip, as well as a little bit of data about the internal state of the emulated chip. (I originally put most of it on the screen for my own debugging but I quickly decided that I wanted to keep it just for the sake of looking cool.)

A more detailed explanation follows. Screenshot for reference:

There are six voices, three for each chip. The leftmost column shows the current state of that voice ("Attack"/"Decay"/"Release"/"Frozen"). These basically correspond exactly to the states a voice can be in on the SID chip and this bit of state-management is more or less lifted entirely from "chips"/"tedplay".

The second column has a > symbol for voices being passed through their SID chip's filter. The bright green numbers in the center-right encode the cutoff frequency for each filter as well as which filter modes (Low/Band/High pass) are being used. Voices without a > symbol are added directly into the audio output. (Note that the encoding for filter cutoff frequencies is different from the encoding for the frequencies being played on the voices; there's a slightly complicated formula I lifted from chips that translates the hex code shown there into an actual frequency.)

The third column is a hexadecimal representation of the frequency that voice currently plays at. The SID data sheet has both a lookup table and a formula for converting this hex representation into an actual frequency.

The fourth column represents the Attack/Decay/Sustain/Release parameters to the envelope generator for that voice. Essentially it controls how the volume of the voice evolves over the course of a note. (e.g., does it hit max volume quickly, or does it start quiet and slowly get louder?) Appendix B of the SID data sheet has a better discussion of the envelope generator and the ADSR parameters than I'd be able to give here.

The fifth column shows the control register for that voice. Mostly that means it shows whether the voice is actively playing or not (in its least-significant bit) as well as picking out the waveform for the voice.

The yellow numbers are the global volume for each SID chip, which can range from 0 to 15 (F). And the rightmost column is a view into the current internal state of the envelope generator, showing how loud that voice currently is relative to its chip's global volume.


1

This is so baller!! Had to double check that I read the title correctly lol, I love this album and thought maybe it was too obscure to hope for a PICO-8 port. I like the added crunch from the PCM here. I also appreciate all the technical info on display in the cart and will have to dig in when I have some time.


1

Keys [1] through [6] seem to isolate and un-isolate tracks. Good for study! I would have gladly experienced the Commodore times. Lucky for us there's Pico-8! Having a great time with this, thank you for building it! I checked the SFX / Music section and it doesn't seem to be there just sayinn. <3


@skipperd I'm glad you're enjoying it! The original album did only come out in 2023, so, hey, arguably it's still the Commodore times.

As for the SFX/Music section, are you referring to this section of the BBS? My understanding is that the intent of that section is for posting things that could easily be dropped into another game, and given that this thing ended up quite heavy token and CPU-wise, I'm not sure that it's as relevant there as something implemented using PICO-8's native tracker.

Nice work discovering the solo feature! There's one other disabled-by-default feature that might be useful for study, which is that if you search the cart for "load_zeropage", you'll find that the _init function has some commented-out code to install "save zeropage" and "load zeropage" options into the pause menu. This basically lets you save a place in the song and skip directly to the saved place. The reason I commented it out is that it is potentially dangerous: saving a zeropage from one song and loading it into a different song could put the second song into a completely unexpected state and might result in harsh sounds being generated. So, you might find it useful if you're trying to analyze one specific passage of a song, but please be careful with it if you want to play around with it.


1

That's the section I was referring to but I didn't realise it was intended like that. The musical era is audible but the personal memories that your work livens up for me are legendary tales of older kids behind computers who could make digital music on the spot that their whole class would dance to at secret school parties and for long I imagined that software to look something like this. I interpret Machine Yearning as such a great title to describe that memory. Let's agree it's still the Commodore times then because I love listening to how the mystery might have sounded while seeing it operate. I'll be careful.


1

This is really great!


1

Thanks to everyone for their initial interest in this port! It was pointed out to me by pancelor that the lack of an auto-advance from one track to the next was a somewhat surprising omission, and that was an easy feature to add, so I've updated the cart to add an autoplay. It's on by default, but can be toggled off in the pause menu as desired.


I recently noticed a bug where Voice 3 was sometimes not being muted when it was supposed to be. (I think this was particularly evident in Track 3, "Formula Too Complex".) I've just uploaded a new version of the cart fixing that bug.



[Please log in to post a comment]