mcp49xx dac and wavetables?

I'd like to experiment with an 8-bit SPI DAC (MCP49X Library) and wave table to make some noises, but not sure where to start as much of the code I've seen is for R2C ladders.

I guess I could try to adapt from the r2c examples, has some one tried this and could share some advice?


A library will give you a function or method to call to output a value.

You need to, on a regular time step, write a value to the DAC using this function.

Something along the lines of:

unsigned long last_time = 0L;
void loop()
  if (micros() - last_time >= DELAY)
    last_time += DELAY ;
    write_dac (table [index]) ;

    index = compute_next_index () ;

[ much left to be completed :slight_smile: ]

I’ve seen is for R2C ladders.

Do you not mean R2R ladders?

Look at the Adafruit wav shield code for examples of outputting to an SPI D/A.