Remote Script "unknown" error with delivering MIDI?

This forum is for discussing Reason. Questions, answers, ideas, and opinions... all apply.
Post Reply
minihilly
Posts: 10
Joined: 20 Jun 2023

12 Apr 2024

I made a custom Remote Script for my Oxygen Pro 61 MIDI keyboard controller a while ago, and I recently noticed an "unknown problem occurred" error get thrown whenver the Oxygen Pro is disconnected and I use my other controller (Axiom mini 32) to change selected sequencer track.

The problem seems related to what's going on in my remote_deliver_midi() function within my custom Oxygen Pro 61 remote script. Removing some code that delivers MIDI messages to update LED states of buttons on my hardware seems to avoid the error, but I do not understand why or what part of this is causing an error to begin with. Remote's debugger doesn't seem to work either, the remote.trace() functions appears to do absolutely nothing so I'm completely confused on what the issue is. It's really bugging me.

Here's an excerpt of code within remote_deliver_midi() that may be causing a problem:

Code: Select all

if g_mode_button_state == 1 then

    --check each led state on hardware, comparing with current bank and buttons mode set to "rec"

    for i, led in ipairs(g_fader_button_led_states) do

        local rec_index = bank_offset(i,8)

        local rec_state = g_rec_leds[rec_index]

        -- led bool != rec boolean => set led bool equal to rec bool, then pass led midi message to hardware

        if led ~= rec_state then

            g_fader_button_led_states[i] = g_rec_leds[rec_index]

            table.insert(ret_events,remote.make_midi(make_button_midi_hex_string(g_rec_leds[rec_index], g_fader_button_hex[i])))

        end

        if led == #g_fader_button_led_states then g_mode_button_state_old = g_mode_button_state end

    end

end
Some context: The Oxygen Pro has 8 LED buttons and a mode toggle that change the input messages of those 8 buttons. Additionally, the Oxygen Pro has 4 internal banks which also affect these button inputs. In total, the 8 physical LED buttons have 128 virtual states, and the code above is how I'm handling delivering the MIDI depending on the button state and bank.



I wrote this script many months ago and only recently noticed this error happening.
"unknown problem" tells me nothing about what the issue could be, so I thought I would ask here in case anyone has a better grasp of Remote Scripting.
Sorry if this is the wrong place for this thread.

electrofux
Posts: 864
Joined: 21 Jan 2015

16 Apr 2024

If i had to make a guess than i would say the issue is likely in the call of remote.make_midi, wich in turn calls make_button_midi_hex_string.

First thing i'd do is check wether the constructed midi message is correct.
When i get those not very helpfull error messages i often resort to deleting code line by line to see when the error message goes away.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests