How I can create a sysex file from table on panel

Home Forums Development How I can create a sysex file from table on panel

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #119067
    lecletolecleto
    Participant
    • Topics: 10
    • Replies: 34
    • Total: 44

    Hello Ctrlrs!

    How I can create a sysex file to be stored on PC from 5 tables that contais all patch data necessary? Actualy I can store these same information on synth but I want implement the same funtions to store on computer.

    In other words how I can select a “Store as Sysex on Hard Disk” and open a dialog box to select a place to store file that information comes from 5 tables in the panel and “write” a file and rename as .sys file that you will can open on MidiOx or Bome?

    How I can do this?

    Thank ins advance!

    #119075
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 390
    • Total: 393
    • ★★

    Hi Lecleto,

    You need to convert the table data into binary (MemoryBlock()).

    The example below is tablecentric using lua loops, but you can also use MemoryBlock functions to do the same thing.

    
    save_sysex_to_file = function(mod, value, source)
    
    local t={}
    
    t1={0xF0,0x41,0x01,0x00,0x01,0xF7} -- these are your 5 global
    t2={0xF0,0x41,0x02,0x00,0x02,0xF7} -- sysex tables
    t3={0xF0,0x41,0x03,0x00,0x03,0xF7} -- from somewhere in 
    t4={0xF0,0x41,0x04,0x00,0x04,0xF7} -- your program
    t5={0xF0,0x41,0x05,0x00,0x05,0xF7}
    
    local mergeTable={t1,t2,t3,t4,t5} -- make a table of tables!
    
    for _,v in ipairs (mergeTable) do
    for _,val in ipairs (v) do
    table.insert(t,val)
    end -- inner loop
    end -- populate a temp table t with all values
    
    --console(String(table.concat(t,',')))
    
    local dataToSave=MemoryBlock.fromLuaTable(t) -- create MemoryBlock from table
    
    --console(String(dataToSave:toHexString(1)))
    
       file = utils.saveFileWindow ("Save file",File.getSpecialLocation(File.userDesktopDirectory), "*.syx", true)
        if file:hasWriteAccess() then
          file:replaceWithData(dataToSave)
        end
    
    end --end function
    ---------------------------------------------------------
    

    See attached panel. Also with a function to read a sysex file back into 5 tables.

    Attachments:
    You must be logged in to view attached files.
    #119077
    lecletolecleto
    Participant
    • Topics: 10
    • Replies: 34
    • Total: 44

    Hello Dnaldoog! One more thanks!

    I published now a new panel for Roland JV and XP series. In my post I give my special thanks to you that always help me!

    I will try here. Will be perfect this feature in my panels.

    Thank you sooo much!!

    #119078
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 390
    • Total: 393
    • ★★

    Well thank you lecleto!

    Very kind of you.

    Will download it and look at it!

    Does it work for the JV1010?

    I once started a panel for the JV1010.

    I packed the unit away, but might get it out again to test.

    Regards,

    JG

    #119079
    lecletolecleto
    Participant
    • Topics: 10
    • Replies: 34
    • Total: 44

    Hello Dnaldoog!

    Yes will work on JV-1010!

    I also have a JV-1010 and I really like of this unit! In reality JV-1010 was my first motivation to do this job that you really helped me a lot then your comments are really welcome! Part of your vast knowledge is inside of this panel. Remember when we talk about Roland checksums, message box, timers and many other topics. Yes, all these things are working inside of this panel.

    So, if possible, try this ang give me your feedback!

    #119080
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 390
    • Total: 393
    • ★★

    Hi lecleto,

    Certainly not vast knowledge, but just much of what you ask I have done myself before and sweated over!

    But thank you for the nice compliment. Wish it were true.

    #119081
    lecletolecleto
    Participant
    • Topics: 10
    • Replies: 34
    • Total: 44

    Yeah, Dnaldoog! Now working perfectly!!!

    Saving patches on PC! Your example panel was perfect!!
    So, the first upgrade to JV-Patched JV-XP is ready!
    I will extend to my other panel to Roland JV-880.

    Many thanks!!

    #119087
    samoht
    Participant
    • Topics: 0
    • Replies: 19
    • Total: 19

    Hi, Donaldoog,

    Certainly not vast knowledge, but just much of what you ask I have done myself before and sweated over!

    Studying Lua and Ctrlr, your comments are of great help for me too!
    Thanks!

    • This reply was modified 1 month, 1 week ago by samoht.
    #119089
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 390
    • Total: 393
    • ★★

    Thanks Samoht. It’s nice to hear that! Appreciated.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
There is currently 0 users and 29 guests online
No users are currently active
Forum Statistics
Threads: 2,403, Posts: 16,832, Members: 60,402
Most users ever online was 12 on January 22, 2019 3:47 pm
Do NOT follow this link or you will be banned from the site!