He/Him | Hu/En/some Jp | ASD | Bi | C/C++/D/C#/Java

  • 24 Posts
  • 191 Comments
Joined 1 year ago
cake
Cake day: March 16th, 2024

help-circle

  • Basically by transpiling, I’m converting commands to a format with absolute time position rather than the current relative one, so I don’t have to deal too much with the relative wait commands, seeking would be easier to implement rather than one using relative positions, and I wouldn’t really have the issue with inserting extra commands when relative jump commands exist. As I said, the textual format already have some macros that function in similar vein, such as the [0]: note 0 0x7FFF s.:a-5 macro, that automatically inserts noteon and noteoff commands at the appropriate places when processed, and also jump commands use labels similar to some unstructured programming stuff.

    I think I’ll try to work on a game for a while, then peek into someone else’s code that had similar problems on how they actually did it.

    As for the MIDI 1.0 limitations:

    • More than 16 channel implementation is a bit tricky, and I really didn’t want the composer to rely on automatic polyphony handling real time (which would likely conflict with sound effects, etc.), nor wanted to deal with that too on top of everything else.
    • Precision issues with Control Change commands, and I wanted most if not all things to be controlled via MIDI easily rather than aggressive preset swapping or SysEx commands. Some special functionality still uses SysEx, like global waveform changing in the FM synth, where you basically command to change one of the 128 possible waveforms to be changed to a custom parameter-generated one. The only thing that cannot be done from MIDI is specifying path for files, which is intentional since it would mess with real-time features.
    • Adaptive soundtracks. To my knowledge, there’s not a whole lot of formats for this, let alone ones that are known to be open, and even then many don’t go much farther than maybe mixing a few extra tracks they can swap-in, mute, etc., while mine could manipulate instrument parameters, pitch, etc. Instead of going the route of downloading easymp3playback.dll and easymp3playback.h (originally I used sdl-audio), I went with my own audio solution, and since my engine already was custom tailored for “retro pixelart”, I doubled down in that direction, and went with a pretty lo-fi sampler and an FM synth so far.



  • This will just lead to more low-quality code.

    I instead recommend using more productive languages. I’ve heard many good things about Rust, if you can deal with the OCaml-like syntax and the functional paradigm by default. As an alternative I can also recommend D, it doesn’t have the “const by default” issue of Rust (functional paradigm is still possible, you just have to opt-in), a very C-like syntax except more refined, memory safety features (3 levels of memory safety + arrays with bounds checking), at the cost of a bit hard to opt-out garbage collector (you also have to opt-out from many D features and the already scarce library ecosystem).


















  • It also depends on the usecase. It likely can help you better at throwing webpages together from zero, but will fall apart once it has to be used to generate code for lesser-discussed things. Someone once tried to solve an OpenGL issue I had with ChatGPT, and first it tried to suggest me using SDL2 or GLFW instead, then it spat out a barely working code that was the same as mine, and still wrong.

    A lot of it instead (from what I’ve heard from industry connections) being that the employees are being forced to use AI so hard they’re threatened with firings, so they use most of their tokens to amuse themselves with stuff like rewriting the documentation in a pirate style or Old English. And at the very worst, they’re actually working in constant overtime now, because people were fired, contracts were not extended, etc.