Log In  

So, as demonstrated by my recent post, I have finished my Pico-8 album, noclip. Now I want to export all the music from the cartridges. However, the exporter for music only exports one pattern. If you select multiple, it will simply export the one you just clicked on. Are there any tools made by the community which can export all the music from a cart and reconstruct it? Cheers in advance.

P#96870 2021-09-04 16:57

I'm no expert, but it exports full music fine for me: load the P8, switch over to the Music tab, choose the starting Pattern, hit Escape, "EXPORT TEST.WAV" gives me a full 4+ minute song WAV. You have to be on the Music editor tab (last tab) though.

P#97011 2021-09-07 17:02
1

From what I can tell, there are two built-in ways to turn PICO-8 audio into a .wav file. I believe both ways require audio to be not muted; the amplitude in the output file will be based on the current volume config setting.

Option A: export

If you move to a pattern (not select as in to copy+paste, scroll to as if you were about to start playing) and then hit Esc and type "export [filename].wav" at the command line, it will export music in the order it would be played until it hits a blank pattern, until it hits a stop flag, or until it hits 32768 music ticks (about 4:31), whichever comes first.

Edit: If the editor doesn't have the music editor open, I think it defaults to exporting an sfx instead - it will tell you what you did and you can course-correct if needed.

Option B: extcmd

If you run code something like this:

pattern = 0
extcmd("audio_rec")
music(pattern)

repeat
    flip()
until stat(24)==-1 or btnp(4) or btnp(5)

extcmd("audio_end")

then PICO-8 will play your music starting at the specified pattern until it stops (at which point stat 24 = -1) or until you press a button. Then it will export everything that played, however long. This is slower, but you can use it to export arbitrarily long pieces of music, and [edit: use something similar to record] any kind of generative music if you make music programmatically.

P#97017 2021-09-07 19:09 ( Edited 2021-09-07 19:21)
1

Thanks @packbat, I didn't know about the hard 32k tick limit, that puts a slight damper in using PICO-8 as a chiptune DAW...
When I exported my music I assumed it was detecting that it exported the same looped section a couple times and intelligently stopped.

And thanks for the workaround using audio_rec, instead of seconds that will take several minutes, but it's OK.

P#97128 2021-09-10 02:42
1

Yeah, I think I thought the same thing, @touk? I'm very glad the extcmd workaround functions, though, because using an external program to record PICO-8 is a pain if all you want is the audio.

P#97131 2021-09-10 03:04

Ah, it seems I have greatly misunderstood the way exporting audio works lol. I thought that it exports only the patterns selected and no further, which, as shown by @packbat's explanation of the command, is not the case. Thanks, I'm glad to be part of such a helpful community!

P#97191 2021-09-11 10:19

Hmm... I seem to be experiencing the same issue I posted a while ago where it only exports about a single note of audio. That's both solutions. Strange...

P#97192 2021-09-11 10:32

That's very weird.

Would you be up for sharing a cart with some music that's not exporting correctly? I could test if it's broken on my machine, too.

P#97195 2021-09-11 15:08

Cart #higumakeba-1 | 2021-09-19 | Code ▽ | Embed ▽ | No License

Here's an example with the first song in the album, SEEN. When I run the cart, it plays the music for the right amount of time, then stops, but the resulting audio is half a note.

P#97536 2021-09-19 10:41 ( Edited 2021-09-19 10:44)

@wallgraffiti Sorry for the delay! I did the export both ways and it worked fine both times? I have no idea why it wouldn't work for you.

P#97835 2021-09-26 04:53

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2022-12-05 00:52:27 | 0.051s | Q:24