Saturday 24 November 2018

microcontroller - Correct note frequency for STM32 based MIDI synth



I have been playing about with the EasyMXPro for STM32 dev. board from Microelektronica. I am trying to create a simple monophonic wavetable synth using the DAC, playable via. a MIDI keyboard, however, I have the following problems:


I have a loop that cycles through the wavetable values (at the speed of the MCU clock). The rate at which the program cycles through the array obviously gives me an incorrect frequency to that of the fundamental frequency of the sine wave in the wavetable. What is the best way to delay/speed up the execution of the program for each sample in the array, given that I need to cycle through the array at different rates for different notes on the keyboard? I have tried using a simple delay, however for each change in note frequency, the delay amount has to change specifically. Is there an easier way to do this that I have not thought about (perhaps using timers)?


Thanks in advance for any helpful answers!




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...