Skip to content

Replacing values stored in table from/to a certain position #227

Answered by dnaldoog
damiensellier asked this question in Q&A
Discussion options

You must be logged in to vote

Remind me to use m:toString() or even m:getRange(start,numBytes):toString next time rather than the function I posted! Thanks! Always forget that one.

Here is a potential strategy/solution:


MAX = 112
--------------------------------------------------------------
local init = {}
for i = 1, MAX do
    init[i] = 0x5F -- this is an underscore for visualisation, substitute 0x20 maybe for 'space'
end -- or use buffer:setByte(i,0x20)

buffer = MemoryBlock(MAX) -- initialise a 112 byte memory block at startup
buffer:createFromTable(init)
--------------------------------------------------------------
midiIncoming = function(--[[ CtrlrMidiMessage --]] midi) -- detect incoming midi
    LcdScribbleD…

Replies: 3 comments 8 replies

Comment options

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

@damiensellier
Comment options

@damiensellier
Comment options

@dobo365
Comment options

Comment options

You must be logged in to vote
1 reply
@dobo365
Comment options

Comment options

You must be logged in to vote
3 replies
@damiensellier
Comment options

@dnaldoog
Comment options

@Ted-juh
Comment options

Answer selected by damiensellier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants