Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
755 Views

MIDI Manager

Hello, 

 

I'm working on a little project, basically a synth made of motors. 

My entry is a MIDI keyboard connected to my cyclone IV and the output is 8 pwm channel connected to the motors in order to create a sound. 

With the help of this forum I have been able to deal with the receiption of the MIDI signal, basically an UART. 

 

Now I'm trying to figure out the best choice concerning the architecture of my MIDI manager, I came up with two solutions and I need some help to decide what is best. 

 

The MIDI signals used are made of 3 bytes :  

  • 1st is NOTE ON (0x90) or OFF (0x80) + channel ( fixed to 0 in my case ), <=> key pressed or released 

  • 2nd is the NOTE NUMBER <=> wich key 

  • 3nd is the velocity <=> how hard you push the key (not used in my project) 

 

 

1st solution : 

Create 8 oscilators connected to my outputs. Each oscillator frequency could be set. 

Then, when NOTE ON is received I have to check if there is an free oscillator and transmit the right frequency command accordingly to the NOTE NUMBER . 

When NOTE OFF is received I have to check if there any of the oscillators activated for this frequency and disable it if found. 

 

2nd solution : 

Create an oscillator per frequency, about 48 in my case. Each oscillator could be activated or not.  

NOTE ON received activate the corresponding oscillator, NOTE OFF received disable the corresponding oscillator. 

In that case oscillators aren't connected directly to the outputs and there must be a system to link the activated oscillator(s) the output(s). 

 

Any advice would be helpful !
0 Kudos
2 Replies
Highlighted
Valued Contributor III
7 Views

Re: MIDI Manager

What kind of motors are you using, how are they intended to generate a sound? By audible PWM frequency or by a specific rotation speed (e.g. driving a ratchet)? 

 

Besides this special point the project is surely doable, just demanding your powers of imagination (or more specifically your logic design skills).
0 Kudos
Valued Contributor III
7 Views

Re: MIDI Manager

Just floopy drive motors, the frequency of the note is equal to the PWM frequency. 

I've Never heard about driving a ratchet, it's sound fun too, maybe for my next project !
0 Kudos