Porting panels from jSynthLib

Home Forums General Panels, Components, Macros Porting panels from jSynthLib

Tagged: 

Viewing 20 posts - 1 through 20 (of 23 total)
  • Author
    Posts
  • #33779
    pascalc
    Participant
      • Topics: 7
      • Replies: 27
      • Total: 34

      Hi,

      I have up until now been maintaining the jSynthLib project.

      Recently I discovered Ctrlr though and realized that this project has a lot more potential. Therefore I decided to port the synths that I own from the the JSL format to Ctrlr panels.

      Currently I have the Roland D50 and Yamaha DX7 panels for basic patch editing. I am currently working on getting bank support to those as well. I will also be creating panels for the Emu Proteus/2 and Ensoniq ESQ-1 synths.

      To generate these panels I have created an application based on the JSL code. Therefore I can convert other synths as well. At lease the patch editing part.

      If you are interested in porting any JSL synth to Ctrlr you can contact me. You can view the list of supported synths in JSL here:

      http://sourceforge.net/p/jsynthlib/wiki/Supported%20Synths/

      BR
      /Pascal

      #33781
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        That’s very cool and i look forward to your work. If you need anything from me to help with the migration process, any features that might be needed, let me know i’ll try to help as much as I can.

        #33786
        pascalc
        Participant
          • Topics: 7
          • Replies: 27
          • Total: 34

          Thanks atom,

          One thing that could help all development of panels would be a repository, e.g. the Panels folder in the git root, where anyone could store their “work in progress” panels.

          I have seen some cases in this forum where a panel has been started by someone and then abandoned. As the panel was never released no one can continue where the previous person left off.

          Also that would be a great place to see all panels. I think there are quite some panels laying around “out there”. But these are hard to find as long as they are not published on the downloads page here.

          BR
          /Pascal

          #33796
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            I’ll try to create a repository on github and make it public so people can use that to track their work, but this still won’t be the only place panels are in. I can create a special sub-page for uploading panels but that already exists and some people still refuse to use it. Any ideas on how to exactly do that ?

            #33823
            pascalc
            Participant
              • Topics: 7
              • Replies: 27
              • Total: 34

              Hi,

              I’m not a version control expert but I have heard of something called submodules in git. Perhaps you could have a submodule inside the master git and make it public?

              #33827
              atom
              Keymaster
                • Topics: 159
                • Replies: 2945
                • Total: 3104
                • ★★★★★

                Well i created a special repository and added it as a submodule to the Ctrlr project, the repository is at: https://github.com/RomanKubiak/Panels

                But the problem is people will have to set up accounts on github and ask to be added to the repository so they can commit to it.

                I have no problem in managing this but people are usualy scared or just lazy and don’t want to do that.

                Anyway it’s ready so if anyone want’s to post their work there you can do that, your panel will be part of the Ctrlr distro (all panels from the Panels/ directory are packages with all installers of Ctrlr)

                #34011
                pascalc
                Participant
                  • Topics: 7
                  • Replies: 27
                  • Total: 34

                  Hi,

                  I think not shipping all panels together with Ctrlr by default is a good feature actually. That keeps the binary footprint down. Couldn’t you exclude all panels except the DEMO ones at build time?

                  I have two questions regarding my Lua code generation:

                  1. Is the Lua Bit Operations Module included in your Lua engine?
                  2. I have some issues finding out how to tell Ctrlr to calculate a checksum from Lua. Is there an API for that?

                  Thanks!
                  /Pascal

                  #34048
                  atom
                  Keymaster
                    • Topics: 159
                    • Replies: 2945
                    • Total: 3104
                    • ★★★★★

                    1. no, but i can add it, you cal also use require() to import any external modules

                    2. depends on what checksum, i doubt there is anything in lua that does just a crc32 or any other checksum operations, what sort of checksum do you need (what algorithm) i can add that as a native call to c++ and present it to Lua

                    #34081
                    pascalc
                    Participant
                      • Topics: 7
                      • Replies: 27
                      • Total: 34

                      Hi again,

                      1. Then I must download the dll and store it locally on my machine in the Ctrlr installation dir right? I guess every user of those panels will have to do the same thing?

                      2. I mean the sysex checksums that most synth manufacturers use. E.g. when sending a patch to the synth Ctrlr needs to calculate a checksum and set it to the second last byte in the data stream. Is there a Lua call in Ctrlr that will provide me the checksum value of a data array as it is in the sysex formula field of a modulator?

                      BR
                      /Pascal

                      #34135
                      atom
                      Keymaster
                        • Topics: 159
                        • Replies: 2945
                        • Total: 3104
                        • ★★★★★

                        1. i already added that to Ctrlr code base, so the next nightly will have it

                        2. well no, the sysex formula processor is i no way visible by Lua, you need to write propert checksum algorithms yourself, i’m sure i can make those that already exist accessible in Lua if needed, but as I remember there were only two available (by request) and implementing ALL of them in C++ might be impossible, but i have no problem in exposing those that already exist.

                        #34137
                        pascalc
                        Participant
                          • Topics: 7
                          • Replies: 27
                          • Total: 34

                          1. Great! I’ll try that out then

                          2. I think especially the z checksum algorithm is more or less standard. I think both Yamaha and Roland use it so exposing at least that one could be a good idea. For the other ones I agree that it is perhaps best to write them directly in Lua but then on the other hand how would I access that Lua function from my sysex formula?

                          #34138
                          atom
                          Keymaster
                            • Topics: 159
                            • Replies: 2945
                            • Total: 3104
                            • ★★★★★

                            There is no direct way to access Lua from within the formula, since formula processing happens in a different thread it can’t coexist with Lua.

                            You can however change the formula at runtime from Lua or send custom SysEx messages from Lua with whatever data inside them.

                            I thought about adding sysex formula<->Lua bridge but i had a lock/thread problem. I could just lock the entire Lua/GUI thread but this will cause a lot of other problems i’m not ready to deal with yet.

                            #34142
                            m.tarenskeen
                            Participant
                              • Topics: 30
                              • Replies: 113
                              • Total: 143
                              • ★★

                              There might exist different checksum algorithms used by different manufacturers, but I don’t know them all. But the calculation that I know that is used by for example Yamaha and Roland goes like this:

                              A = calculate the sum of all data (excluding some header bytes)
                              B = only use the 7 lower bits from A
                              C = calculate 128-B
                              D = only use the 7 lower bits from C, so that D=0 if B=0

                              D is the checksum

                              #34394
                              pascalc
                              Participant
                                • Topics: 7
                                • Replies: 27
                                • Total: 34

                                Hi,

                                I have now extracted the checksum methodsfrom Java as well so there is no need to expose these functinos to Lua from my point of view.

                                In the .panel files the local username is exposed in the resource element, resourceSourceFile attribute. Couldn’t you use the %APPDATA% variable in the XML files instead? Or have a Ctrlr specific variable that can be translated by the Ctrlr application to a OS specific path where Ctrlr accesses its resources?

                                BR
                                /Pascal

                                #34395
                                pascalc
                                Participant
                                  • Topics: 7
                                  • Replies: 27
                                  • Total: 34

                                  Another issue..

                                  I have now extracted some devices from JSL and currently I am verifying that they work in Ctrlr.

                                  When I call this method:

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

                                  if panel_loaded == 0 then
                                  return
                                  end

                                  console(“Performance_getPatchStart”)
                                  return (Performance_dxSinglePackedSize * patchNum) + Performance_dxSysexHeaderSize

                                  end

                                  I get the following error popup:

                                  lua runtime error

                                  At line [-1]: [C]

                                  Error message: No such operator defined.

                                  You can recreate this by opening the attached panel -> go to the Voice tab (far down..) -> Load -> Bank -> select a sysex file (probably any will work but you are supposed to load a DX7 bank)

                                  From what I have googled it seems to be some issue with the luabind but I cant understand if it is my code that triggers the issue or not.

                                  I’ve come to the conclusion that it is this line that triggers the issue:

                                  return (Performance_dxSinglePackedSize * patchNum) + Performance_dxSysexHeaderSize

                                  And I can’t see how this cannot be valid Lua.

                                  Any help would be apprciated!
                                  /Pascal

                                  Attachments:
                                  You must be logged in to view attached files.
                                  #34425
                                  atom
                                  Keymaster
                                    • Topics: 159
                                    • Replies: 2945
                                    • Total: 3104
                                    • ★★★★★

                                    Running the embedded lua debugger on the method (just put pause(“stop”) at line 10, you can see that you are passing an object MemoryBlock as the parameter to the function, and you are trying to do multiplication on that, you can’t it has to be a number (variables panel in the debugger shows you types of all your local variables).

                                    #34430
                                    pascalc
                                    Participant
                                      • Topics: 7
                                      • Replies: 27
                                      • Total: 34

                                      The debugger!

                                      Great tool.

                                      Thanks
                                      /Pascal

                                      #45121
                                      theuns
                                      Participant
                                        • Topics: 0
                                        • Replies: 1
                                        • Total: 1

                                        Hi, I was hoping that you completed the Roland D50 panel. I would like to load patches from Linux operating system to my D50 and looked at jsynthlib but then saw the post where you said your’e moving to ctrlr, so I basically followed you here…

                                        I don’t see the panel in the list of panels, but if you have a working or work-in-progress version I could try to test it for you.

                                        #45124
                                        pascalc
                                        Participant
                                          • Topics: 7
                                          • Replies: 27
                                          • Total: 34

                                          Hi,

                                          I haven’t published the panel yet but it is done except that it crashes on Mac OSX.

                                          You can find the panel here: https://github.com/locurasoft/Panels/tree/master/pascalc

                                          BR
                                          /Pascal

                                          #45460
                                          pascalc
                                          Participant
                                            • Topics: 7
                                            • Replies: 27
                                            • Total: 34

                                            I finally released an alpha version of this panel now: http://ctrlr.org/roland-d50-alpha-version-released

                                            BR
                                            /Pascal

                                          Viewing 20 posts - 1 through 20 (of 23 total)
                                          • The forum ‘Panels, Components, Macros’ is closed to new topics and replies.
                                          There is currently 0 users and 52 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