MIDI Remote API: Calling `setProcessValue` in `mOnChange` callback crashes the host

The following minimal repro Midi remote crashes Cubase when being activated (Error: A serious problem has occurred […]):

var midiremote_api = require("midiremote_api_v1");
var deviceDriver = midiremote_api.makeDeviceDriver("company", "device", "author");
var myHostValue = deviceDriver.mSurface.makeCustomValueVariable("myValue");
var page = deviceDriver.mMapping.makePage("Default");
page.mHostAccess.mTransport.mTimeDisplay.mPrimary.mTransportLocator.mOnChange = function (context) {
  myHostValue.setProcessValue(context, 1);
};

Repro steps:

  • Place the above code in Steinberg\Cubase\MIDI Remote\Driver Scripts\Local\company\device\company_device.js
  • Start Cubase, create an empty project, and add and activate the “company - device” midi remote surface

System info:

Cubase 12.0.52, Build 393 , no 3rd-party VST plugins installed, running on a VirtualBox 7.0.4 Windows VM with

Edition Windows 10 Pro
Version 22H2
OS build 19045.2486
Processor Intel(R) Core™ i7-4790K CPU @ 4.00GHz 4.00 GHz
Installed RAM 8,00 GB
System type 64-bit operating system, x64-based processor
1 Like

My apologies if this should rather be a new thread; I think it might be another (of many?) symptom of the same problem.

When activating the MIDI remote script

var midiremote_api = require("midiremote_api_v1");
var deviceDriver = midiremote_api.makeDeviceDriver("company", "device", "author");
var myHostValue = deviceDriver.mSurface.makeCustomValueVariable("myValue");
var page = deviceDriver.mMapping.makePage("Page");
var subPageArea = page.makeSubPageArea("SubPageArea");
var subPage = subPageArea.makeSubPage("SubPage");
subPage.mOnDeactivate = function (context) {
  myHostValue.setProcessValue(context, 0);
};

and pressing “Reload Scripts” in the MIDI Remote Scripting Tools, Cubase crashes with a similar error message.

I’ve attached the dump files of both crashes:

Hope this helps!

Hi @bjoluc,
Thank’s for reporting. A fix will be included with the next update.

3 Likes