fanatic606
New member
Hi,
few weeks ago my old Farfisa organs broke down as it used to do every couple months. Before it happened I have sampled to WAV file all notes and sounds from it.
As I've already had two-manuals great keyboard I decided to make my own MIDI keyboard out of it.
I've made some research and found ot that Teensy would be great. As I wanted to have lowest possible latency I bought newest teensy 3.6. I also got some MCP23017 digital IO extender and started to develop this new instrument. Farfisa keyboard doesn't have matrix connected keys. Every key has it's own wire sticking out from it. As you push the key, it connects to common wire which i decided to make grounded. Using Fritzing I've made circuit diagram to know how to deal with tons of cables. I have changed it many times but what you can see below reflect what has been done till now.
I still did not connect analog knobs, buttons and diodes. I'm trying to solve latency issue with all the keys connected. There are 88 of them!
I'm not so good at programming so maybe there is only need in optimising the code. At the beginning when I had only two MCP 23017 connected latency was unnoticeable. Right know there are about 1300 lines of code and all six boards are connected(two more will be connected soon). Latency is big and it really influences playing on it. I have recorded with microphone key click and sound coming out of speakers. I have done it with both codes - short and long one. Below you can see two audio waveforms compared to each other. Long code has about 140ms from hitting the button to playing sound. Short is about 70ms(with all boards physically connected but just not included in the code).
Both codes and other files you can find on https://github.com/fanatic606/Farfisa-Teensy-MIDI
(sorry I'm new to Github. I hope I uploaded everything right).
Please help me decrease the latency
p.s. How to make sustain pedal work? Is there any midi message for it or should I just make "if" function to don't change the value of notes to 0 when the key is pushed back?
p.s2. if I'm using midi channel 1 to notes from 5 to 100 and CC 0-4 and 101-115 do I have to use channel 2 for next 15 buttons? Or maybe I can fit it somehow on channel 1?
few weeks ago my old Farfisa organs broke down as it used to do every couple months. Before it happened I have sampled to WAV file all notes and sounds from it.
As I've already had two-manuals great keyboard I decided to make my own MIDI keyboard out of it.
I've made some research and found ot that Teensy would be great. As I wanted to have lowest possible latency I bought newest teensy 3.6. I also got some MCP23017 digital IO extender and started to develop this new instrument. Farfisa keyboard doesn't have matrix connected keys. Every key has it's own wire sticking out from it. As you push the key, it connects to common wire which i decided to make grounded. Using Fritzing I've made circuit diagram to know how to deal with tons of cables. I have changed it many times but what you can see below reflect what has been done till now.
I still did not connect analog knobs, buttons and diodes. I'm trying to solve latency issue with all the keys connected. There are 88 of them!
I'm not so good at programming so maybe there is only need in optimising the code. At the beginning when I had only two MCP 23017 connected latency was unnoticeable. Right know there are about 1300 lines of code and all six boards are connected(two more will be connected soon). Latency is big and it really influences playing on it. I have recorded with microphone key click and sound coming out of speakers. I have done it with both codes - short and long one. Below you can see two audio waveforms compared to each other. Long code has about 140ms from hitting the button to playing sound. Short is about 70ms(with all boards physically connected but just not included in the code).
Both codes and other files you can find on https://github.com/fanatic606/Farfisa-Teensy-MIDI
(sorry I'm new to Github. I hope I uploaded everything right).
Please help me decrease the latency
p.s. How to make sustain pedal work? Is there any midi message for it or should I just make "if" function to don't change the value of notes to 0 when the key is pushed back?
p.s2. if I'm using midi channel 1 to notes from 5 to 100 and CC 0-4 and 101-115 do I have to use channel 2 for next 15 buttons? Or maybe I can fit it somehow on channel 1?