UnicornConsole
UnicornConsole copied to clipboard
Audio support
Currently we don't have any audio support, let's add one !
Could be possible to use something like Sunvox tracker to provide an music engine? It has a C interface and provides very powerful creation system. I think that it could be a easy way to let carts make their own music while reducing the work required to provide a music engine.
Of course, it might provide more features than needed, and could impact the performance of the system.
Well my idea is to support classic audio format (MIDI/WAV/etc) and not to have a built in modular synthesizer in the project, and so to use external one.
Hi,
I want to thank you for PX8. I follow its development and it’s quite impressive. 8-bit + FOSS + programming the carts in Python = ♥
About this particular idea, IMHO it is not such a good idea, because:
- It will be completely incompatible with Pico-8, resulting in making PX8 unable to run Pico-8 carts with sound. I don’t say PX8 has to be 100% compatible with Pico-8, but this is a major issue; just as PX8 supports different fonts and palettes (‘graphic cards’), I see no reason it shouldn’t support multiple ‘sound chips’, one of them imitating Pico-8’s.
- Binary, opaque sound files are cumbersome, inelegant and huge. IMHO, it is preferable to go for neat, elegant and small solutions, which are transparent and can fit nicely in a plain text file (.dpx8).
- It goes against the 8-bit aesthetics. 8-bit computers used sound chips, making their sound so uniquely and universally recognizable. Using WAV/MP3 files breaks this. I think PX8 should not be just an ‘SDL wrapper’ audio-wise. MIDI has a completely different sound, which will be ‘inharmonious’ with the 8-bit aesthetics; MIDI, with a Sound Blaster-ish sound, goes with a different, early 90’s IBM PC, aesthetics.
- Having a ‘sound chip’ can enable carts access (RO or RW) the music data; an example.
- Pico-8 and actual retro hardware make use of quite simple wave forms. I don’t think it will be a hell of effort to re-implement something along similar lines, especially when there are many FOSS tools which can be used for this purpose.
I hope you will reconsider the idea of playing WAV/MIDI files as audio support :-). I’m sorry I cannot offer actual code for implementing this.
Júda
@rwmpelstilzchen yes sure I agree with you. I will add basic support like prototracker, mod/mml format. But I want to have also high level format too. Both are not incompatible 👍
Thanks :-)
My plan is the following:
- [X] audio support via SDL
- [X] Use libksnd to have the chiptune (here the ongoing binding: https://github.com/Gigoteur/chiptune-rs)
- [X] load kt/ki files
- [ ] Support to edit a music/instrument via the API
- [ ] Support mod/xm format
- [ ] Music/Instrument editor
Support for libksnd is added via https://github.com/Gigoteur/chiptune-rs.
Great news!
When I open it in Klystrack it plays much faster and in a higher pitch, though.
@rwmpelstilzchen It is possible ! I will add the possibility to access all options via the API
Audio support is working now. I kept only klystrack deps + sdl