losc 1. attempt. i tmade a new gideros project, added the folder losc (from within the src folder of the github project https://github.com/davidgranstrom/losc) altogether to the project and made a main.lua where i copy-pasted contents of client.lua.
when running, it gives the following error: losc/bundle.lua:36: attempt to index nil with 'gsub'
i guess having luau instead of lua might be a problem for different ways of handlings modules etc. can you help @hgy29 or send me a working example gideros project?
Hi @keszegh, I am pretty sure you don’t really need my help if it is just about some lua code, in fact you have been coding in lua for more years than myself.
haha, i got the nicely coated critique. you should be right, but this 'plugin' has like 10 files, all different modules etc and i never really understood how modules work especially after luau switch (e.g., i could rewrite datasaver to be a class, but doing the same with this one seems to be a non-trivial effort which i hoped that is possible to avoid).
@MoKaLux , i appreciate your help. i've been working along the same lines. changed the relpath lines simply to local relpath = "losc" and in udp-socket.lua i changed require 'socket' to require 'socket.core' and yes i excluded everything from execution. and i don't remember if i changed anything else. in any case now i managed to run the example file to successfully send an osc message. so long so good, i will see later if everything works as expected.
yes, i was also worried about that 'luv' thingy but so far it seems i did not need it.
i made a main.lua and only copied the contents of client.lua there. that worked for me. you can use e.g. this app to check if the message is sent: https://hexler.net/protokol (be sure to set the same port (say 9000) in both this app and your gideros app)
so here is my demo project. in main.lua at the beginning one can set which example to run. the client example works fine. however, the server example freezes on the osc:open() "blocking call" and i don't know what should be done. (sorry for multiple posts, i could not attach the file and that was the outcome).
-- here we send 4 elements, first an (i)nt32, then a (f)loat, a (s)tring and some (b)lob datalocal message = losc.new_message {
address ='/foo/bar',
types ='ifsb', -- must match*123, 1.234, 'hi', 'blobdata'-- must match*}
I need to read some docs and see what I can make out of this LOSC thing
Thank you keszegh for opening new horizons, you are a star
EDIT: yes it seems we cannot upload zip files anymore (.txt?)
perhaps using threads when calling the server open call would work? it needs to be tested, i don't have any other idea in any case (and not much routine with coroutines).
if you wanna try if it works, then first set it as a 'client', export it to a runnable. and then set it as a 'server', run it in the player and then when it is running in the player run the 'client' executable. then the player should receive and print the sent package.
@MoKaLux , you surely wanna test it. and you might also want to add it on gideros wiki. @hgy29 , thanks again, you save hours of trial and error (perhaps coroutine would have worked too, but this way is much cleaner).
ps: can we add zip attachments back? it would be nice for example here to attach the project so that people even a year later can download it.
if you wanna try if it works, then first set it as a 'client', export it to a runnable. and then set it as a 'server', run it in the player and then when it is running in the player run the 'client' executable. then the player should receive and print the sent package.
I did as per the instructions, but I don't see anything . I exported the client as both winQt and win32.
ps: can we add zip attachments back? it would be nice for example here to attach the project so that people even a year later can download it.
I will add your project to Gideros Wiki
EDIT: I cannot make LOSC work even in my previous working project, I don't see anything in Protokol EDIT: that works, I was running a different Player than the Gideros Studio Player. Everything is fine. Make sure to run the Player from with your Gideros Studio project
@MoKaLux , yes, for me also client does not work with the new update. also the server part does not receive the call although it did an hour ago. so it needs more experimenting and tuning before we can say it is working fully.
btw you can also try the trial version of the app https://oscpilot.com/ to send test messages to a server (remember to setup the outgoing port correctly and also to add a handler to different events, like osc:add_handler('/XFADE', function(data) ... etc.)
EDIT: now it works for me too. it did not work when i rerun the app in the same player, had to close the player and open it again and THEN run the project (in server setup).
Please let us know when your Gideros demo is matured and I will update the wiki and stuff I will play with this a little bit more but I have my other Gideros project awaiting
EDIT: can we use "blobdata" to send images, Pixel, text, ... ?
What could somebody do out of this? I am thinking like the draw together demo from ar2rsawseen demo. We have a host and clients and they all draw on the host (or something like that ) I think we can build the server and several clients Gideros apps and let the server receive and draw the lines sent by the clients?
That would be a nice demo for Gideros LOSC imho
PS: I built server and clients apps but the messages are not received by the server (clients can send data to Protokol though!)
@MoKaLux ,i will look into the issue about the messages.
OSC plugin usage: it can send/receive messages using the OSC protocol. sending pixel data would be way too slow this way, for that there are other protocols (e.g. spout, syphon, ndi - the first is supported mostly by a gideros plugin). if you send/receive data between your own apps then you can use socket directly, not much need for osc, although it can make your life easier to send various types of data. osc becomes really useful if you wanna communicate between other apps (and even hardware), as many apps support it: https://en.wikipedia.org/wiki/Open_Sound_Control
think of it as a much more flexible alternative to the MIDI protocol: "The advantages of OSC over MIDI are primarily internet connectivity; data type resolution; and the comparative ease of specifying a symbolic path, as opposed to specifying all connections as seven-bit numbers with seven-bit or fourteen-bit data types. This human-readability has the disadvantage of being inefficient to transmit and more difficult to parse by embedded firmware, however." (from wikipedia)
in my use case for example chataigne is an app that can orchestrate synchronized control of multiple apps (in a live presentation situtation: music, video, lights, etc) and then having osc controllability of my app would allow it to be part of such a setup.
@MoKaLux , i cannot reproduce the log spam you had. do you use exactly the project i attached last? if not, you can share your version so i can debug it.
Comments
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
1. attempt.
i tmade a new gideros project, added the folder losc (from within the src folder of the github project https://github.com/davidgranstrom/losc) altogether to the project and made a main.lua where i copy-pasted contents of client.lua.
when running, it gives the following error:
losc/bundle.lua:36: attempt to index nil with 'gsub'
i guess having luau instead of lua might be a problem for different ways of handlings modules etc. can you help @hgy29 or send me a working example gideros project?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
You can replace each require something like this:
bundle.lua:
Don't forget to exclude bundle.lua, message.lua, packet.lua, ... from execution.
You need more stuff that I don't understand like this "luv" thing https://github.com/luvit/luv/tree/master/src
udp-libluv.lua:
Likes: keszegh
i've been working along the same lines. changed the relpath lines simply to
local relpath = "losc"
and in udp-socket.lua i changed require 'socket' to require 'socket.core'
and yes i excluded everything from execution.
and i don't remember if i changed anything else.
in any case now i managed to run the example file to successfully send an osc message.
so long so good, i will see later if everything works as expected.
yes, i was also worried about that 'luv' thingy but so far it seems i did not need it.
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
In the example LOSC folder there are 2 files: client.lua and server.lua
When I put those in my Gideros project and run, the Player freezes. What am I supposed to do here? Where am I supposed to read the message?
Thank you for any help
PS: I have included the Lua Socket plugin in the project
EDIT: Player doesn't freeze if I comment this line:
--osc:open() -- blocking call (depending on plugin used)
Now am I supposed to have a localhost opened? how do I open/create one? Do I need a server like xamp? So many questions
that worked for me.
you can use e.g. this app to check if the message is sent:
https://hexler.net/protokol
(be sure to set the same port (say 9000) in both this app and your gideros app)
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
osc:open() -- blocking call (depending on plugin used)
what does it mean that it is a blocking call and how to make it work nevertheless?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I excluded server.lua from execution and only execute client.lua.
I installed Protokol and it installed the "Bonjour" apple nasty thing but that's okay
I changed the port to 9000 and I can see the messages being sent/posted!
I am amazed at what Gideros let us do!
Viva Gideros, Viva Gideros Forum
Likes: keszegh
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
however, the server example freezes on the osc:open() "blocking call" and i don't know what should be done. (sorry for multiple posts, i could not attach the file and that was the outcome).
demo project:
https://www.dropbox.com/scl/fi/kalkoio8jjeosh5gfrwyg/loscdemo.zip?rlkey=70fnxkqyf60lkwf361hhpykfe&dl=0
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Thank you keszegh for opening new horizons, you are a star
EDIT: yes it seems we cannot upload zip files anymore (.txt?)
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
here is my updated example project:
https://www.dropbox.com/scl/fi/tghw5ck3pi4ouj4tq5ftb/loscdemo-nonblocked.zip?rlkey=r04pbyyjnu8n8ne5xjap17eby&dl=0
if you wanna try if it works, then first set it as a 'client', export it to a runnable. and then set it as a 'server', run it in the player and then when it is running in the player run the 'client' executable. then the player should receive and print the sent package.
@MoKaLux , you surely wanna test it. and you might also want to add it on gideros wiki.
@hgy29 , thanks again, you save hours of trial and error (perhaps coroutine would have worked too, but this way is much cleaner).
ps: can we add zip attachments back? it would be nice for example here to attach the project so that people even a year later can download it.
Likes: MoKaLux, pie
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I did as per the instructions, but I don't see anything . I exported the client as both winQt and win32.With great pleasure I will add your project to Gideros WikiEDIT: I cannot make LOSC work even in my previous working project, I don't see anything in ProtokolEDIT: that works, I was running a different Player than the Gideros Studio Player. Everything is fine. Make sure to run the Player from with your Gideros Studio project
Likes: keszegh
also the server part does not receive the call although it did an hour ago. so it needs more experimenting and tuning before we can say it is working fully.
btw you can also try the trial version of the app https://oscpilot.com/ to send test messages to a server (remember to setup the outgoing port correctly and also to add a handler to different events, like osc:add_handler('/XFADE', function(data) ... etc.)
EDIT: now it works for me too. it did not work when i rerun the app in the same player, had to close the player and open it again and THEN run the project (in server setup).
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://www.dropbox.com/scl/fi/nslhaafb4vhjyji1fmccq/loscdemo-nonblocked-v2.zip?rlkey=uol5qp8ujlyvmfgxthgtoco6g&dl=0
note that besides main.lua i changed one line also in the plugin in the poll function
from
return true, data
to
return data
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I am doing some testing on my side and I try to start stop the server:
I will play with this a little bit more but I have my other Gideros project awaiting
EDIT: can we use "blobdata" to send images, Pixel, text, ... ?
I think we can build the server and several clients Gideros apps and let the server receive and draw the lines sent by the clients?
That would be a nice demo for Gideros LOSC imho
PS: I built server and clients apps but the messages are not received by the server (clients can send data to Protokol though!)
Likes: keszegh
OSC plugin usage: it can send/receive messages using the OSC protocol. sending pixel data would be way too slow this way, for that there are other protocols (e.g. spout, syphon, ndi - the first is supported mostly by a gideros plugin). if you send/receive data between your own apps then you can use socket directly, not much need for osc, although it can make your life easier to send various types of data. osc becomes really useful if you wanna communicate between other apps (and even hardware), as many apps support it: https://en.wikipedia.org/wiki/Open_Sound_Control
think of it as a much more flexible alternative to the MIDI protocol:
"The advantages of OSC over MIDI are primarily internet connectivity; data type resolution; and the comparative ease of specifying a symbolic path, as opposed to specifying all connections as seven-bit numbers with seven-bit or fourteen-bit data types. This human-readability has the disadvantage of being inefficient to transmit and more difficult to parse by embedded firmware, however." (from wikipedia)
in my use case for example chataigne is an app that can orchestrate synchronized control of multiple apps (in a live presentation situtation: music, video, lights, etc) and then having osc controllability of my app would allow it to be part of such a setup.
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
do you use exactly the project i attached last? if not, you can share your version so i can debug it.
Fragmenter - animated loop machine and IKONOMIKON - the memory game