mOnTitleChange and mOnColorChange do not fire as expected/bank selection

Win10/C 12.0.52b393:

I currently testing the new Midi Remote and want to be able to tell the Remote Controller the track names and the track colours. So I provided callbacks for the mOnTitleChange and mOnColorChange which are working in general.

But: When I change a trackname, when I change a track color or when I reorder tracks (names and color are moving with the tracks, so they change), I see, that these often trigger, before the change is finished, but after the change, they are not called or not called completely.

With not completely I mean, when I change a trackname, the callbacks are mostly triggered before I finish editing the track name. Then when I am done with editing, only a hand full of tracks send mOnTitleChange and mOnColorChange. Very often the track that was edited is missing.

When changing a track color, I could see, that callbacks were triggered when the color popup opens, but there is no trigger, when the color was really changed.

Since mOnTitleChange and mOnColorChange trigger also for tracks that were not touched, there is little hope to see the changes happening while you continue working, but without any further action, there is not updated with the latest values.

Hi,

Could you attach your script, please? Where do you put the mOnTitleChange and mOnColorChange in the script?

It’s not complete and please don’t wonder, it’s code generate, so it contains a lot of repetition.
BeMi_RemoteTouchControl.midiremote (87.2 KB)

Hi,

This is a *.midiremote file. Do you have the source *.js file by any chance, please?

This is the .js file. I changed the type, because I was not allowed to update *.js. Just change the ending.

When you change a track’s name using your keyboard, the track is selected automatically.
Try using

page.mHostAccess.mTrackSelection.mMixerChannel.mOnTitleChange

instead of

channel0.mOnTitleChange

or other channels as well.

1 Like

But that requires, that I know, which track is selected. Is there a way to find out in mMixerChannel.mOnTitleChange which mixer bank channel the current selected on is? The name alone is not enough, I need the MixerChannel number.

Hi,

What is your use case, please?

When you edit a track’s name it is automatically selected.
Try this (just for reference, do not copy paste):

var hostMixerBankZone = page.mHostAccess.mMixConsole.makeMixerBankZone()

Loop here to push bank channels
mixerBankZoneChannels.push(hostMixerBankZone.makeMixerBankChannel())

For each bank item, define these:

var channelBankItem = mixerBankZoneChannels[index]

channelBankItem.mValue.mSelected.mOnProcessValueChange

The mOnProcessValueChange will give you an arg2=1 if selected.

1 Like

The use case is that my external Remote Controller is another software running on a Tablet. Thus I would like to have an always up-to-date list of all tracks on the tablet. That means title, color, channel type and all in the order as Cubase displays them. All will be displayed as buttons on the screen. When I tab on a button, Cubase shall be able to select the track that belongs to the button, when I move the finger on the button, Cubase shall change the volume of that channel and I also want to see the metering on the button. So I need “complete” project information on the controller to always have direct access to all channels.

Hi,

Thank you for the clarification.

MIDI Remote is not designed to have an overview of all tracks in the project. It is designed to have an overview of a specific number of tracks/channels, which you bank together.

This means, you could do a workaround to make the bank of all tracks when you load the project (or when you load the page) and then keep working in this bank. The question is, how you would find the size of the project. You have to find the last track some way. You could do this for example to compare the previous track and the new track. If the Name, Color, Volume, Pan… are the same, you would expect this is the same track as the previous one, so you would consider this as the last track.

So it look something like this:

var hostMixerBankZone = page.mHostAccess.mMixConsole.makeMixerBankZone()
	.excludeInputChannels()
	.excludeOutputChannels()

var maxTracksCount = 10000 // Or any reasonable number

for (var i = 0; i < maxTracksCount; ++i) {
	if (testPreviousChannelHasSameValues()) break
	var channelBankItem = hostMixerBankZone.makeMixerBankChannel()
	...
}

Another way is, you could make the Bank of Outputs. Then you would make the bank of all channels (including the Outputs). Once the track would have the same parameters as the 1st Output, you would say the previous one is the last one.

// Output Channel
var outputMixerBank = page.mHostAccess.mMixConsole.makeMixerBankZone()
	.includeOutputChannels()
	
var outputMixerBankChannels = outputMixerBank.makeMixerBankChannel() // This is the very 1st Output Channel
page.makeValueBinding(surfaceElements.masterFader.mSurfaceValue, outputMixerBankChannels.mValue.mVolume).setTypeDefault()
1 Like

My old technique was to scan the project channel by channel. Opening the EditChannelSettings dialog and then use Windows API to read out the text in the title bar. And since the Output was always the last channel, the controller knew the name of the output. As soon as it was reached it stopped scanning. Ok, it took some time, but after that I had a list of all tracks and instruments. When there is no better way I might stick to that.

The idea is not to have hundreds of channels, its more to have some kind of remote control, that can use Cubase as a multitrack recorder like in the 80ies. So 32-64 Tracks are enough for that.

What is your encoders’ number?

What do you mean by encoders?

The number of your faders/controls. The point is, you surely have a finite number of them. Thus, you should create a bankZone with this number as its size. Then, the API will expose all corresponding params of the tracks in this zone, and you can send them to your controller, be it Android/IOS etc. Bind the track index on your valueChange listeners and your app should read them and modify its list/map/array accordingly.

I plan is to have 128 Tracks in on bank and only use one bank. Maybe 64 Tracks will also be enough, but I thing 128 is a good number.

Controls in sum? Per track Volume, Metering, Solo, Mute, Rec, Select. Using 128 Tracks, the number of controls might go up to 1024. And therefore only one bank.

Banks are only an argument when you have hardware encoders. But if you have a software controller, I would scroll though the tracks rather then switch through the banks.

Even in software you should use the concept of banks to avoid overloading. Keep in mind that Cubase processes many many properties, thus we should really take this into account and set our mixer size to an optimum size.
In your case, just fix your mixerBankZone to 128, prepare a bank change pair of buttons or a swipe left/right method (you never know if a user exceeds the 128 limit, I personally do exceed this due to multiple takes on different tracks).
All the parameters that you describe are sent from Cubase. Receive them via binding each index to its mOnProcessValueChange and you’re done.

Hi,

Even though I agree with @m.c in the idea to keep using banks even in the software controller.

At the other, I’m also building a software controller and it would be nice to have a list of all tracks, where I can select from.

@bemi , have you tried it, please? I tried to write the code and I didn’t succeed. At the moment of making the mixerBankChanel, MIDI Remote doesn’t know (and doesn’t care) if the channel slot is empty, or if there is a real channel. Do you have any idea, please?

Tried the isActive value of the color change event? In an empty slot it should return 0,at least so I handle it.

Sadly, other parameter are not available like Punch In/Out, Midi/Audio Recording Modes, Recording Modes in general and such stuff.

Theoretically I could introduce banking, but how would I deal with this odd behavior. Sets say I have a project with 19 channel. And bank size of 8 channels.
From left to right

  1. bank 1-8
  2. bank 9ch-16
  3. bank 12-19
    and back.
  4. bank 12-19
  5. bank 4-11
  6. bank 1-8
    How does the controller know the start and the end channel. Or is there a parameter, that can informs the controller about first and last channel of current bank?
    The other think is, if you want to move ch1 and ch19 simultaniously, you’ll need to jumb constantly between the banks.