Reply To: Demo panel for MIDI receive/transmit routines

Home Forums General Using Ctrlr Demo panel for MIDI receive/transmit routines Reply To: Demo panel for MIDI receive/transmit routines

#73313
human fly
Participant
  • Topics: 124
  • Replies: 1070
  • Total: 1194
  • ★★★★

more: have tidied up script into a re-usable:

function restoreBank()

	-- This variable stops index issues during panel bootup
	if panel:getRestoreState() == true or panel:getProgramState() == true then
		return
	end

-- retrieving BankA
	bankA = L(panel:getModulatorByName("lcd_bankDataA"):getComponent():getProperty("uiLabelText"))

	local memB = MemoryBlock(bankA)

	local size = memB:getSize()

	if size == 80 then

	local prog1Data 	= memB:getRange(0,20)
	local preset1 = prog1Data:toHexString(1)

	local prog2Data 	= memB:getRange(20,20)
	local preset2 = prog2Data:toHexString(1)

	local prog3Data 	= memB:getRange(40,20)
	local preset3 = prog3Data:toHexString(1)

	local prog4Data 	= memB:getRange(60,20)
	local preset4 = prog4Data:toHexString(1)

	panel:getComponent("lcd_presetData1"):setPropertyString("uiLabelText",""..preset1)
	panel:getComponent("lcd_presetData2"):setPropertyString("uiLabelText",""..preset2)
	panel:getComponent("lcd_presetData3"):setPropertyString("uiLabelText",""..preset3)
	panel:getComponent("lcd_presetData4"):setPropertyString("uiLabelText",""..preset4)
	end
end

here’s another version of the panel – it can write to the external, receive it,
and restore previous now. still a bit fiddly to observe this but does work.
probably on the wrong track re: midi and preset routines but does what i set
out to do (so far). ‘send prog’ is now an idea for copying presets/data?

Attachments:
You must be logged in to view attached files.
Ctrlr