YM3812 Part 10 – Pitch Bend

Post Categories:   YM3812 Module

4 thoughts on “YM3812 Part 10 – Pitch Bend

  • Tyler,

    Please don’t stop here!

    Peter

    • I definitely got distracted by a few other projects. Maybe I will try circling back around to this one again :).

  • Hi Tyler,
    Thanks for the series of articles and the great videos! I have been wanting to experiment with vintage FM chips for a few years so discovering your articles was a great boost.
    I made a batch of 5 FM Synthcards for myself and some friends. In doing this I’ve spent a while looking at the freeze-on-start issue. I think it’s related to how SPI is being done. I made some mods that improve things a bit, in my fork on GitHub. (I’m phad there)
    My next step is to use this as a springboard for Eurorack. Currently I’m trying to use the AVR’s ADC to provide a V/oct input, but having a lot of difficulty understanding the data sheet to set this up.
    I think you’ve done a Eurorack module with YM3812, from your earlier videos? Can you share some code snippets to help me get going with analog input?
    Thanks!

    • Hey Paul, so sorry for the late reply. I had to sift through about 3,800 spam comments before finding yours!

      I just took a look through your updates on github and I think you are right on the money with the SPI commands. I will try fiddling with it and see if I can make it work. Also, did you notice any difference with the delay on the initialize clear? I haven’t noticed an issue with that, so I’m interested to hear.

      Also, I really like your idea of adding the reset controller command. I will try and get all of that incorporated into the next round of code. (Probably video 12 as video 11 is basically done).

      Regarding the AVR’s ADC, take a look at the code for Etch on my github. This was a module I built in collaboration with Modular for the Masses.
      You should be able to use a standard “analogRead( PIN )” command to read the input, just keep in mind that it is a 10-bit value so you have to use a uint16_t to store it. Now, the DAC is an entirely different animal it has some crazy commands to set up:

      // Set up the DAC
      PORTD.PIN6CTRL &= ~PORT_ISC_gm; // This sets up the interrupt service routine, but don’t ask me how
      PORTD.PIN6CTRL |= PORT_ISC_INPUT_DISABLE_gc; // It’s assigning magical constants to unknowns parts locked away
      PORTD.PIN6CTRL &= ~PORT_PULLUPEN_bm; // in the deep recesses of the micro’s memory. But it works!
      DAC0.CTRLA = DAC_ENABLE_bm | DAC_OUTEN_bm | DAC_RUNSTDBY_bm; // This just turns on the DAC.

      And then when you write to it, you have to take your 10-bit value and shift it over to the left by 6 bits:
      DAC0.DATA = output << 6; // Set the DAC output How did the Synthcards work out? Cheers!

Leave A Reply

YM3812 Part 9 – Synth CardYM3812 Part 8 – Velocity SensitivityYM3812 Part 7 – Percussive Maintenance