what do you need to know in order to make panels?

Home Forums General Programming what do you need to know in order to make panels?

Viewing 20 posts - 21 through 40 (of 46 total)
  • Author
    Posts
  • #34624
    BartBral
    Participant
      • Topics: 0
      • Replies: 14
      • Total: 14

      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!

      #61192
      memorysplice
      Participant
        • Topics: 14
        • Replies: 59
        • Total: 73

        I 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, 6 months ago by memorysplice.
        #61293
        Puppeteer
        Participant
          • Topics: 16
          • Replies: 185
          • Total: 201
          • ★★

          Hi, we’ve started on a step by step guide here that may help.

          Ctrlr – Step by step guide (in DEV version)

          The Puppeteer
          http://godlike.com.au

          #64288
          memorysplice
          Participant
            • Topics: 14
            • Replies: 59
            • Total: 73

            Here 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.
            #64296
            daimondamps
            Participant
              • Topics: 8
              • Replies: 80
              • Total: 88

              Hi
              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 F7

              With 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, 5 months ago by daimondamps.
              • This reply was modified 8 years, 5 months ago by daimondamps.
              • This reply was modified 8 years, 5 months ago by daimondamps.
              #64377
              memorysplice
              Participant
                • Topics: 14
                • Replies: 59
                • Total: 73

                Here 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.

                #64379
                daimondamps
                Participant
                  • Topics: 8
                  • Replies: 80
                  • Total: 88

                  In 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, 4 months ago by daimondamps.
                  #64381
                  daimondamps
                  Participant
                    • Topics: 8
                    • Replies: 80
                    • Total: 88

                    So 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, 4 months ago by daimondamps.
                    • This reply was modified 8 years, 4 months ago by daimondamps.
                    • This reply was modified 8 years, 4 months ago by daimondamps.
                    #64385
                    memorysplice
                    Participant
                      • Topics: 14
                      • Replies: 59
                      • Total: 73

                      I 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
                      #64386
                      memorysplice
                      Participant
                        • Topics: 14
                        • Replies: 59
                        • Total: 73

                        I 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, 4 months ago by memorysplice.
                        #72263
                        xparis001
                        Participant
                          • Topics: 1
                          • Replies: 8
                          • Total: 9
                          function 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 Mistake

                          thanks in advance for any help!

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

                            i’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)?

                            #72536
                            Paul Scheidt
                            Participant
                              • Topics: 2
                              • Replies: 11
                              • Total: 13

                              I 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.

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

                                thanks, 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 😉

                                #119959
                                BAUS
                                Participant
                                  • Topics: 2
                                  • Replies: 22
                                  • Total: 24

                                  Hi 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

                                  #119962
                                  dnaldoog
                                  Participant
                                    • Topics: 4
                                    • Replies: 480
                                    • Total: 484
                                    • ★★

                                    Hi 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)
                                    

                                    #119978
                                    BAUS
                                    Participant
                                      • Topics: 2
                                      • Replies: 22
                                      • Total: 24

                                      Great 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 –f

                                      Whenever 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, 7 months ago by BAUS.
                                      • This reply was modified 3 years, 7 months ago by BAUS.
                                      Attachments:
                                      You must be logged in to view attached files.

                                      Updating a 25 year old Editor

                                      #119983
                                      Tedjuh
                                      Participant
                                        • Topics: 9
                                        • Replies: 97
                                        • Total: 106
                                        • ★★

                                        At line 5:

                                        midiMessageReceived = function(midiMessage)

                                        Instead of

                                        midiMessageReceived = function(midi)

                                        ??

                                        #119987
                                        josh1974
                                        Participant
                                          • Topics: 1
                                          • Replies: 1
                                          • Total: 2

                                          sé 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.
                                          #119991
                                          dnaldoog
                                          Participant
                                            • Topics: 4
                                            • Replies: 480
                                            • Total: 484
                                            • ★★

                                            At 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:

                                            how to delete an image or attachment from Ctrlr

                                            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 3 years, 7 months ago by dnaldoog. Reason: fixed typos
                                            • This reply was modified 3 years, 7 months ago by dnaldoog. Reason: added some extra stuff
                                            • This reply was modified 3 years, 7 months ago by dnaldoog.
                                          Viewing 20 posts - 21 through 40 (of 46 total)
                                          • The forum ‘Programming’ is closed to new topics and replies.
                                          There is currently 0 users and 50 guests online
                                          No users are currently active
                                          Forum Statistics
                                          Threads: 2,495, Posts: 17,374, Members: 77,605
                                          Most users ever online was 12 on January 22, 2019 3:47 pm
                                          Ctrlr