LED indication feedback on selected PAGE with Mapping Assistant

I have no idea how to write a script but with forum’s help I have a basic script to use with my BCF2000. I did some mapping with Cubase’s Mapping Assistant and I chose the 1rst row of BCF’s buttons to be for PAGE navigation, plus the 4rth of the side buttons be a SHIFT button.
My promblem is that I have no LED indication when I press one of these buttons. I need somenone to provide me the script command for those.
I appreciate some help here. Thanks in advance.

You can see the part of the code I am interested in below

//-----------------------------------------------------------------------------
// 3. HOST MAPPING - create mapping pages 
//-----------------------------------------------------------------------------
function onActivatePageDefault(context) {
}

function makePageWithDefaults(name) {
	var page = deviceDriver.mMapping.makePage(name)
	page.setLabelFieldText(pagename, name)
	return page
}

//-----------
//SEL page
//-----------
function makePageSEL() {
	var page = makePageWithDefaults('SEL')
	page.setLabelFieldHostObject(selTrackName, page.mHostAccess.mTrackSelection.mMixerChannel)

	return page
}

//-----------
//SEL shift page
//-----------
function makePageSELShift() {
	var page = makePageWithDefaults('SEL shift')
	page.setLabelFieldHostObject(selTrackName, page.mHostAccess.mTrackSelection.mMixerChannel)

	return page
}

//----------------------------------------------------------------------------------------------------------------------
// Construct Pages
//----------------------------------------------------------------------------------------------------------------------
var pageSEL = makePageSEL()
var pageSELShift = makePageSELShift()

pageSEL.mOnActivate = function (context) {
	onActivatePageDefault(context)
}
pageSELShift.mOnActivate = function (context) {
	onActivatePageDefault(context)
}

Anyone that could help please?

If the BCF2000 leds respond to midi messages (which I think it does though I never checked this device’s midi implementation) you can send the appropriate midi message inside the yourPage.mOnActivate event.

Something like this:

pageSEL.mOnActivate = function (context) {
	onActivatePageDefault(context)
    yourMidiOutput.sendMIDI(context,midiArrayOfBytesHere)
}

You have to know what midi message your device expects to light up the led(s). Usually it is enough to send out the very same midi message received, for example if upon pressing a button the device sends a midi CC 24 at channel 0 with value 127, it should be enough to send this back:

yourMIDIOutput.sendMIDI(context,[0xb0,24,127])

Thank you for replying.
I do not understand this section of code: “yourMIDIOutput”. Is there any replacement I should do?

Yes. You have to replace it with the name of the variable you assigned the MIDI output port of your device.

So, the assigned button is ch.1 CC#72 and I inserted this section but it doesn’t send back any indication

pageSEL.mOnActivate = function (context) {
	onActivatePageDefault(context)
    midiOutput.sendMidi(context,[0xb0,72,127])
}

Can you post the part of the code where you do this assignment?

//-----------------------------------------------------------------------------
// 3. HOST MAPPING - create mapping pages and host bindings
//-----------------------------------------------------------------------------
function onActivatePageDefault(context) {
}

function makePageWithDefaults(name) {
	var page = deviceDriver.mMapping.makePage(name)
	page.setLabelFieldText(pagename, name)
	return page
}

//-----------
//SEL page
//-----------
function makePageSEL() {
	var page = makePageWithDefaults('SEL')
	page.setLabelFieldHostObject(selTrackName, page.mHostAccess.mTrackSelection.mMixerChannel)

	return page
}

//-----------
//SEL shift page
//-----------
function makePageSELShift() {
	var page = makePageWithDefaults('SEL shift')
	page.setLabelFieldHostObject(selTrackName, page.mHostAccess.mTrackSelection.mMixerChannel)

	return page
}

//----------------------------------------------------------------------------------------------------------------------
// Construct Pages
//----------------------------------------------------------------------------------------------------------------------
var pageSEL = makePageSEL()
var pageSELShift = makePageSELShift()

pageSEL.mOnActivate = function (context) {
	onActivatePageDefault(context)
    midiOutput.sendMidi(context,[0xb0,72,127])
}
pageSELShift.mOnActivate = function (context) {
	onActivatePageDefault(context)
    midiOutput.sendMidi(context,[0xb0,92,127])
}

Not this part.

I want to see the part where you define the button midi assignment. If you’re not sure where this is, you can post all your source code here and I will have a look.

I am not sure if I am allowed to do this here because i didn’t write the code. Can I send you a pm?

Sure.