scanner-darkly / multipass

app development for monome eurorack modules and other platforms
GNU General Public License v2.0
29 stars 9 forks source link

Teletype gate interrupt handler has incorrect event type #7

Closed shankararunachalam closed 4 years ago

shankararunachalam commented 4 years ago

In multipass/monome_euro/libavr32/src/init_teletype.c, line 81 defines the event for the gate interrupt handler. The event type is given as kEventTrigger. This doesn't work since in multipass/monome_euro/main.c the trigger event handler handler_tr is mapped only to an event type named kEventTr.

The fix would be to change the event type in init_teletype.c to kEventTr. Alternatively, we could change main.c, but init_ansible.c also uses kEventTr for its interrupt handler. So, it is better to just fix it in init_teletype.c and have main.c continue to only react to kEventTr.

I found the issue while trying to use the trigger inputs of TT. After the suggested fix, the TT triggers are received properly.

I will submit a pull request for the same. Thanks!

shankararunachalam commented 4 years ago

I didn't grasp that libavr32 is a submodule. I guess fixing main.c in multipass is an easier proposition. we could assign the same handler_tr to both kEventTr and kEventTrigger event types. I tested that fix and it works as well. Will make the pull request for this change instead.

@scanner-darkly, does that make sense or would you propose a different fix?

scanner-darkly commented 4 years ago

i remember there was weirdness around that, thank you for fixing it! don't know if you saw, i posted doc on how to use voice allocation and note functions: https://github.com/scanner-darkly/multipass/wiki/voices-and-notes

shankararunachalam commented 4 years ago

Thanks for merging. Yes, I saw the document just today morning. Thanks for putting that together! Highly useful. I didn't realize that you already had the note_v functions for microtonal scales. I coded for set_cv since I only noted the chromatic semitones in music.c file. The voice mapping approach will make the code more flexible. So, I am going to try switching to voice mapping with note_v instead, and see if all my code still works well.

scanner-darkly commented 4 years ago

yeah, the cool thing about it - it simplifies i2c implementation since all you have to do is assign a voice to an i2c device and enable the leader mode!

shankararunachalam commented 4 years ago

Ah, nice! Time to hook up Just Friends to play nice with my code :).

scanner-darkly commented 4 years ago

for JF also remember to add set_jf_mode(1); to enable the synth mode