How to prog that ?

Home Forums General Programming How to prog that ?

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #73585
    Sylvain Fortin
    Participant
      • Topics: 3
      • Replies: 11
      • Total: 14

      Hi,
      After one year of absence i come back with CTRLR !
      I have no problem with GUI but prog and learning LUA + CTRLR its different.
      I started a project by bloc. One of these blocks is that: Click on button to see one choice by section and with final choice it appeared in LCD. See pic to understand.
      The choice send MIDI SysEx to midi out.
      I have no idea to start that.
      Give me in order what do i need to make and learn.
      I know it’s hard but i can.
      Step by step i can succeed

      Thanks,
      Sylvain

      Attachments:
      You must be logged in to view attached files.
      #73596
      dnaldoog
      Participant
        • Topics: 4
        • Replies: 480
        • Total: 484
        • ★★

        Can you attach a panel of what you are trying to do?

        #73598
        Sylvain Fortin
        Participant
          • Topics: 3
          • Replies: 11
          • Total: 14

          I work on this panel. It’s just a draft but i will reorganize that.

          Attachments:
          You must be logged in to view attached files.
          #73600
          dnaldoog
          Participant
            • Topics: 4
            • Replies: 480
            • Total: 484
            • ★★

            That’s a nice design, but the actual .bpanelz file

            #73614
            Sylvain Fortin
            Participant
              • Topics: 3
              • Replies: 11
              • Total: 14

              The bpanelz file in attachments
              The idea is to select patch bank by category like XG Works. It’s more efficient!
              But how to write that?
              Thanks

              Attachments:
              You must be logged in to view attached files.
              #73617
              dnaldoog
              Participant
                • Topics: 4
                • Replies: 480
                • Total: 484
                • ★★

                Is this something like what you are after?

                It took me a while to figure out how to return the selected combo name and print it to the uiLCDLabel(the id is easy enough) and also there is probably a better way to dynamically add content to the second dynamic combo using combo:additem perhaps?

                I hope this will set you on the way. 🙂

                Attachments:
                You must be logged in to view attached files.
                #73620
                Sylvain Fortin
                Participant
                  • Topics: 3
                  • Replies: 11
                  • Total: 14

                  Thanks dnaldoog!
                  It’s near to be that.
                  Just like “spectrum synth editor” —> click on preset menu and the first row appear, the second and the third choice made the same things. The choice appear on the LCD and send the sysex on the output.
                  “Melody” –> “Piano” –> “Grand piano” = “Patch = 1 / MSB = 0 / LSB = 0”
                  “Melody” –> “Piano” –> “Mellow grand piano” = “Patch =1 / MSB = 0 / LSB = 18”

                  When we are going to have the right recipe I will do the rest of the long work. Write all the banks with all the sysex referrals.

                  Thank you very much for your response!
                  Together we will succeed!

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

                    Glad to be of help! Good luck!

                    #73626
                    Sylvain Fortin
                    Participant
                      • Topics: 3
                      • Replies: 11
                      • Total: 14

                      I watch your programming in LUA.
                      I watch Spectrum Synth programming in LUA.
                      I start to understand the meaning of how to do my programming.
                      I’m going to test something.

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

                        Great, hope it goes well. A good starting place is here. 🙂

                        #73650
                        Sylvain Fortin
                        Participant
                          • Topics: 3
                          • Replies: 11
                          • Total: 14

                          It’s a begin !
                          I write what i want.
                          But how to send 3 sysex messages?
                          You choose Grand Piano and 3 sysex goes out but what is the syntax to use.
                          {0xF0, 0x43, 0x10, 0x4C, 0x08, 0x00, 0x01, MSB, 0xF7}
                          {0xF0, 0x43, 0x10, 0x4C, 0x08, 0x00, 0x02, LSB, 0xF7}
                          {0xF0, 0x43, 0x10, 0x4C, 0x08, 0x00, 0x03, Patch, 0xF7}

                          See bpSelect at line 48

                          Attachments:
                          You must be logged in to view attached files.
                          #73652
                          dnaldoog
                          Participant
                            • Topics: 4
                            • Replies: 480
                            • Total: 484
                            • ★★

                            Hi Sylvain,

                            I think you just need to send three separate messages???

                            I didn’t know about PopupMenu()!!

                            
                            panel:sendMidiMessageNow(CtrlrMidiMessage(
                                    {0xF0, 0x43, 0x10, 0x4C, 0x08, 0x00, 0x01, MSB, 0xF7}))
                                panel:sendMidiMessageNow(CtrlrMidiMessage(
                                    {0xF0, 0x43, 0x10, 0x4C, 0x08, 0x00, 0x02, LSB, 0xF7}))
                                panel:sendMidiMessageNow(CtrlrMidiMessage(
                                    {0xF0, 0x43, 0x10, 0x4C, 0x08, 0x00, 0x03, Patch, 0xF7}))
                            

                            Regards.

                            #73657
                            Sylvain Fortin
                            Participant
                              • Topics: 3
                              • Replies: 11
                              • Total: 14

                              Yes it works.
                              My programming is progressing well

                              Attachments:
                              You must be logged in to view attached files.
                              #73659
                              dnaldoog
                              Participant
                                • Topics: 4
                                • Replies: 480
                                • Total: 484
                                • ★★

                                Great to hear – looks good too!

                                #73672
                                Sylvain Fortin
                                Participant
                                  • Topics: 3
                                  • Replies: 11
                                  • Total: 14

                                  Another questions ?

                                  How to attribute first button with the first lcd
                                  2nd with 2nd lcd
                                  And so on.

                                  and

                                  How to send value channel of the buttons to syxex ?
                                  ex: button #1(CVB_1) = CH1
                                  — SYSX: F0 43 10 4C 08 CH XX vv F7
                                  — XX = 01 = MSB
                                  — XX = 02 = LSB
                                  — XX = 03 = Patch no.-1
                                  — CH = Channel number
                                  patchChange = CtrlrMidiMessage({0xF0, 0x43, 0x10, 0x4C, 0x08, CH, 0x01, MSB, 0xF7})
                                  After that I will write all the voices
                                  A long job

                                  Attachments:
                                  You must be logged in to view attached files.
                                  #73676
                                  dnaldoog
                                  Participant
                                    • Topics: 4
                                    • Replies: 480
                                    • Total: 484
                                    • ★★

                                    Maybe this code can help, but I’m not sure if it directly solves your problem, but with these two functions you can synchronise between a channel change using uiSlider etc and Ctrlr’s channels as set in the menu.

                                    
                                    --
                                    -- Called when a modulator value changes
                                    -- @mod   http://ctrlr.org/api/class_ctrlr_modulator.html
                                    -- @value    new numeric value of the modulator
                                    --
                                    CH=1 -- global channel initialised at startup
                                    myChangeChannel = function(mod,value,source)--called from Ctrlr uiButton etc
                                        local inc=value+1
                                        if _disableProgChange == true then
                                            --prevents infinite loop if midi channel changed through menu
                                            _disableProgChange = false
                                        else
                                            panel:setPropertyInt("panelMidiOutputChannelDevice", inc)
                                        end
                                    CH=inc
                                    
                                    end --function
                                    ---------------------------------------------------------
                                    function below is called through the luaPanelMidiChannelChanged callback area in Ctrlr
                                    
                                    panelMidiChannelChanged = function(--[[ number --]] channelType, --[[ number --]] newChannel)
                                        -- This variable stops index issues during panel bootup
                                        if panel:getRestoreState() == true or panel:getProgramState() == true then
                                            return
                                        end
                                        local dec=newChannel-1
                                        --INFINITE LOOP BELOW CRASHES PANEL FIX BELOW
                                        _disableProgChange=true --global
                                        SylvainsChannelChangeButtonOnCtrlr:setModulatorValue((dec), false, true, false)
                                    end --function
                                    ---------------------------------------------------------
                                    
                                    patchChange = CtrlrMidiMessage({0xF0, 0x43, 0x10, 0x4C, 0x08, CH, 0x01, MSB, 0xF7}) -- global CH is picked up
                                    
                                    
                                    #73680
                                    Sylvain Fortin
                                    Participant
                                      • Topics: 3
                                      • Replies: 11
                                      • Total: 14

                                      I will watch your programming tomorrow.
                                      In the meantime I have made an flow chart of what I want.

                                      Attachments:
                                      You must be logged in to view attached files.
                                    Viewing 17 posts - 1 through 17 (of 17 total)
                                    • The forum ‘Programming’ is closed to new topics and replies.
                                    There is currently 0 users and 33 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