Log In  

Cart #modul_8-4 | 2023-09-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

Modul-8 allows you to create music in PICO-8 with three channels of 2OP PM synthesis.

Features

With a look based on PICO-8's built-in tracker, Modul-8 was created to be as simple as possible to not only save CPU space but also make it more accessible when it comes to inputs. The tracker uses both standard PICO-8 buttons and mouse input; while the arrow keys are used to move across the grid and the O/X butons (Z/X keys) are used to cycle through notes, the mouse is used to control the instrument and playback options. While the PM synthesis Modul-8 uses is very basic, it still allows you to craft some interesting sounds by controling the volume, ADSR and frequency multiplication of both operators. Tunes created with the tracker are always looped, but the overall lenght of the track and the loop point of each pattern are adjustable.

File Format

Despite the confusing nature of Modul-8's text-based file format, tunes can be saved very easily. Pressing ctrl+c after saving is needed on the BBS and pressing ctrl+v beforehand is mandatory if you want to load a track. To keep your saved files, you'll just have to paste them in a word processor, or you could even share them here! For anyone who's curious, the format contains the values for the tune's format header, speed, size, loops, instrument variables and note sequence (including instrument changes) in that order.

Demo

To demonstrate Modul-8's capabilities, here's a six pattern long demo loop:

modul_8,2,6,14,6,16,14,6,16,16,0,5,0,0,1,2,0,5,0,0,3,6,0,5,0,0,1,3,1,5,0,0,3,16,0,5,0,0,1,8,0,5,0,0,1,16,0,5,0,0,1,2,0,2,0,0,3,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,24,1,19,1,22,1,19,1,27,1,22,1,24,1,27,1,22,1,25,1,22,1,30,1,25,1,27,1,-1,1,-1,1,10,1,17,1,22,1,11,1,18,1,23,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,21,1,19,1,28,1,16,1,19,1,21,1,19,4,21,1,19,1,28,1,16,1,19,1,21,1,16,4,19,1,21,1,24,1,19,1,22,1,19,1,27,1,22,1,24,1,27,1,22,1,25,1,22,1,30,1,25,1,27,1,-1,1,-1,1,26,1,21,1,14,1,24,1,19,1,12,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,18,1,21,1,23,1,26,1,30,1,26,1,21,1,28,1,25,1,21,1,26,1,23,1,18,1,25,1,21,1,16,1,16,2,24,2,19,2,22,2,19,2,27,2,22,2,24,2,27,2,22,2,25,2,22,2,30,2,25,2,-1,2,-1,1,27,2,10,2,17,2,22,2,11,2,18,2,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,23,2,21,2,19,2,28,2,16,2,19,2,21,2,19,2,21,2,19,2,28,2,16,2,19,2,21,2,16,2,19,2,21,2,24,2,19,2,22,2,19,2,27,2,22,2,24,2,27,2,22,2,25,2,22,2,30,2,25,2,-1,1,-1,1,27,2,26,2,21,2,14,2,24,2,19,2,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,12,2,18,2,21,2,23,2,26,2,18,2,26,2,21,2,28,2,25,2,21,2,26,2,23,2,18,2,25,2,21,2,12,3,-1,1,-1,1,-1,1,0,3,-1,1,-1,1,3,3,-1,1,-1,1,-1,1,15,3,-1,1,-1,1,-1,1,-1,1,10,3,-1,1,-1,1,11,3,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,9,3,-1,1,-1,1,-1,1,4,3,-1,1,-1,1,7,3,-2,2,7,3,4,3,-1,1,7,3,-1,1,9,3,-1,1,12,3,-1,1,-1,1,-1,1,0,3,-1,1,-1,1,3,3,-1,1,-1,1,-1,1,15,3,-1,1,-1,1,-1,1,-1,1,2,3,-1,1,14,3,12,3,-1,1,-1,3,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,11,3,-1,1,-1,1,-1,1,11,3,-1,1,-1,1,9,3,-1,1,-1,1,6,3,-2,3,4,3,-1,1,6,3,-1,1

Code by MegaSparky.
Released by MoonShine's PICO-Crew subgroup.
Thanks to Bikibird and Luchak for helping with and providing code for PCM playback in the PICO-8 server! (also used in Moonshine's PICO-Patch)
Special thanks to other members of MoonShine and the PICO-8 server!

P#132420 2023-07-26 19:53 ( Edited 2023-09-17 18:45)

> At least at the moment, for some weird reason, Modul-8 seems to suffer a lot of lag on both the BBS and PICO-8 Education Edition.

I've always had issues with PCM audio in PICO-8 carts on the web, never been able to fix it.

P#132431 2023-07-26 21:31
1

@luchak It does work on the web now, though.

P#132546 2023-07-30 01:51
2

here's a song I made:
modul_8,8,1,16,16,0,1,0,0,1,0,0,0,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,16,0,5,0,0,1,33,1,40,1,33,1,47,1,28,1,40,1,28,1,43,1,31,1,40,1,31,1,47,1,24,1,40,1,24,1,43,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1

P#132745 2023-08-05 01:06

Track name: Settled On Night Mountaintops
Modul-8 Original Demo Song by SkylarZYX
Released by MoonShine/Pico-Crew (MS)
Date: 2023/10/21

https://cdn.discordapp.com/attachments/992533965116284928/1166228554070102078/sketch-1.txt

P#136459 2023-10-27 01:41 ( Edited 2023-10-27 01:44)

I think there's a problem with the sample scheduling? Using Control-P the CPU varies from like 90% to 10% each frame. (I'm actually not sure what the other numbers on that are, but stat(1) the main loop gives 80%-0% too). So it would seem like you're doing too much work half the time and not enough the next time.

My code has

local len=min(94,1536-stat(108))
local addr_end=0x4300+len-1
for addr=0x4300,addr_end do

I don't know how to properly port your code to this, but hacking it in give 45% as expected. (audio still plays)
But any method that doesn't schedule the max amount will leave some work for the next frame. AFAIK this should help :)

P#136892 2023-11-04 07:25

Oh and, I had some trouble importing. It seems triple clicking the snippets fails. https://evercoder.github.io/clipboard-inspector/ seems to show it picks up tabs at the front, so select the text carefully friends

P#136893 2023-11-04 07:29 ( Edited 2023-11-04 07:30)

I'm not figuring out how to load stuff, tried both with the embedded pico8 and the downloaded version.

P#136936 2023-11-05 02:41 ( Edited 2023-11-05 02:42)

[Please log in to post a comment]