Remote Script "unknown" error with delivering MIDI?

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

Post 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])))


        if led == #g_fader_button_led_states then g_mode_button_state_old = g_mode_button_state 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.

Posts: 873
Joined: 21 Jan 2015

Post 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.

Posts: 260
Joined: 23 Aug 2016

Post 09 May 2024

I've had this error before too and in my experience it is normally to do with variable values either being nil or over 127 or sometimes failing to add the F7 at the end of a sysex or the sysex message being over 1024 bytes.
Try adding in conditions to check for nil values for example if you are working with blocks of 8 channels and the last block only has 7 active channels, you may be getting nil values for the last channel.
good luck
:rebirth: :recycle: :reason: :re: :refill: :refillpacker:
youtube @johnsexton8082

  • Information
  • Who is online

    Users browsing this forum: CommonCrawl [Bot], gritz and 5 guests