Uzebox music production

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
danboid
Posts: 1936
Joined: Sun Jun 14, 2020 12:14 am

Uzebox music production

Post by danboid »

After spending some time reading these forums and trying to write a Uzebox game myself, I know that a notable sore spot for Uzebox developers remains its music and sound production workflow / tool set. There currently is no nice and easy method to compose music for the Uzebox and get an accurate and instant preview of the track you're working on.

I will consider this issue fixed when we have a MIDI capable, Uzebox native app that enables the user to upload and edit patches without having to rebuild or reboot, allowing the user to hear exactly what their MIDI will sound like when played on the Uzebox. Alternately, a sample accurate Uzebox sound engine softsynth VST/LV2/CLAP plugin would also solve the music production problem. The latter is arguably better as its easier to use and access but its probably going to be easier and cooler to write the Uzebox native synth app first.

I was considering modifying Uzesynth/Musicdemo to allow users to load patch sets off SD or transfer them to the Uzebox via UART or sysex but unfortunately this isn't currently possible with the current kernel and sound engine, according to Uze:

"The current kernel (including the MIDI player subset) requires patches in FLASH. So even loading them via SD or via UART, you could not play them directly by the engine. It could make sense to re-introduce those "RAM patches" that were removed a long time ago, but perhaps just for the MIDI engine. Also, since games typically don't use the MIDI code (and RAM patches), I think it should be refactored out in it's own project. MusicDemo was just that, a music engine demo. So I would be more inclined to create a new "Uzesynth" project dedicated to a proper music instrument."

Hopefully Uze will re-introduce RAM patches soon so that we can use it to write a MIDI controlled, Uzebox sound engine synth that allows for the loading and editing of patches at runtime. I'd expect that the RAM patches would only need to be used for this app and then the same data could be stored in flash when its used in a game.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzebox music production

Post by Artcfox »

How about this for an idea:

Cuzebox has cycle-perfect emulation, and it emulates sound as well, perfectly. Why not turn it into a plugin for your apps, and internally, it could run Uzesynth as it is now, but your plugin could call into functions in the emulator's code to modify the sound patches in its emulated "flash memory". IIRC it has provisions for reading and writing flash memory, since it can run the bootloader and "flash games" within the emulator itself.

Sure it's a hack, but it should work. It would be kinda like a Uzebox Game Genie, changing the contents of the flash memory as the program running inside is reading it.
User avatar
danboid
Posts: 1936
Joined: Sun Jun 14, 2020 12:14 am

Re: Uzebox music production

Post by danboid »

Uzesynth as it is now can't be used as a base for a plugin like you suggest because Uzesynth would need to be recompiled every time the user wants to change a patch.
User avatar
danboid
Posts: 1936
Joined: Sun Jun 14, 2020 12:14 am

Re: Uzebox music production

Post by danboid »

When we have a more capable Uzesynth or whatever this new app gets called, one that allows for the loading and editing of patches then we might be able to add JACK MIDI support to cuzebox. That can then be used as a plugin via the Carla plugin host.

https://kx.studio/Applications:Carla

Or you could just uze it direct.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzebox music production

Post by Artcfox »

danboid wrote: Tue Feb 07, 2023 11:16 am Uzesynth as it is now can't be used as a base for a plugin like you suggest because Uzesynth would need to be recompiled every time the user wants to change a patch.
Re-read what I wrote. Cuzebox is an emulator. You can modify its code to do whatever you want. One of those things could be changing the emulated flash memory where the Uzesynth patches are stored, on the fly.
User avatar
danboid
Posts: 1936
Joined: Sun Jun 14, 2020 12:14 am

Re: Uzebox music production

Post by danboid »

danboid wrote: Tue Feb 07, 2023 11:26 am When we have a more capable Uzesynth or whatever this new app gets called, one that allows for the loading and editing of patches then we might be able to add JACK MIDI support to cuzebox. That can then be used as a plugin via the Carla plugin host.

https://kx.studio/Applications:Carla

Or you could just uze it direct.

I think I rushed that reply as I've been over this groud already on these forums. That isn't an option because cuzebox doesn't support UART.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzebox music production

Post by Artcfox »

danboid wrote: Tue Feb 07, 2023 2:47 pm I think I rushed that reply as I've been over this groud already on these forums. That isn't an option because cuzebox doesn't support UART.
Gotcha, the only USART support cuzebox has is for the RLE mode: https://github.com/Jubatian/cuzebox/com ... aaa4e98b99

Though it might be possible to "inject" the MIDI commands directly into a buffer inside Uzesynth in a similar manner to my idea of "injecting" the patch commands directly into flash memory, but proper support would definitely be better.
User avatar
danboid
Posts: 1936
Joined: Sun Jun 14, 2020 12:14 am

Re: Uzebox music production

Post by danboid »

First we should create an improved Uzesynth that has patch loading and editing as thast should be simple to write but eventually it would be good to see a Uzebox native tracker for editing Uzebox sound engine MIDI tracks and/or (4 channel) MOD or XM files, if Uze manages to write a mod player that is. The Uzebox will require the SPI RAM to play mod tracker files.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox music production

Post by uze6666 »

if Uze manages to write a mod player that is.
I would not hold my breath for that in the short term. ;) It's a lot of work and and don't have a lot of time unfortunately. And I need to finish and release my other project first.
User avatar
danboid
Posts: 1936
Joined: Sun Jun 14, 2020 12:14 am

Re: Uzebox music production

Post by danboid »

I've already posted this in the Klystracker thread but I wanted to post it here too:

"The player is able to play MOD/S3M/XM/IT music files that are stored in the MCU program memory and has been developed so that it can run within very limited memory and performance constraints while still producing decent sound. I originally developed the player for Arduino Uno, which has only 2KB of RAM, 32KB of flash memory and 8-bit MCU running at 16MHz."

https://github.com/JarkkoPFC/arduino-music-player

It might be easier to adapt this rather than write a MOD player from scratch? Its nice to know its possible but its also above my paygrade.
Post Reply