Log In  

PB-0x

A demake of a software groovebox from decades past...

Pattern mode is nearly complete! There's a mixer section, pattern storage, and a few editing tools. Good thing, too, since I think I'm coming up at the limits of what the Pico-8 CPU can reliably handle.

WARNING: Be careful if you play this cart on the web! Audio playback performs poorly on some OS/browser combinations and you may get loud crackling or popping noises. Turn your volume down before playing for the first time. If you have browser trouble, try it in native Pico-8. Or in a forthcoming native app export that I'll probably put up somewhere!

Cart #pb0x-4 | 2022-01-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
16

Instructions

  • Arrow keys select buttons/knobs/etc.
  • Z/X change control values. (Z is down, X is up)
  • The autorepeat rate speeds up while you hold a button down.
  • Step buttons for drums: gray is off, red is an accented hit, yellow is a soft/unaccented hit.
  • Step buttons for synths: gray is off, red is a normal note, yellow is a slide. Bright red/yellow are accents.
  • Note buttons: the little dots indicate octaves.
  • You can save/load patterns to/from the clipboard in the pause menu. There's basically no error checking so you can easily crash/freeze the cart this way if you load in a misformatted or invalid pattern. Also, this seems to not work in the web player.
  • You can also clear the sequence from the pause menu.

Status

More editing features are sorely needed, and the device enable toggles (mute buttons or pattern enable? not sure) are not yet implemented. Otherwise, pattern mode is more or less done, leaving me with around 3k tokens for song mode and parameter automation.

The code is by and large a complete mess, though the sound driver is maybe of tolerable quality.

What's missing:

  • Tuning: sound quality, parameter ranges/scaling and synth accent behavior need help too.
  • Copy/paste on PiRC
  • Device mute or pattern enable toggles (not sure which one to do)
  • Probably some other editing tools: copy/paste notes only, clear single device only, etc.
  • Highpass filter on delay feedback? (if CPU allows)
  • Highpass filter on overdrive input for drums? Overdrive on the drums isn't super useful right now.
  • Master HP/LP filter or selectable filter insert. Only if CPU allows. Even then, I'll be lucky to squeeze 1 in, doing this per-part is extremely unlikely. Or perhaps a master high/low shelving EQ? ... but were would the controls go? Or, wait, what if I scrap overdrive for drums (since it sounds awful there) and do a filter on drums only? Synths already have a filter, after all.... It could just be a simple non-oversampled biquad, hopefully I have at least enough CPU for that.
  • Song mode and automation (the big one)

Please do not expect saved patterns to work at all in future versions.

Updates

v0.0

  • Initial version

v0.1

  • Added second synth
  • Better sequence loaded on start
  • Added clear sequence option to pause menu

v0.2

  • Added drum machine (BD/SD/CH only)
  • Master compressor
  • Mockup for mixer/transport/pattern selection UI
  • Various tweaks and fixes

v0.3

  • Finished drum machine - PiRC
  • Fixed compressor somewhat
  • Added mixer with overdrive (insert) and delay (send) per part
  • Removed overdrive/level controls from devices (those are on the mixer now)
  • Tempo, shuffle, and basic transport controls
  • Delay time and feedback controls
  • Reworked input handler to save CPU
  • Copy/paste pattern controls on PBL (still needed on PiRC)
  • Transpose pattern control on PBL
  • Increased max key repeat rate to 60Hz
P#104006 2022-01-01 09:58 ( Edited 2022-01-04 03:14)

Also, if anyone has thoughts on how to:

  • make loading from clipboard work in the web player
  • make PCM audio reliably crackle-free on the web (Chrome on Mac is a problem here)

... let me know!

P#104022 2022-01-01 17:04

@luchak

Loading from clipboard worked "mostly fine" in the web player for me on the original version of the cart you posted - I believe it worked because I pressed ctrl+v before selecting the option in the pause menu. (I use Firefox on Windows.) (I believe that just using the option in the pause menu alone or ctrl+v alone was not enough. Perhaps someone else knows more about the details of this, or perhaps you can experiment and see if pressing ctrl+v helps get it to work for you.)

Chrome seems to be a problem. I posted about it on Android in 2019, and I have seen others post about it since then. I think that the only person who might be able to do something about it - if something can be done via Pico-8 - is @zep

P#104028 2022-01-01 17:48

@remcode Thanks! Pasting into the cartridge in Chrome on Mac seems to interpret the text as button presses, or something like that, but I'm glad to know that other browsers are working better.

I opted to require both ctrl+v and pause to load since I liked the idea of using the clipboard as a sort of checkpoint or undo buffer, and I couldn't find a way to detect the ctrl-v event without modifying clipboard state. I'll admit it's not the most intuitive, though, and there's probably a better way.

It also makes sense that audio playback issues are out of my control. I'd hoped for a different answer but oh well!

P#104031 2022-01-01 17:59 ( Edited 2022-01-01 18:01)

Hi @luchak. Kicking beat, I think I understand 0% of what you're doing here but it sounds great. :)

Regarding the clicking, as I've edited audio in the past what you need to do is create a bridge between the two sounds that blend.

So you could have sound #1 and sound #2, played in order you get a click. So you need to create a counter-sound between the two or ... create code that ends #1 gently and begins #2 gently.

Sony Soundforge has this ability built in as a tool called Repair and Interpolate. For Pico-8 coding, it may be easier.

Also I am running Firefox v95.0.2. Your clipboard ability load/save to and from notepad works just fine here.

P#104032 2022-01-01 18:12 ( Edited 2022-01-01 18:15)

@dw817 Thanks for checking out the clipboard stuff! Glad to know it's working there. Not sure why my browser is being so fussy. On the sound front, I certainly wish I could just lowpass the output and be done with it, but given that the problem is happening only in some browsers, and not in native Pico-8, I'm pretty sure the issue isn't on the synthesis side. I've tried messing around with buffer lengths and audio update timing to avoid the dropouts, but no luck...

On a completely different note, this new version probably doesn't deserve its own update, since nothing new is interactive - but putting even a simple hardcoded quarter-note kick behind everything makes it sound so much better!

(Cart deleted - current version has drums now!)

P#104039 2022-01-01 20:23 ( Edited 2022-01-02 22:10)

Very well done, super impressive technically and the UI is quite usable with a d-pad. I'm also a huge fan of a certain antique software synthesizer and the analogue boxes that inspired it :) Props for doing the 909-style accents on the sequencers.
The alias-ey quality of the sound reminds me of the Korg DS-10 from the Nintendo DS.
For me, sound was crackly/dropping out on Firefox on Win10 but fine on iOS15 browsers.

P#104144 2022-01-03 01:35

@Logarhythm thanks for the kind words! I was hoping someone else here would be familiar with the inspiration.

Using the d-pad for this is admittedly a bit strange, but I think it feels a bit more authentic (whatever that means), plus if I ever find a portable console that both plays Pico-8 and supports PCM I'd love try taking this on the go. Of course that might mean giving up on saved documents....

I'm hoping to have some tokens left at the end for mouse support, but song mode + param automation have dibs on the ~3k tokens I have remaining at this point. Not sure if that'll be enough, but it'll have to be.

P#104177 2022-01-03 08:41

This is a phenomenal piece of work.

P#104178 2022-01-03 08:44

I'm having some trouble here. There are a few things that I want to do, I think all of them are pretty important, and I'm basically out of screen real estate. These things are:

  1. Add a song mode. This will probably require the top row of the screen for transport controls, loop start/length, record toggle, etc. Yeah, this mimics Rebirth's song mode, which I wasn't a big fan of, but why build all of this fun synth-looking UI if you can't use it? Also it does feel pretty tactile, which I like, and it doesn't require entirely new logic to do assemble some kind of alternate editor. I can still bolt that on after if there's room.

  2. Add copy/paste controls not just for the whole sequence, but for individual patterns, so they can be copied between storage slots, or between the two synths, or even between documents. The janky-looking copy and paste icons on the PBLs are my best guess at where to place this type of control. (Hopefully the icons can at least look better though.) Adding a "copy notes only" or "copy parameters only" button would also be good.

  3. Add transpose (to PBL) and clear track (to PBL and PiRC) controls. Again, I think these might have to be placed on the actual devices.

  4. Add a tune knob or +1 octave toggle to PBL (or maybe just a fourth octave in the notes is fine?)

  5. Add an accent strength control to PiRC.

I could probably do (1) pretty easily if I didn't want to do the rest, but I can't think of how to get 3+ of these at the same time in the current screen layout. A few proposals, none of which seem ideal to me:

a. Drop the green "enabled" toggles in the top mixer row (non-functional at this point anyway), as well as all per-device mixer knob labels. Now each device's pattern/mixer section is only 3 rows, giving me a spare row at the top! Huge con: the volume/overdrive/fx send knobs are all completely unlabeled. I don't want people to need to consult an outside reference every time they make a mixer adjustment.

b. Move pattern select onto the devices. On PBL this can probably be made to work, on PiRC I'd likely have to get rid of the section dividers which I think is going to feel super ugly and cramped. Even then, finding 8 tiles worth of space on the PBL front panel will be a bit of a squeeze. (Though maybe the dials can be shrunk and labels truncated to 2 chars to fit in a more PiRC-like layout?) Both devices might also look a bit janky since the step buttons will need to run the full width, but the panel above them will be split between pattern select and device surface. Perhaps this can be smoothed over visually? And added bonus: I can lay the mixer out as a grid and trash some duplicate labels for even more space?

c. Move mixer controls onto the devices. There are fewer controls to move, which makes life easier, but if I'm only going to move one of these things to sit with each device, it feels weird that mixer controls are the one that gets moved.

d. Squeeze PBL dials and labels onto one row. Problem: labels will be squished into possible unrecognizability, and there won't be a lot of copy and paste icon space on the device. Though maybe I can stick copy/paste icons in the header? But in that case I'm not sure how to specify which device is being copied from or pasted to...

e. Kill the tone/decay labels on PiRC so I can shorten it by one row. This has the same problem as (a) - now you just gotta remember which one does which. Plus it leaves that device really short on utility icon space.

f. Move to a non-8x8-quantized system of control placement. This could potentially make the UI prettier as a side effect. Unfortunately: not only will this be super annoying to implement well, I'm worried that it will make navigating the UI confusing, since with a less regular layout the focus indicator will jump around a lot more, instead of tending to move in straight horizontal or vertical lines.

In almost any foreseeable world the device and cart logos are gonna have to go, and I'm not sure how I get out of this without the design feeling painfully cramped, even compared to the somewhat-cramped current one.

I think (b) might be the winner in my mind for now, but I'm not thrilled about it, and I'd love other suggestions if anyone feels like they understand what I'm trying to do and thinks there might be something I've missed. Commentary on the options above is of course welcome as well!

(Last thought: if I only have room for 8 pattern buttons per device, I think that might have to be 4 banks of 4 ... 16 patterns is maybe enough to make a song, but 8 is really pushing it. I guess the bank selector can just be a spinner control and I can have any number? Don't want to do that with patterns, though, don't want a race-against-time feeling for pattern changes.)

P#104245 2022-01-04 03:06 ( Edited 2022-01-04 03:19)

Ah crap, compact-ifying the PBL knobs is suuuuuper ugly and hard to read. Control labels are such a problem for this UI....

P#104254 2022-01-04 05:14

I'm looking to get some bugs fixed and (hopefully) get the save data format finalized before I post a new version of the cart, but I've been making some progress. Song mode is in with event automation, and it looks like everything should scale at least to songs of a few hundred bars.

I've done a bunch of work on trying to improve the audio quality, too, or at least as much as is possible at a 5.5kHz sample rate.... The big "discovery" there was putting some gentle fixed highpass filters on the synth oscillators and in the synth filter feedback path, those really cleaned up the sound a lot. (Quotes around discovery because this was new to me, but common knowledge elsewhere.)

(excuse the memory stats in the upper left...)

I'd also love to get in some more sound design features (one more drum? an assignable BP/LP filter?) and some richer editing tools if I have the CPU, tokens, and screen space...

P#106694 2022-02-11 08:00 ( Edited 2022-02-11 08:25)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2022-11-30 04:38:17 | 0.049s | Q:30