Forum Replies Created
-
AuthorPosts
-
Vernonr,
Very nice. In my particular situation I need an method of checking the incoming sysex data real time.
When the panel (or lower processes) detect a specific byte (combination) in the incoming sysex string it is receiving from the hardware, the panel needs to send an acknowledge byte to the hardware back. When this not happens the hardware stops sending data to the panel. There is a certain time span where in between the panel needs to respond. Otherwise the hardware ‘forgets’ what part it was sending. The first sysex data string the panel is receiving from the hardware has a byte that tells how many ‘packages’ of sysex data will be send separately.
Hope this is helpful.
Best regards, if i can be of some sort of help, let me know!
Thanks doe the quick replies! I’m still trying! In the way the guy in the splitting Sussex topic is trying to do…
Why is real-time analysation of incoming sysex data not possible in CTRLR?
Thanks!
- This reply was modified 5 years, 8 months ago by EnzoF04.
Perhaps is the topic or goal in the conversation in the link below similar to what I am trying to do?
Just a quick ‘update’ to keep you informed.. was on holidays… will pick it up shortly!
– in MidiMessageReceived, you track for size=19
– when a message of 19 bytes is received, you calculate the number of bytes (words) in your sample from bytes 9, 10 and 11.
– when a message of 60 is received you append the data
– when a message of 1 byte is received you chexk for F7 and/or number of blocks recievedThanks for the reply! The problem is that there is no EOX from the S700. I shoot a bunch of ACK’s to the S700 to make sure the S700 keeps on sending data. If not receiving the ACK by S700 it will send an EOX. I NEED to count incoming bytes or find an other way around this.
The calculations are made clear by Possemo and Human Fly in the other topic!
Thanks all, I cannot express my thanks to all of you, Human Fly, Possemo and Goodweather, via the forum.. We could take a beer some time?Ok, thanks Possemo, to recap: it should be something times 60 is total words or something less which is filled with zero’s? And as I was thinking total words divided by 60, is wrong.
If, for example total words in sample is 360, this tells that I have six sample blocks. The bytes used to transmit these blocks are in total (6×120) 720 bytes. Each block has a byte for blocknumber and checksum (6 x 2 bytes) 12 bytes. Then there are bytes used for sample header and EOX 20 (19 bytes for the header and 1 for the EOX).
This makes that I need to receive 752 bytes. If this is not true, I do not have received the complete sysex!
Now I have it clear!! Thanks!!
The actual point is that i want to calculate how long the receiving message will be. I get some data from the device.
a: Total words in sample. This is stored in a three byte part of the message. Let’s say it’s 360.
b: The bits per word. This is stored in a single byte part of the message.
c: The first 19 bytes part of the sysex message are parameters and sysex common and the last byte is the EOX.
The remaining bytes are sample data blocks constructed of 1 byte for block number, 120 bytes of sample data and at the end of each block a checksum byte.See attached detailed info. I want to check if I’ve received the whole message with all the blocks of sample data. Is there a way of doing this?
My thought was taking 360 (Total words in sample) – 20 (the 19 parameters and the EOX at the end) = 339 / 122
smpRcvBks = ((sMsg - 20)/122) console ("sample blocks = "..2*smpRcvBks) opSmpRcvBlk:getComponent():setPropertyString ("uiLabelText",tostring(smpRcvBks))
but i never know if this is true because i count the getSize, the incoming message bytes instead of calculating from the data in the sample parameters.
Attachments:
You must be logged in to view attached files.About functions… I cam across this!
http://lua-users.org/wiki/FunctionsTutorial
and
https://en.wikibooks.org/wiki/Lua_Programming/How_to_Lua/commentthanks, goodweather and human fly
cool, human, please post your code.. perhaps we can learn from it! Nice Job!
Yes, I’m very sorry to spill time! I’m aware! and trail and error and using my mirror hall in my head, I got the way of working with the blocks and the getRange!
I need to find a way of learning myself the art of creating functions. I’m aware of my repetition in my code. This will improve after a while.
Many thanks for now, Goodweather! You’ve been kind and patient to get me on my way!
Perhaps this needs to be in programming section??
Here is what I’ve constructed.
Attachments:
You must be logged in to view attached files.OK, that’s clear! Thanks for the nice explanation! I’m really getting forward! And i’m building it to my satisfactory too. BUT.. 🙂 (sorry folks…)
What’s the difference between
MidiMessage.getData()
and
MidiMessage.getLuaData()
or something like this.I’m getting into the total blocks that a sample consists of so I can start putting these blocks into memory blocks and then put them into a file… But that’s quite far away from here… still.
I really appreciate all your help Goodweather and others!!I’m doing all my calculations in the midiReceived method. I can think of a better way to calculate different parameters of my sample. But how…
- This reply was modified 6 years, 8 months ago by EnzoF04.
Attachments:
You must be logged in to view attached files.August 15, 2017 at 4:34 pm in reply to: Listbox not reacting on "Called when a mouse is down" #72707I need this to ‘reset’ values / variables on mouse down in a uiCombo. Is this working already?
I understand. It was for testing reasons why I pushed some (the size of the sysex received) into a variable.
What I’m trying to point out:
When I get a value from the sysex, lets say the sample number the device is sending to the panel, in this case it’s hex 0x00 (sample 1), and I store it in a variable as such, and i want to use it as a string for visual reference on what sample I’m working, that I need to make a new variable with the contents / formatting of string. So if I use this variable on 3 different locations in my panel I need to declare 3 different variables. It would be much more easy to convert the value to the desired data type ‘on use’ time?Thanks!
OK, sorry for being too quick with my question.
But it’s quite inefficiënt to format the variable before using it? This way one needs to have multiple variables for one value. In stead of converting it at “use time” to the desired format?Or am I wrong with my thoughts?
Thanks Goodweather!In a previous try I got an output of a received midi message to an uiLabel working. I lost that panel and I’m searching for the way I did this. (Bottom right uiLabel with visible name “output” in screen dump).
I do thismidiMessageReceived = function(MidiMessage) s = MidiMessage:getSize() midiFromS700Size = MidiMessage:getSize() midiFromS700 = MidiMessage:getData() midiFromS700String = string.format(midiFromS700) console (tostring(midiFromS700Size)) console (midiFromS700:toString()) opSYXRcv:getComponent():setPropertyString ("uiLabelText", string.format(midiFromS700)) end
It’s so frustrating to not be able to read some clear documentation on formatting of variables and formatting them to suit the output I’m putting them to. All in above code are attempts to get it working.
Attachments:
You must be logged in to view attached files.OK OK, dance of happiness! It works! I’ve got code working and i get response from the sampler. This is really great!!
Nice explanations guys! Especially the Goodweather explanation on constructing sysex as strings with spaces dividing the bytes. And the %.2x after the string for the variables is very helpful! the working code for the onChange of the uiCombo is:currentSmpNmChanged = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source) sNmb = modCbSmpNum:getModulatorValue() midiMsg = string.format("F0 47 00 04 41 %.2x 00 F7", sNmb) opSmpNum:getComponent():setPropertyString ("uiLabelText", tostring(sNmb)) opSYXMsg:getComponent():setPropertyString ("uiLabelText", string.format(midiMsg)) end
I’m very visually orientated and i NEED to get feedback on a uiLabel so i can get the variable further. I’ll now go on with the dump of the data received into a uiLabel. That worked in a previous version. Many thanks, guys!
Thanks guys! Glad that I’m doing nothing wrong than putting undisplayable items. I’ll find my way round to show it.
Is there a place where I can read about the functions / commands like CtrlrMidiMessage and what it does and how it does?
Thanks for the replies, Human! Well I need to know how i convert the contents of the user data / table variable to a form which is to be displayed in the uiLabel Text. So my question mainly was about how to convert the data in the (table) variable. I’ve tried string.format or tostring but this didn’t work.
The error i get with the last sentence of my code is attached.
opSYXMsg:getComponent():setPropertyString ("uiLabelText", string.format(midiMsg))
Attachments:
You must be logged in to view attached files. -
AuthorPosts