Skip to content

json Encoding of tables containing MemoryBlocks #196

Discussion options

You must be logged in to vote

OK - The thread has got a bit messy. Here's the 4 final methods I ended up with.

Encode Bank

function encodeBank(bankToEncode)
	-- This function takes a patchBank, such as libraryBank, converts the sysex MemoryBlocks to a Hex Strings and then encodes the structure
    -- to json and returns a json string that can be written to a file.
    -- decodeBank does the opposite

    local tempBank = patchBank:new() -- we want this to be non-destructive
    local nameString = ""
    local authorString = ""
    local categoryString = ""
    local sysexString = ""
    for i,v in ipairs (bankToEncode) do
        nameString = bankToEncode[i].name
        authorString = bankToEncode[i].author
        c…

Replies: 7 comments 29 replies

Comment options

You must be logged in to vote
1 reply
@Godlike-Productions
Comment options

Comment options

You must be logged in to vote
4 replies
@Godlike-Productions
Comment options

@dnaldoog
Comment options

@Godlike-Productions
Comment options

@dnaldoog
Comment options

Comment options

You must be logged in to vote
14 replies
@dnaldoog
Comment options

@Godlike-Productions
Comment options

@Godlike-Productions
Comment options

@Godlike-Productions
Comment options

@Godlike-Productions
Comment options

Comment options

You must be logged in to vote
1 reply
@Godlike-Productions
Comment options

Comment options

You must be logged in to vote
8 replies
@dnaldoog
Comment options

@Godlike-Productions
Comment options

@dnaldoog
Comment options

@Godlike-Productions
Comment options

@Godlike-Productions
Comment options

Comment options

You must be logged in to vote
1 reply
@Godlike-Productions
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Godlike-Productions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants