Log In  


Hey @zep!

Can you please add a feature to PICO-8's WAV export function, so that each of the four channels have one WAV file each? I've been wanting to do oscilloscope views of PICO-8 chiptune music, but the "oscilloscope view" format requires one WAV file for each channel (so that each channel is seen as a separate waveform).

I've already mentioned you on Twitter about this, but you never replied:
https://twitter.com/StinkerB06/status/1182348172548399104
https://twitter.com/StinkerB06/status/1174923908128002048

1


Sure! What else??


why not simply mute the channels?


That's what I want. Implementing it shouldn't be too hard.


1

I mean - you can do it.
There is no need to add this feature for that single use case!


@StinkerB06, how about this ?

Cart #rubaseruzi-0 | 2019-10-19 | Code ▽ | Embed ▽ | No License

This will play each of the first SFX tracks of demo music from @zep. It also saves them off as individual WAV files.

HOPE THIS HELPS !


@dw817 That seems to work, awesome! I'll perhaps modify your code to fit my needs.

However, the only problem is that this may not work with all songs made on the PICO-8, especially ones where different SFX SPD's are used on the same music-frame number.


Glad to help. And yeah, it may not work for everything. But enough to get you started so you can examine their wave tables in sync.


1

Apologies for this late reply. There's a workaround I found that requires up to 3 looping SFX (for muting up to 3 channels) that don't actually make any sound, and uses extcmd() calls to start and stop audio recording at the correct moments.

Doing this several times and combining the WAV files together in Audacity, I managed to create a full-soundtrack oscilloscope view of POOM.


1

There's a couple edge cases this can't handle, although I did my best, but:

Cart #packbat_exportstems-0 | 2021-07-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Download the cart, replace the music and SFX data with whatever you want to export, and run it. It will go through each channel, replace each SFX in every other channel with an equivalent blank SFX - the same SPD and looping if it loops, the same length in music ticks otherwise - and then save the results to the music and SFX ROM of [channel number].p8 (so, 0.p8, 1.p8, etc.). If it runs out of SFX to create blank SFX in, it'll disable the other channels, export it that way, and print a warning.

You will then need to open each one of those to export the music as a .WAV, but that should be faster than waiting while an extcmd("audio_rec") finishes playing. If you would rather have it record instead, you could replace

	local filename=channel..".p8"
	print("exporting to "..filename)
	cstore(0x3100,0x3100,0x1200,filename)

with something like

	print("recording audio starting at\n music "..liverecord)
	extcmd("audio_rec")
	music(liverecord)
	local t0=t()
	repeat flip() until stat(24)==-1 or t()-t0>tmax
	extcmd("audio_end")

where liverecord is the index of the first pattern of whatever music you want to export and tmax is the length you want to cap the recording to.



[Please log in to post a comment]