Home › Forums › General › Programming › Error message: No such operator defined
Tagged: BigInteger
- This topic has 5 replies, 2 voices, and was last updated 7 years, 1 month ago by SWB.
-
AuthorPosts
-
February 11, 2017 at 3:58 pm #71233
I did apply literally this code (from the SixTrak panel made by Possemo):
lsb = PatchData:getByte(4) msb = PatchData:getByte(5); byte = (lsb)+(msb*16); byteI=BigInteger(byte);
and then I get the error message as mentioned in the subject when execution reaches the BigInteger part. (See also attached png)
What does cause this error message? I’m on CTRLR 5.3.122 for MacOS
(Sorry for the first irrelevant picture, my fault. Don’t know how to delete attachment after sending.)
- This topic was modified 7 years, 1 month ago by SWB.
- This topic was modified 7 years, 1 month ago by SWB.
- This topic was modified 7 years, 1 month ago by SWB.
- This topic was modified 7 years, 1 month ago by SWB.
Attachments:
You must be logged in to view attached files.February 11, 2017 at 11:34 pm #71252I guess PatchData is not defined. On my panel the Midimessage-Received-Method includes this: PatchData=midiMessage:getData()
February 12, 2017 at 12:21 pm #71263Thanks Possemo for the reply. I do receive bytes in the method, because the console shows their value. With the code example below I get the error. When I comment out the line with BigInteger I don’t get the error message. So I think in one way or another BigInteger is not defined… This is the code I use, which is almost the same as yours (sorry for the layout):
local t1 local t2 local t3 local byte sizeMidi = midi:getData():getSize() msgtype= midi:getType() if sizeMidi > 2500 then for i = 1,8 do t1 = midi:getData():getByte(i); t2 = midi:getData():getByte(i+1) console("t1=: "..t1) console("t2=: "..t2) byte = (t1)+(t2*16) console("byte=: "..byte) t3=BigInteger(byte) console("value: "..t3) end end
This is not the code I actually need, but without BigInteger I’m afraid (or pretty sure) getBitRangeAsInt won’t work either and I need that to work to be able to operate on bit level. Any input much appreciated.
- This reply was modified 7 years, 1 month ago by SWB.
- This reply was modified 7 years, 1 month ago by SWB.
- This reply was modified 7 years, 1 month ago by SWB.
- This reply was modified 7 years, 1 month ago by SWB.
- This reply was modified 7 years, 1 month ago by SWB.
- This reply was modified 7 years, 1 month ago by SWB.
- This reply was modified 7 years, 1 month ago by SWB.
February 12, 2017 at 4:37 pm #71280This may be because you are using an old Ctrlr build. Try with the newest build. Or, instead of BigInteger() you could try the deprecated CtrlrLuaBigInterger()
February 12, 2017 at 7:09 pm #71302First I did download the latest Windows version, but it appeared that the panel I had made on the Mac would not send or receive MIDI in the Windows version. So I had to copy all the code manually. (I also had to adjust all the buttons and the labels, because font (and the screen resolution??) differ from the Mac.) This finally worked, but when I did add the “problematic” code, Ctrlr crashed and I could no load any panel anymore, all my work was lost! So I went back to Mac and tried your suggestion of using CtrlLuaBigInteger, but the same error message. So I downloaded the latest Mac version (I don’t use that one because it won’t load resources like images), but the same as on Windows, the panel would not send or receive MIDI. So I probably have to copy again manually all the code. For now I have had enough, maybe tomorrow I feel more up to the task again 😉 Thanks for the reply and advice!
February 13, 2017 at 2:26 pm #71336Today I did use the latest Mac build 5.3.198, but same result, error message: no such operator defined. Also when I load a panel made in a previous version, midi in and out don’t work. Only when I make a panel from scratch does de MIDI I/O work. I wish atom would shed some light on all this…
- This reply was modified 7 years, 1 month ago by SWB.
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.