Jump to content

Legacy bug? Midi_evnt.inc


Anderaj

Recommended Posts

I've been a long time user of MIDIBox64, on the PIC platforms.  I realize this is old legacy hardware, but I recently repurposed some of the modules to use as a controller for the Arturia CS80 and Cherry Audio GX-80 soft synths. 

I've been ignoring this problem for a while,but I finally decided to look at it in more detail. My problem is that program changes don't work. No matter how  I adjust the  config file the  MIDIBox64 will only send program change 0.  Channel info is always correct.  I will see C1 0, or C3 0, etc. but the 0 never changes, regardless of what program number is in the config file.  I know this worked at one time - here's what I found:

MIDIBox 64 V2.4f, MIOS V1.9H, running on a PIC 18F - program change doesn't work correctly.

I went back and looked at the code for the 2.4 version that I had previously installed many years ago.   I noticed I had created corrected hex file and then remembered I had edited the Midi_evnt.inc file and recompiled the application.

I loaded my older recompiled 2.4 version and now program change works.

 In the excerpt below, you can see my correction note for version 2.4   Below that is the code for 2.4f, which won't send program change correctly.   I thought in some earlier rev of the application Thorsten had a bug fix in the same inc module for program change.

Has  anyone else encountered this, or is this too old to even discuss?

MBOX64 2.4 Midi_evnt.inc (corrected)

MIDI_EVNT_Send_Cx    ; Program Change
MIDI_EVNT_Send_Dx    ; Channel Pressure
    movff    MIDI_EVNT0, WREG
    call    MIOS_MIDI_TxBufferPut
    movff    MIDI_EVNT1, WREG        ;Changed to fix program change bug Dec 2015, Event1
    andlw    0x7f
    call    MIOS_MIDI_TxBufferPut
    rgoto    MIDI_EVNT_Send_End
---------------------------------------------
MBOX64 2.4f MIDI_evnt.inc

MIDI_EVNT_Send_Cx    ; Program Change
MIDI_EVNT_Send_Dx    ; Channel Pressure
    movff    MIDI_EVNT0, WREG
    call    MIOS_MIDI_TxBufferPut
    movff    MIDI_EVNT_VALUE, WREG
    andlw    0x7f
    call    MIOS_MIDI_TxBufferPut
    rgoto    MIDI_EVNT_Send_End

 

 

Link to comment
Share on other sites

Last time I worked on this was 2012, so 10 years ago... ;-)

MIDI_EVNT1 is a predefined value from the configuration, while MIDI_EVNT_VALUE is a variable coming from a controller (pot, encoder, button, ...)
What kind of controller are you using to send the program change event?

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks for the quick response Thorsten.  In past versions of the MIDIBox64, I used a momentary push button switch for program changes.  I'd have a bank of 10 discrete momentary switches to choose my favorite 10 programs.

In this version, I'm using a rotary switch for program changes, which may be part of the problem, but I did run an experiment with the latest configuration, eliminating the rotary switches. 

In my MIDIBox64 photo below, the rotary switches are on the right - Presets I & II.  For the experiment I reassigned the momentary push button switch (sub wheel) on the left (in red) to be a program change. The push button program changes worked on my previous MIDIBoxes.  Side note: the front panel says MIDIBox NG, but it's actually a 64.  I have the hardware to make the NG, and will eventually replace the electronics behind this. 

image.thumb.png.98f9b51c41c64906a44ebc18e0e4dd32.png

 

In the config file I assigned that Sub Wheel button to select program 1F.  I commented out the original button assignment

image.png.647c54ed2d09a4cd048ad6d65d9f8e53.png

 When running MIDIBox64 2.4f, this is what I see when I push the button - each button push sends a program 0 change.

image.png.675121d705d36389359435af48a78021.png

When I load my modified code for version 2.4, with the altered MIDI_evnt.inc file, and using the same config file,this is what I get for each button push, which is what I would expect.

image.png.1c063a102e6cd6a14cc30455ae387e93.png

 

It's been years since I looked at this problem, so I was trying to remember what I did. Playing with the new GX-80 synth got me thinking about it again.  I was just curious if I'm doing something wrong here.  The rest of the box works flawlessly.  That said, it's  a legacy system, and this is not a major problem for me - not worth spending a lot of time on.

regards,

AJ

 

Link to comment
Share on other sites

I think that the right fix would be in the mk_syx.pl script to copy $event_2 into $event_3 (which was always 0 for program changes), because this is the value which is picked up by MIDIbox64 2.4f

Here the appr. change: https://github.com/midibox/mios8/commit/d32c65cf38aa874d04f6880a769ac174dbe46d72

Best Regards, Thorsten.

P.S.: great frontpanel! :)

Link to comment
Share on other sites

Thank you Thorsten, I decided to use Front Panel Designer/Express for this latest MIDIBox.   I reloaded the 2.4f version of MIDIbox64 and used your updated mk_syx.pl script.  That solved the issue, program changes now work with the rotary switch selector.  I see what you did, a much more elegant solution. Many thanks and a Happy New Year to you!

regards,

AJ

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...