220 Ohm resistor between optocoupler’s pin 6 & pin 8 to 1K Ohm and 4.7K Ohm between pin 7 & GND to 1K Ohm. It’s eliminate jitters and getting much sharper signals without drop.
And it’s not strictly required but I added a small capacitor between optocoupler’s pin 2 & GND for filtering out high frequency noise.
I think there’re some errors and not optimal part choice in the many MIDI circuit using a 6N138 opto floating around Arduino community. I’ll test with different opto like H11L1 or 6N137 soon.
Added velocity support. Volca Sample don’t listen velocity but support level change with CC msg so it’s now mimicking(?) velocity.
06 Mar 2020 : Now it’s filter out notes from other channels and only listening channel 16 (you can use any note on channel 16 to trigger 1~10 sounds on Sample). All other midi message will not getting through except clock, start, stop and continue(if you don’t need it just comment out from the code).
09 Mar 2020 : More compact code using setThruFilterMode(). Now all message passthru to Sample if it’s from MIDI Channel 16 (VolcaChannel).
12 Mar 2020 : New chromatic notes playing code. You can use MIDI Channel 1-10 for chromatic play each sounds or each note will trigger different sounds on MIDI channel 16.