Skip to content

Commit

Permalink
Merge pull request #7 from mxmxmx/dev
Browse files Browse the repository at this point in the history
[CV2MIDI] latency tweaks
  • Loading branch information
mxmxmx authored Jan 25, 2019
2 parents 8aa7cfd + da8580a commit 79f0127
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
- teensy 3.2 based
- 10HP, depth ~ 35mm

### more info:

- [docs](https://github.com/mxmxmx/CV2Midi/wiki)

### DIY:

- [PCBs/panels](https://pushermanproductions.com/?s=cv2midi)
4 changes: 2 additions & 2 deletions software/C2M_X/APP_CV2MIDI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);
const int32_t CM_SCALE = 71000; // scale factor --> velocity (~ x 1.05)
const int32_t NUM_CHANNELS = 5;
const int32_t DOUBLE_CLICK_TICKS = 3000;
const uint8_t trigger_delay_ticks[NUM_CHANNELS + 0x1] = { 0, 4, 8, 12, 16, 24 };

class CV2MIDI : public settings::SettingsBase<CV2MIDI, CV2MIDI_SETTING_LAST> {
public:
Expand Down Expand Up @@ -142,8 +143,7 @@ public:
trigger_delay_.Update();

if (_triggered) {
// to do: use array with more evenly spaced values
trigger_delay_.Push(get_trigger_delay() << 0x4);
trigger_delay_.Push(trigger_delay_ticks[get_trigger_delay()]);
}
_triggered = trigger_delay_.triggered();

Expand Down

0 comments on commit 79f0127

Please sign in to comment.