I have built a very successful midi musical instrument using a Arduino Uno that plays wav samples on a Sparkfun`s Tsunami wav player. This uses Martin Nawrath's FreqPeriod library for converting a hand cranked optical encoder`s output to map speed of turning to playing volume. The rotary encoder has one phase wired to the Uno`s comparator pin and the other comparator pin tied high. When read by FreqPeriod this gives 'wheelPeriod' range of values such as c. 6000 (4 revs/sec) to 50000 (1/2 rev/sec) .... 1 rev/sec = (1/600) *16us = 26666.66. This all works well.
I would dearly like to use a Teensy to expand the scope of my instrument as I have run out of pins using the Arduino Uno.
So (like on the Uno) I am trying to use the Paul Stoffregen “FreqMeasure” Library to continually measure the elapsed time during each cycle of a 600 pulse per turn optical encoder , (using only one phase attached to pin 3 of an Teensy 3.2).
This will be used to map the pulse size to continually vary midi volume with speed of handle turn.
Unfortunately on the monitor I can only see a measurement perhaps once every twenty-five seconds or so. I need a reading for every pulse for this to work.
My question is ; What am I doing wrong / is this “FreqMeasure” suitable for this , if not how can I achieve the result I am after?
Attached post plays midi notes to the Tsunami board ok and will hopfully give readings of encoder pulse width ( to be incorporated in mapping volume).
I would dearly like to use a Teensy to expand the scope of my instrument as I have run out of pins using the Arduino Uno.
So (like on the Uno) I am trying to use the Paul Stoffregen “FreqMeasure” Library to continually measure the elapsed time during each cycle of a 600 pulse per turn optical encoder , (using only one phase attached to pin 3 of an Teensy 3.2).
This will be used to map the pulse size to continually vary midi volume with speed of handle turn.
Unfortunately on the monitor I can only see a measurement perhaps once every twenty-five seconds or so. I need a reading for every pulse for this to work.
My question is ; What am I doing wrong / is this “FreqMeasure” suitable for this , if not how can I achieve the result I am after?
Attached post plays midi notes to the Tsunami board ok and will hopfully give readings of encoder pulse width ( to be incorporated in mapping volume).