draeron / golaunchpad

Pure go library for controlling a Novation's launchpad controller
5 stars 2 forks source link

undefined rxDAW, rxMidiIn, rxMidiOut #1

Open temamagic opened 3 years ago

temamagic commented 3 years ago

Hi there!

image

temamagic commented 3 years ago

Hmm... I'm on MacOS

image

wow, I didn't know that the choice of OS depends on the file name in this case

temamagic commented 3 years ago

I'm trying to fix that, and i see some strange

image

Here Ins, but returns Outs.. is it correct? or on mac it looks another?

draeron commented 3 years ago

hi there! Darwin wasn't mentioned as being supported because I haven't tested it.

So yeah, the name varies depending on (I guess) the midi driver. On linux there doesn`t seem to have have any id/count to differentiate devices so I only support one. There should be 3 devices but depending on the OS the midi in/out can be the same device. So my guess is that darwin return 2 midi devices, the DAW and the MIDI. The MIDI one being IN/OUT even though it's name has OUT.

you could try something like this, it will use the midi out for input, might work (or not)

    rxDAW     = regexp.MustCompile(`.*LPMiniMK3 DAW OUT$`)
    rxMidiIn  = regexp.MustCompile(`.*LPMiniMK3 MIDI OUT$`)
    rxMidiOut = regexp.MustCompile(`.*LPMiniMK3 MIDI OUT$`)
temamagic commented 3 years ago

Seems works to me, i will test and send you PR

    rxDAW     = regexp.MustCompile(`Launchpad Mini MK3 LPMiniMK3 DAW`)
    rxMidiIn  = regexp.MustCompile(`Launchpad Mini MK3 LPMiniMK3 MIDI Out`)
    rxMidiOut = regexp.MustCompile(`Launchpad Mini MK3 LPMiniMK3 MIDI In`)

Btw, what about checks ins and outs before for's cycles?

So my guess is that darwin return 2 midi devices, the DAW and the MIDI.

And yes, looks like I have only 2 midi devices

temamagic commented 3 years ago

Well, now its work, but i receive some signal

2021-03-25T02:36:32.103+0300    INFO    main    midi/main.go:18 starting wave example
2021-03-25T02:36:32.124+0300    INFO    minimk3 minimk3/mk3.go:115      enabling programmer mode
2021-03-25T02:36:32.124+0300    INFO    minimk3 minimk3/mk3.go:165      sending wake message
receive signal urgent I/O condition

And i don't know what is that :)

draeron commented 3 years ago

I guess i accepted the merge request a little too fast hehe

I should add some kind of minimal cli for listings midi IDs. Also my gomidi dependency is quite old and might have some bug.

Maybe the out/in inversion in your patch creates some kind of exception. I just noticed you've put the midi in with a out name.

temamagic commented 3 years ago

As I asked above, in #issuecomment-806244760 outs come from ins, and ins from outs, idk why, but it works for me, for ex on text I think we could try i find solution :)