YM3812 Part 4 – MIDI Journey

Post Categories:   YM3812 ModuleTags:   ,,

6 thoughts on “YM3812 Part 4 – MIDI Journey

  • I´ve spent the last weeks feverly working in projects that use the YM2413 (OPLL) and the YM262 (OPL3) chips. I even dream of the registers table. Yep, even working on it, I had a lot of holes in my understanding, specially on the bitwise operations, that are still enigmatic and hellish to me…

    So, the equation of the previous post :
    regVal = (regVal & (~(bitMask<<offset))) | ((newVal & bitMask) << offset))

    And the associated macro

    #define SET_BITS( regVal, mask, offset, newVal) ((regVal) = ((regVal) & (~((mask)<<(offset)))) | (((newVal) & (mask)) << (offset)))

    And the crystal clear explanation is quite like a godsend. I will be heavily using it from now and probably your library too. So, thanks again for this delicious post entrances and sharing of your knowledge. Im enjoying every bit of it! 😀

    • This totally made my day, thank you so much for the kind words! Let me know how the YM2413 ends up sounding. I got it working but it always had a hum in the background that I couldn’t get rid of. I figured it was the breadboard, but I had a YM3812 working on the same board too and it stayed very quiet. The YMF262 is an excellent chip, I’m sure you will do really awesome stuff with that one!

  • Hi!

    Im coming back to read it again and I find your answer one month later, lol 😀

    Yeah, the 2413 is noisy as hell. You can look at my implementation in the arcane github but it has all kind of noises, digital noisettes filtering and probably the hum that you mention.

    There´s also an enourmous variance in the chips per se. Some are extra noisy and other quite silent, so you get 5-10 chips, prepare a standard setup and check every chip, so you will find which ones behaves and which ones are belong directly to the recycle bin.

    In my case the noise get way better once I used PCB instead of breadboard but it´s quite still there. Another thing that should work is to put resistors between the microcontroller and the 2413 lines. Prbably around 10-47k each to reduce currents. This should help with the digital noises. Also having a dedicated clean 5v regulator for it should help

    For the opl3 Im using the Maarten Jansen PCB, that works flawlessly perfect. But The catch here is that Im exploring running emulators, from the MAME, inside PICO and ESP32 chips and after 2 months of delirium I have it running!. Impressive stuff. I got the inspirtion for the guy running DOOM on a pi pico. That´s guy is so next level:

    https://github.com/kilograham/rp2040-doom

    That is so full of pearls.

    My emulators all glicth a lot and only run on overclocked PICO and on low sample rates (max 22000hz). The emus are written for PCs and it needs heavy optimizations and some assembler to more or less work.

    Im starting to try with the ESP32 and it´s way better than the PICO. It does manage floats natively, so it get quite a performance boost, but Im still adapting drivers for it

    Well, that´s it. I keep re-reading and studing your posts and videos. Top quality material.

    Waiting for the coming posts. Cheers from Spanien 😀

Leave A Reply

YM3812 Part 10 – Pitch BendYM3812 Part 9 – Synth CardYM3812 Part 8 – Velocity Sensitivity