Home Forums General Programming Program Change verus Sysex

This topic contains 3 replies, has 2 voices, and was last updated by lfo2vco lfo2vco 4 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13020
    lfo2vco
    lfo2vco
    Participant

    OK, back on the project after a forced break (my wife was very ill in hospital, she’s much better now).

    How do I get a Lua method that sends a Sysex message thus:

    pg = CtrlrMidiMessage({0xF0, 0x7F, 0x7F, 0x60, 0x01, 0x00, 0xb0, 0xc0, 0x00, 0xF7})
    panel:sendMidiMessageNow(pg)

    To replicate a uiSlider modulator that sends a Program Change? I can see in MIDI Monitor the first is sent as:
    [07:36:46:000187]: [System exclusive] RAW:[f0 7f 7f 7f 60 01 00 b0 c0 00 f7]
    and the second is sent as:
    [07:16:54:000025]: [Program change] RAW:[c0 00]

    In the SourceForge classes web page under LMidiMessage.cpp I can see “isProgramChange” listed. Can I apply this to the CtrlrMidiMessage above and if so how? I guess the next question is why does the MIDI Monitor only show two bytes being sent as a Program Change?

    #13026
    atom
    atom
    Moderator

    Program change is 2 bytes: http://home.roadrunner.com/~jgglatt/tech/midispec/pgm.htm

    The sysEx looks exactly what it should look like.
    To send program change send just the tow bytes no need for any SysEx.

    #13027
    lfo2vco
    lfo2vco
    Participant

    Cheers for the fast response Atom.

    Before posting the question on the forum one of the messages I tried was:
    pg = CtrlrMidiMessage({0xc0, 0×00})
    panel:sendMidiMessageNow(pg)

    Which I take to be correct from your reply. However this caused the synth to start sending continuous streams of data, even when switched off and on again. I could only stop it when I quit Ctrlr!

    I guess that there is something I missed off the message or method. I’ll dig around a bit : )

    #13036
    lfo2vco
    lfo2vco
    Participant

    Haha, I am an idiot!

    I had the synth selected in MIDI Input, Controller & Output, thus was creating a right royal MIDI loop… so now all seems sorted.

    So I now have:

    if ret == 1 then
    	msb = 0xc0
    	lsb = 0x00
    elseif ret == 2 then
    	msb = 0xc0
    	lsb = 0x01
    end
    
    msb_lsb = CtrlrMidiMessage({msb, lsb})
    panel:sendMidiMessageNow(msb_lsb)
    
    DumpRequest = CtrlrMidiMessage({0xF0, 0x7F, 0x7F, 0x7F, 0x60, 0x01, 0x00, 0x03, 0xF7})
    panel:sendMidiMessageNow(DumpRequest)
    end
    

    This is part of the Popup Menu panel I am working on.
    http://ctrlr.org/forums/topic/popup-menu-experiment
    I will put an attachment of the finished panel over there, it might help someone else try to do something similar.

    Cheers again Atom

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.