Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Editing DCO program to be a slow LFO?

edited October 2018 in General

Heya, I am using the DCO as an LFO but I am trying to make it oscillate even slower. I changed one value in the DCO program that makes the bottom threshold a little slower, but I'm wondering if there are any settings you could recommend for me to tweak it further? Thanks. :)



  • Hi! Try this:

    lines 148-151, replace with

      //Timer Interrupt Generation -timer 0
      TCCR0A = (1 << WGM01) | (1 << WGM00);  // fast PWM
      TCCR0B = (1 << WGM02) | (2 << CS00);   // 1/8 prescale
      OCR0A = 49;                            // Divide by 400 - 20kHz
      TIMSK = (1 << OCIE0A);                 // Enable interrupt on compare match

    line 175, replace with

    ISR(TIMER0_COMPA_vect) {

    You can try different timer settings, see here.

    I have the LFO pending so I'm going to get on with it later this year. My course of action would be to simplify the DCO, and then try a variation of the above, or alternatively construct a higher-resolution timer to get slower but more precise waves. Anyway, see how that goes!

  • Perfect! I edited OCR0A to = 130 and got my desired result. Also FYI for anyone else, if you want to start at the lowest octave change around line 162 from getMappedFreq(1) to getMappedFreq(0). :) Thanks again!

  • awesome!!
  • PS: God damn this LFO opened up a ton of possibilities. :) Thanks again. I'll have some great demo videos for you in the future.

Sign In or Register to comment.