chuck icon indicating copy to clipboard operation
chuck copied to clipboard

midi clock support

Open heuermh opened this issue 6 years ago • 4 comments

okay this, this is untested, but im pretty sure it is in the underlying RTMidi library (and not the chuck MIDI IO classes). In rtmidi.h line 176 there is a function 176: void ignoreTypes( bool midiSysex = true, bool midiTime = true, bool midiSense = true );

that function defaults midiclock ("midiTime") to true, turning it off I believe. The main midi callback then checks that later in midiInputCallback (function starting in rtmidi.cpp at line 343)- more specifically, it checks it at line 431 I believe as 0xF8 is hex for a Midi tick (clock). At line 433, it checks data->ignoreFlags by doing &ing 0x02, so Im pretty sure all you need to do is set the bool in the function initially to false, which will subsequently allow that code to pass through in the IO callback.

Really though, there should be a MIDI panel in the miniaudicle preferences, and settable in chuck terminal that you can flip that bool true or false to enable or disable midi clock as I agree with the comments that there is no point in having it receiving when unnecessary.

Migrated from https://github.com/spencersalazar/chuck/issues/6

heuermh avatar Jan 16 '18 17:01 heuermh

Is it the same as https://github.com/ccrma/chuck/pull/29 ? I saw midi clock not working in ChucK 1.2.x on my Raspberry Pi but working fine in ChucK 1.4.0 on my Mac. (never tried *audicle)

timurb avatar May 17 '19 04:05 timurb

@timurb It looks to me that #29 implemented the fix suggested above. It did not however make this a preference setting in miniAudicle or ChucK proper as mentioned in the third paragraph.

As such I'll leave it to @spencersalazar or others to decide whether or not to close this issue.

heuermh avatar May 17 '19 15:05 heuermh

are the flags in rtmidi.h - row 242 even used somewhere in the code? it seems like the code at row 120 in rtmidi.cpp is not called anywhere. from what I can see the flags are set in rtmidi.h row 280:

    RtMidiInData()
      : queueLimit(1024), ignoreFlags(5), doInput(false), firstMessage(true),
        apiData(0), usingCallback(false), userCallback(0), userData(0) {}
};

mariobuoninfante avatar Jul 04 '19 11:07 mariobuoninfante

actually this could confirm my theory https://github.com/ccrma/chuck/commit/20a5fcb20807ad735e859a1425b5d7a55f6523f6

mariobuoninfante avatar Jul 04 '19 11:07 mariobuoninfante