Initialise MemoryBlock #483
Replies: 2 comments 2 replies
-
Great explanation John! What I'm doing is thus similar to your approach...
Code 1 Code 2 Sorry... line returns seems lost... |
Beta Was this translation helpful? Give feedback.
-
dnaldoog, that post was extremely timely, thank you ever so much for that! I had a MemoryBlock that was normally initialised from a MidiMessage but I needed to initialise it 'on Panel Load' but after lots of reference to the JUCE libraries and trying just about every combination I could think of I just couldn't get anything to work! Your post has cleared all that up and now everything's working great :-) |
Beta Was this translation helpful? Give feedback.
-
Here is a method added to the class MemoryBlock() for initialising a MemoryBlock (usually with zeroes).
The overloaded JUCE function
m=MemoryBlock(20)
is not implemented or bound to lua (at least in version 5.3.201), so normally one would write something likem=MemoryBlock("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")
which is a bit cumbersome or usecreateFromTable
local t={}
for i=1,20 do
t[i]=0
end
m:createFromTable(t)
but this following way is maybe a bit more convenient;
Edit: 03/15/2023
Updated code to support newer versions of Ctrlr.
Beta Was this translation helpful? Give feedback.
All reactions