Home › Forums › General › Programming › what do you need to know in order to make panels?
- This topic has 45 replies, 5 voices, and was last updated 3 years, 2 months ago by
goodweather.
-
AuthorPosts
-
December 31, 2014 at 3:18 pm #34624
Cheers Dasfaker!
This really helps in understanding Dumps a lot!
I’ll try this to make an Akai s612 spit out it’s data…
…and feed it back later on.Nice post!
October 26, 2015 at 1:14 am #61192I have no background in LUA and I do not understand how to utilize the directions in application to my panel that I am working on. Can someone explain this to me or point me in the correct direction so I can finish this quickly. I can make a sysex dump. that is as far as I can get.
-
This reply was modified 8 years, 1 month ago by
memorysplice.
October 27, 2015 at 9:55 am #61293Hi, we’ve started on a step by step guide here that may help.
The Puppeteer
http://godlike.com.auNovember 29, 2015 at 2:20 pm #64288Here is where I am at. I can request a dump from my JD-Xi. of 45 bytes. I understand where the bytes correspond in the dump to the parameters that I can map. Here is an example of the code that I am working on.
-- -- Called when a panel receives a midi message (does not need to match any modulator mask) -- @midi CtrlrMidiMessage object -- midiMessageReceived = function(midiMessage) s = midiMessage:getSize() if s == 45 then -- if size match the expected size of the dump requested PatchDataLoaded = midiMessage:getData() -- create a memoryblock with the data dump programData = midiMessage:getData():getRange(12,45) -- create a memory block with the synth engine data, leaving the header assignValues(midiMessage,false) -- call a script to assign each byte to each modulator. end end function assignValues(midiMessage,var) panel:getModulatorByName("Letter 1"):setModulatorValue(programData:getByte(12), false, var, false) panel:getModulatorByName("Letter 2"):setModulatorValue(programData:getByte(13), false, var, false) panel:getModulatorByName("Letter 3"):setModulatorValue(programData:getByte(14), false, var, false) panel:getModulatorByName("Letter 4"):setModulatorValue(programData:getByte(15), false, var, false) end
The question I have is what am I doing wrong because I can not update the parameters that I have created. When I press the program request button that I have made the parameters revert to the lowest number vs showing what is on the synth.
Attachments:
You must be logged in to view attached files.November 29, 2015 at 3:45 pm #64296Hi
your programData is midimessage from 12 byte and length of 45 bytes.
s = midiMessage:getSize() is a size of the whole message from F0 to F7With programData:getByte(12) you are getting 14th byte of midimessage.
Try to use
programData = midiMessage:getData():getRange(12,45 -12)function assignValues(programData) panel:getModulatorByName("Letter 1"):setModulatorValue(programData:getByte(1), false, false, false) panel:getModulatorByName("Letter 2"):setModulatorValue(programData:getByte(2), false, false, false) panel:getModulatorByName("Letter 3"):setModulatorValue(programData:getByte(3), false, false, false) panel:getModulatorByName("Letter 4"):setModulatorValue(programData:getByte(4), false, false, false) end
-
This reply was modified 8 years ago by
daimondamps.
-
This reply was modified 8 years ago by
daimondamps.
-
This reply was modified 8 years ago by
daimondamps.
November 30, 2015 at 12:40 am #64377Here is an example of the sysex dump, in case I am misunderstanding
00 F0 41 10 00 00 00 0E 12 18 00 00 00 55 6E 6C 65 | A Unle|
10 61 73 68 20 58 69 0D 00 00 00 00 00 7F 03 06 0B |ash Xi |
20 00 00 00 01 01 01 01 00 00 00 00 13 F7 | |
`The sysex number “F0” is number 0 while the sysex number “55” is number 12. Am I correct in my understanding?
The reason why I am sharing this is to understand how this works so I can work on other dumps.
November 30, 2015 at 1:03 am #64379In Lua you start indexing with 1 not 0:)
Which byte from this message you want to get as Letter 1?-
This reply was modified 8 years ago by
daimondamps.
November 30, 2015 at 1:06 am #64381So you have to use
programData = midiMessage:getData():getRange(13,45 -12) panel:getModulatorByName("Letter 1"):setModulatorValue(programData:getByte(1), false, false, false)
or
panel:getModulatorByName("Letter 1"):setModulatorValue(midiMessage:getByte(13), false, false, false)
-
This reply was modified 8 years ago by
daimondamps.
-
This reply was modified 8 years ago by
daimondamps.
-
This reply was modified 8 years ago by
daimondamps.
November 30, 2015 at 1:32 am #64385I was messing around with it with this code and got it to update.
midiMessageReceived = function(midiMessage) s = midiMessage:getSize() if s == 45 then -- if size match the expected size of the dump requested PatchDataLoaded = midiMessage:getData() -- create a memoryblock with the data dump programData = midiMessage:getData():getRange(11,45-11) -- create a memory block with the synth engine data, leaving the header assignValues(midiMessage,false) -- call a script to assign each byte to each modulator. end end function assignValues(midiMessage,var) panel:getModulatorByName("Letter 1"):setModulatorValue(programData:getByte(1), false, false, false) panel:getModulatorByName("Letter 2"):setModulatorValue(programData:getByte(2), false, false, false) panel:getModulatorByName("Letter 3"):setModulatorValue(programData:getByte(3), false, false, false) panel:getModulatorByName("Letter 4"):setModulatorValue(programData:getByte(4), false, false, false) end
November 30, 2015 at 1:58 am #64386I wanted to say thank you for responding and helping out. I still do not completely understand everything so far, I do seem to have it updating. I will experiment and get back with my results.
-
This reply was modified 8 years ago by
memorysplice.
June 3, 2017 at 7:59 pm #72263function sendPatch() for n = 0, 514, 1 do -- the amount of modulators to send a = panel:getModulatorByIndex(n) -- get modulator with index n b = a:getModulatorValue() -- get it's value a:setModulatorValue(b, false,true,false) -- set it's value, sending it to the synth. end end
Hi, so I’ve started another thread in the Using CTRLR forum. SOrry to bump an old thread, but the code above is crashing for me. Wondering if anyone has any insights.
here’s the link to the new discussion I started.
Probably a newbie Mistakethanks in advance for any help!
July 25, 2017 at 6:07 pm #72534i’m thinking of something similar, but the other way round:
i have a text label as an ‘lcd’, where i can type the name
of my preset. it’s 10 characters, and each is a parameter,
eg: a byte in the bulk dump.so i want my bulk send to collect 10 bytes from the 1O-character
name on the label.initially, to test this, i just want a button that will trigger
send each of the 10 characters to 10 text labels. how do i fetch
the characters and identify them in order to send them (or add them
to a bulk dump, ultimately)?July 25, 2017 at 8:32 pm #72536I don’t know who wrote it originally, but there’s a great 10 character preset box already set up in Martin’s Reface DX panel.
It was pretty straightforward to modify, but since there’s a function called every time the name box is modified (I think his was called nameChange), you have to implement a flag to short circuit that function when you process a new bulk SysEx dump.
Maybe this will be a better explanation:
1. Process bulk SysEx of “Patch 1”
2. Change to “Patch 2” on the synth
3. Process bulk SysEx of “Patch 2”During #3 above, the 10 character text box is being modified from “Patch 1” to “Patch 2”, so Ctrlr will call nameChange AFTER #3. You need to implement a flag around the SysEx processing code so that the call to nameChange doesn’t do anything for these cases.
July 25, 2017 at 8:42 pm #72537thanks, i have downloaded it, will have a look, see if there’s
anything i can pilfer 🙂 – i had not seen this panel, i think.the nice thing about a simple label that allows writing is that
you type straight onto it, then return, done. you can limit the
max number of characters, so you always have ie: your ten.i’ve seen some stuff where characters in a string are represented
by symbols, and these are multiple, separated by commas. that’s it:
convert *’string’* to individual bytes – if i can then send these to
individual labels, i should be able to send them to positions in
a bulk file. – hahaaaaa… i have but the vaguest notion of this …
i keep allowing myself to be sidetracked into doing the easy bits 😉September 22, 2020 at 12:40 am #119959Hi there,
I am almost finished with my (first and v1) of a Panel for the Ensoniq Mirage. What I am still wanting to do is to have the Panel update to the Patch values in the Mirage.
I have sorted out all the bytes and their corresponding modulators.
The example above deals with, as far as I can see, single byte per Modulator. But…the Mirage splits each byte into 2 nybbles. AMP Attack 1 is the first Modulator that is sent from the Mirage (at byte 7) and set to full (a value of 31) then is $0F $01.
How do I map this in a script? The getbyte:(0) does not do the job. What else do I need to add so it sees the 2 nybbles as 1 value and it will update the AMP Attack 1 slider in the panel.
Updating a 25 year old Editor
September 22, 2020 at 1:36 am #119962Hi BAUS,
Here are two scripts for 4 bit nibble conversion/creation!
Regards,
JG
function make4nibbilize(n) -- convert integer into two 4 bit nibbles local bv = BigInteger(tonumber(n)) return bv:getBitRangeAsInt(4, 4), bv:getBitRangeAsInt(0, 4) end --f function de4nibbilize(a, b) -- convert two 4 bit nibbles to a single integer local n = 0 local m = bit.lshift(a, 4) local l = b return m + l end --f
The make4nibbilize function makes use of lua’s amazing ability to return two values (or more) from a function, so to use this assign the return value to two variables.
local msb, lsb = make4nibbilize(value)
September 22, 2020 at 8:33 pm #119978Great JG,
I am not sure where to put the:
function de4nibbilize(a, b) — convert two 4 bit nibbles to a single integer
local n = 0
local m = bit.lshift(a, 4)
local l = b
return m + l
end –fWhenever I request a dump from the Mirage it is sending it (I am monitoring the MIDI info) and an error message pops up.
At line [7]: [string “midiMessageReceived”]
Error message: [string “midiMessageReceived”]:7: attempt to index global ‘midiMessage’ (a nil value)
A screenshot of the script is attached. Where is the error?
EDIT!!! THE FIRST SCREENSHOT IS INCORRECT BUT I DON’T SEE HOW TO DELETE IT FROM THE POST.
-
This reply was modified 3 years, 2 months ago by
BAUS.
-
This reply was modified 3 years, 2 months ago by
BAUS.
Attachments:
You must be logged in to view attached files.Updating a 25 year old Editor
September 22, 2020 at 9:25 pm #119983At line 5:
midiMessageReceived = function(midiMessage)
Instead of
midiMessageReceived = function(midi)
??
September 23, 2020 at 12:28 am #119987sé que tarde, pero si deseas ayuda gráfica, yo puedo hacerlo. solo me indicas la estructura, en caso yo no la conozca, y me dedico a diseñar!
si tienes un proyecto nuevo, o quieres q te lo proponga… me avisas.
mando ejemplo…
Attachments:
You must be logged in to view attached files.September 23, 2020 at 2:02 am #119991At line 5:
midiMessageReceived = function(midiMessage)
Instead of
midiMessageReceived = function(midi)
??
✓
If you go here: (see image) and you can delete any attachment. It will disappear from the post:
It is better to create a function in “‘Called when the panel has finished loading” and assign a lua variable to each panel object:
eg AMP_ENV1_ATTACK=panel:getModulatorByName(“AMP ENV1 ATTACK”)
so in your function, you can just set the value on the variable, not loop through the panel looking for AMP ENV1 ATTACK and friends.
For example:
panel:getModulatorByName("AMP ENV1 ATTACK"):setModulatorValue(programData:getByte(2),false,true,false)
becomes:
AMP_ENV1_ATTACK:setValue(programData:getByte(2),true)
(I don’t fully trust setModulatorValue())
Regards,
JG
-
This reply was modified 8 years, 1 month ago by
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.