Ethernet receive
Date | 2016-04-05 19:44 |
From | SUBSCRIBE CSOUND Anonymous |
Subject | Ethernet receive |
Hi everybody, i want to receive from a data aquisition interface (named Gluion) that sends simultaneously integer values from 64 channels through ethernet socket. Thanks a lot. Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-04-05 19:54 |
From | Richard |
Subject | Re: Ethernet receive |
Looking at it this device supports the OSC (ethernet) protocol, so you can use it with csound. You have to use OSClisten, like in this example: http://www.csounds.com/manual/html/OSClisten.html Richard On 05/04/16 20:44, SUBSCRIBE CSOUND Anonymous wrote: > Hi everybody, > i want to receive from a data aquisition interface (named Gluion) that sends simultaneously integer values from 64 channels through ethernet socket. > > Thanks a lot. > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-04-05 21:51 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Hi, i followed the example but it does not work. I don' t understand how to set OSClisten parameters to receive and display all the 64 channels separately. 2016-04-05 20:54 GMT+02:00 Richard |
Date | 2016-04-05 22:12 |
From | Richard |
Subject | Re: Ethernet receive |
Are these parameters sent all at once or one by one? In this example 2 integers are received, listening on address pattern "foo/bar": kk OSClisten gihandle, "/foo/bar", "ii", kf1, kf2
I do not know if csound can handle 64 ints at once, you need 64
"i"'s there and 64 k variables in onelineOn the other hand if they are sent separately, you may need 64 address patterns each with 1 k variable like so: kk OSClisten gihandle, "/var1", "i", k1 kk OSClisten gihandle, "/var2", "i", k2 kk OSClisten gihandle, "/var3", "i", k3 etc.So you have to do some programming on both sides. Finally, maybe you can pack all 64 integers in a long string, send them over and have csound unpack the string.. Richard On 05/04/16 22:51, cristiano piatti wrote:
Hi, i followed the example but it does not work. I don' t understand how to set OSClisten parameters to receive and display all the 64 channels separately. 2016-04-05 20:54 GMT+02:00 Richard <zappfinger@gmail.com>:Looking at it this device supports the OSC (ethernet) protocol, so you can use it with csound. You have to use OSClisten, like in this example: http://www.csounds.com/manual/html/OSClisten.html Richard On 05/04/16 20:44, SUBSCRIBE CSOUND Anonymous wrote:Hi everybody, i want to receive from a data aquisition interface (named Gluion) that sends simultaneously integer values from 64 channels through ethernet socket. Thanks a lot. Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted hereCsound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-04-05 22:17 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Are these parameters sent all at once or one by one? all at once But how can i print them to see if something is being received ? 2016-04-05 23:12 GMT+02:00 Richard |
Date | 2016-04-05 22:23 |
From | Richard |
Subject | Re: Ethernet receive |
Use the printk or printk2 opcodes. They print k variables. On 05/04/16 23:17, cristiano piatti wrote: > Are these parameters sent all at once or one by one? > all at once > > But how can i print them to see if something is being received ? > > > 2016-04-05 23:12 GMT+02:00 Richard |
Date | 2016-04-05 22:55 |
From | jpff |
Subject | Re: Ethernet receive |
Or with 6.07 send an array of length 64....... On Tue, 5 Apr 2016, Richard wrote: > Are these parameters sent all at once or one by one? > In this example 2 integers are received, listening on address pattern > "foo/bar": > > kk OSClisten gihandle, "/foo/bar", "ii", kf1, kf2 > I do not know if csound can handle 64 ints at once, you need 64 "i"'s there > and 64 k variables in oneline > On the other hand if they are sent separately, you may need 64 address > patterns each with 1 k variable like so: > > kk OSClisten gihandle, "/var1", "i", k1 > kk OSClisten gihandle, "/var2", "i", k2 > kk OSClisten gihandle, "/var3", "i", k3 > etc. > So you have to do some programming on both sides. Finally, maybe you can > pack all 64 integers in a long string, send them over and have csound unpack > the string.. Richard On 05/04/16 22:51, cristiano piatti wrote: > > Hi, > i followed the example but it does not work. > I don' t understand how to set OSClisten parameters to receive and > display all the 64 channels separately. > > > 2016-04-05 20:54 GMT+02:00 Richard |
Date | 2016-04-05 23:43 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
I tried but something wrong... CSOUND CODE: |
Date | 2016-04-06 08:26 |
From | Richard |
Subject | Re: Ethernet receive |
If you say it sends 64 values at once, then waiting for 2 values will not work, you have to wait for 64 values. I suggest you use a program called OSC Data Monitor first to see what is sent. Richard On 06/04/16 00:43, cristiano piatti wrote: > I tried but something wrong... > > CSOUND CODE: > > |
Date | 2016-04-06 13:52 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
>From OSC Monitor i can see all the 64 values on "/analog" address and "64_i Type Tag". I initialized all the 64 values and added them to OSClisten sintax, but it does not print anything (i tried to print only two values). Calling unified file system4 STARTING FILE Creating options Creating orchestra Creating score rtaudio: PortAudio module enabled ... using blocking interface rtmidi: PortMIDI module enabled Elapsed time at end of orchestra compile: real: 0.008s, CPU: 0.008s sorting score ... ... done Elapsed time at end of score sort: real: 0.008s, CPU: 0.008s --Csound version 6.07 beta (double samples) Dec 24 2015 0dBFS level = 32768.0 WARNING: OSC listener #0 started on port 57120 orch now loaded audio buffered in 4096 sample-frame blocks PortAudio V19-devel (built Nov 14 2015 16:41:46) 0: adc0 (Microsoft Sound Mapper - Input) 1: adc1 (Microfono (Dispositivo High Def) 2: adc2 (Microfono (Dispositivo High Def) 3: adc3 (Linea in ingresso (Dispositivo ) 4: adc4 (Driver primario di acquisizione suoni) 5: adc5 (Microfono (Dispositivo High Definition Audio)) 6: adc6 (Microfono (Dispositivo High Definition Audio)) 7: adc7 (Linea in ingresso (Dispositivo High Definition Audio)) PortAudio: selected input device 'Microfono (Dispositivo High Def' reading 16384-byte blks of shorts from adc (RAW) 0: dac0 (Microsoft Sound Mapper - Output) 1: dac1 (Altoparlanti (Dispositivo High ) 2: dac2 (Driver audio principale) 3: dac3 (Altoparlanti (Dispositivo High Definition Audio)) PortAudio: selected output device 'Altoparlanti (Dispositivo High ' writing 8192 sample blks of 64-bit floats to dac SECTION 1: handle=0 OSC deinitiatised inactive allocs returned to freespace end of score. overall amps: 0.0 0.0 overall samples out of range: 0 0 0 errors in performance Elapsed time at end of performance: real: 9.298s, CPU: 9.299s closing device 99 8192 sample blks of 64-bit floats written to dac 2016-04-06 9:26 GMT+02:00 Richard |
Date | 2016-04-06 14:01 |
From | Richard |
Subject | Re: Ethernet receive |
Can you post a screen dump of the OSC Monitor program and your csd? Then I can try to simulate it. Richard On 06/04/16 14:52, cristiano piatti wrote: > From OSC Monitor i can see all the 64 values on "/analog" address and > "64_i Type Tag". > I initialized all the 64 values and added them to OSClisten sintax, > but it does not print anything (i tried to print only two values). > > > Calling unified file system4 > STARTING FILE > Creating options > Creating orchestra > Creating score > rtaudio: PortAudio module enabled ... > using blocking interface > rtmidi: PortMIDI module enabled > Elapsed time at end of orchestra compile: real: 0.008s, CPU: 0.008s > sorting score ... > ... done > Elapsed time at end of score sort: real: 0.008s, CPU: 0.008s > --Csound version 6.07 beta (double samples) Dec 24 2015 > 0dBFS level = 32768.0 > WARNING: OSC listener #0 started on port 57120 > orch now loaded > audio buffered in 4096 sample-frame blocks > PortAudio V19-devel (built Nov 14 2015 16:41:46) > 0: adc0 (Microsoft Sound Mapper - Input) > 1: adc1 (Microfono (Dispositivo High Def) > 2: adc2 (Microfono (Dispositivo High Def) > 3: adc3 (Linea in ingresso (Dispositivo ) > 4: adc4 (Driver primario di acquisizione suoni) > 5: adc5 (Microfono (Dispositivo High Definition Audio)) > 6: adc6 (Microfono (Dispositivo High Definition Audio)) > 7: adc7 (Linea in ingresso (Dispositivo High Definition Audio)) > PortAudio: selected input device 'Microfono (Dispositivo High Def' > reading 16384-byte blks of shorts from adc (RAW) > 0: dac0 (Microsoft Sound Mapper - Output) > 1: dac1 (Altoparlanti (Dispositivo High ) > 2: dac2 (Driver audio principale) > 3: dac3 (Altoparlanti (Dispositivo High Definition Audio)) > PortAudio: selected output device 'Altoparlanti (Dispositivo High ' > writing 8192 sample blks of 64-bit floats to dac > SECTION 1: > handle=0 > OSC deinitiatised > inactive allocs returned to freespace > end of score. overall amps: 0.0 0.0 > overall samples out of range: 0 0 > 0 errors in performance > Elapsed time at end of performance: real: 9.298s, CPU: 9.299s > closing device > 99 8192 sample blks of 64-bit floats written to dac > > 2016-04-06 9:26 GMT+02:00 Richard |
Date | 2016-04-06 14:14 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Attachments | GLUION.csd OSC Monitor.jpg |
Of course, thank you very muck !!! I monitored only 16 values to make it readable. 2016-04-06 15:01 GMT+02:00 Richard |
Date | 2016-04-06 22:17 |
From | Richard |
Subject | Re: Ethernet receive / OSC broken? |
Hmm, I tried it first with 4 variables, but nothing happens. You do need the if and the kgoto, like so: ... nxtmsg: kk OSClisten gihandle, "/analog", "iiii", ki1, ki2, ki3, ki4 if (kk == 0) goto ex printk 0,ki1 printk 0,ki2 printk 0,ki3 printk 0,ki4 kgoto nxtmsg ex: endin But it is not working. I wrote a small Python test program that sends these 4 variables. OSC Data Monitor can see them. Guys, did anything change with OSC? This is Csound 6.06.... Richard On 06/04/16 15:14, cristiano piatti wrote: > Of course, thank you very muck !!! > I monitored only 16 values to make it readable. > > 2016-04-06 15:01 GMT+02:00 Richard |
Date | 2016-04-06 23:39 |
From | Rory Walsh |
Subject | Re: Ethernet receive / OSC broken? |
I can't say because I never use these opcodes. But if you think it's a bug, or the behaviour has changed I think the thing to do is file an issue on github. On 6 April 2016 at 22:17, Richard <zappfinger@gmail.com> wrote: Hmm, I tried it first with 4 variables, but nothing happens. |
Date | 2016-04-07 07:16 |
From | Victor Lazzarini |
Subject | Re: Ethernet receive / OSC broken? |
I tested the manual examples and they work on 6.07 develop. ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 6 Apr 2016, at 23:39, Rory Walsh |
Date | 2016-04-07 13:17 |
From | jpff |
Subject | Re: Ethernet receive / OSC broken? |
Just to answer one if te original questions, OSC code was chaged considerably to allow f0r transmissionof arrays and audio. On Thu, 7 Apr 2016, Victor Lazzarini wrote: > I tested the manual examples and they work on 6.07 develop. > ======================== > Dr Victor Lazzarini > Dean of Arts, Celtic Studies and Philosophy, > Maynooth University, > Maynooth, Co Kildare, Ireland > Tel: 00 353 7086936 > Fax: 00 353 1 7086952 > >> On 6 Apr 2016, at 23:39, Rory Walsh |
Date | 2016-04-07 20:45 |
From | Richard |
Subject | Re: Ethernet receive |
Attachments | GLUION.csd |
Ok, finally I found there were some parts missing in your code- the 'dummy f table' and the 'turnon 1' to turn instrument 1 on. Here is a csd that works, at least for 4 variables, so maybe for 64 as well, haven't tried yet. Richard On 06/04/16 15:14, cristiano piatti wrote: > Of course, thank you very muck !!! > I monitored only 16 values to make it readable. > > 2016-04-06 15:01 GMT+02:00 Richard |
Date | 2016-04-07 21:13 |
From | Aaron Krister Johnson |
Subject | Re: Ethernet receive / OSC broken? |
Curious: when the devs make a change, are there some sort of automated regression tests that get run to make sure nothing broke? Probably a good idea if you don't already...a suggestion. :D On Thu, Apr 7, 2016 at 7:17 AM, jpff <jpff@codemist.co.uk> wrote: Just to answer one if te original questions, OSC code was chaged considerably to allow f0r transmissionof arrays and audio. |
Date | 2016-04-07 21:45 |
From | Richard |
Subject | Re: Ethernet receive / OSC broken? |
Absolutely a good idea to setup automated test cases. It takes a lot of time, but it definitely pays off. You could even use the excellent pytest package to test c-code. A tricky thing about audio is: how to test it up to the sound generating part? (harmonics, distortion, etc.) Richard On 07/04/16 22:13, Aaron Krister
Johnson wrote:
|
Date | 2016-04-07 21:46 |
From | Victor Lazzarini |
Subject | Re: Ethernet receive / OSC broken? |
We have various test routines; soak tests, cunit tests, manual example tests, etc. ================= Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 7 Apr 2016, at 21:13, Aaron Krister Johnson |
Date | 2016-04-07 21:46 |
From | Steven Yi |
Subject | Re: Ethernet receive / OSC broken? |
Yes, there is a test suite for both native C tests and CSD-based testing. No, it is not comprehensive, unfortunately. Yes, anyone can make a contribution, and we would welcome further contributions. On Thu, Apr 7, 2016 at 4:13 PM, Aaron Krister Johnson |
Date | 2016-04-07 23:20 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Hi and many thanks, i tried but unfortunately i get an an error message: SECTION 1: new alloc for instr 1: INIT ERROR in instr 1: invalid number of arguments kk OSClisten gihandle "/analog" "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii" ki1 ki2 ki3 ki4 ki5 ki6 ki7 ki8 ki9 ki10 ki11 ki12 ki13 ki14 ki15 ki16 ki17 ki18 ki19 ki20 ki21 ki22 ki23 ki24 ki25 ki26 ki27 ki28 ki29 ki30 ki31 ki32 ki33 ki34 ki35 ki36 ki37 ki38 ki39 ki40 ki41 ki42 ki43 ki44 ki45 ki46 ki47 ki48 ki49 ki50 ki51 ki52 ki53 ki54 ki55 ki56 ki57 ki58 ki59 ki60 ki61 ki62 ki63 ki64 T 0.000 - note deleted. i1 had 1 init errors 2016-04-07 21:45 GMT+02:00 Richard |
Date | 2016-04-07 23:39 |
From | Rory Walsh |
Subject | Re: Ethernet receive |
Is there a limit to the amount of arguments that OSClisten can take? Btw, does it work when you only try to catch a few of the arguments? Like the first 16 or so? At what point do you get this message?
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
On 7 April 2016 at 23:20, cristiano piatti <cristiano.piatti@gmail.com> wrote: Hi and many thanks, |
Date | 2016-04-08 00:12 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
At what point do you get this message? When i run the code. does it work when you only try to catch a few of the arguments? With 16 arguments it does not display anything, no error messages and no values: SECTION 1: new alloc for instr 1: handle=0 OSC deinitiatised inactive allocs returned to freespace end of score. overall amps: 0.0 0.0 overall samples out of range: 0 0 0 errors in performance Elapsed time at end of performance: real: 6.764s, CPU: 6.764s closing device 72 8192 sample blks of 64-bit floats written to dac 2016-04-08 0:39 GMT+02:00 Rory Walsh |
Date | 2016-04-08 22:03 |
From | Richard |
Subject | Re: Ethernet receive |
Attachments | OSCplayer.py |
I can get 16 values without problem. However, when the message come in rapidly, say every 10 ms, I loose some values. Maybe this gluion is sending messages too fast. I've attached a small test program in Python, that can be used for testing this. You have to install pyOSC for this to work. Richard On 08/04/16 01:12, cristiano piatti wrote: > At what point do you get this message? > When i run the code. > > does it work when you only try to catch a few of the arguments? > With 16 arguments it does not display anything, no error messages and no values: > > SECTION 1: > new alloc for instr 1: > handle=0 > OSC deinitiatised > inactive allocs returned to freespace > end of score. overall amps: 0.0 0.0 > overall samples out of range: 0 0 > 0 errors in performance > Elapsed time at end of performance: real: 6.764s, CPU: 6.764s > closing device > 72 8192 sample blks of 64-bit floats written to dac > > 2016-04-08 0:39 GMT+02:00 Rory Walsh |
Date | 2016-04-09 17:05 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Hi and many thanks again for your help, which parameters have i to modify to connect my device? 2016-04-08 23:03 GMT+02:00 Richard |
Date | 2016-04-09 22:47 |
From | Richard |
Subject | Re: Ethernet receive |
Be sure to use the latest csd I posted and work from there. I do not know about the gluion and what you can modify there... Richard On 09/04/16 18:05, cristiano piatti wrote: > Hi and many thanks again for your help, > which parameters have i to modify to connect my device? > > > > 2016-04-08 23:03 GMT+02:00 Richard |
Date | 2016-04-09 23:38 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Ok, this is the output: Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================ RESTART: C:\Users\7_32\Desktop\OSCplayer.py ================ /analog 0 /analog [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] /analog 1 /analog [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] /analog 2 /analog [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] /analog 3 /analog [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] /analog 4 /analog [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4] /analog 5 /analog [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5] /analog 6 /analog [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6] /analog 7 /analog [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7] /analog 8 /analog [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8] /analog 9 /analog [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9] >>> 2016-04-09 23:47 GMT+02:00 Richard |
Date | 2016-04-09 23:42 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Maybe i don' t understand...i run .csd first and then .py on IDLE 2016-04-10 0:38 GMT+02:00 cristiano piatti |
Date | 2016-04-10 00:06 |
From | Richard |
Subject | Re: Ethernet receive |
Yes, you always start the OSC server first. In this case it is the csd, and then the client, like your gluion or my little test program. Looking at the output, it means you get the correct output, 16 integer values in this case, incremented by 1 in each message. Do you get any output when you start the csd first and then the gluion? Richard On 10/04/16 00:42, cristiano piatti wrote: > Maybe i don' t understand...i run .csd first and then .py on IDLE > > 2016-04-10 0:38 GMT+02:00 cristiano piatti |
Date | 2016-04-11 15:44 |
From | cristiano piatti |
Subject | Re: Ethernet receive |
Do you get any output when you start the csd first and then the gluion? Unfortynately no. Here is the CsoundQT output of OSCplayer.py, and it does work: SECTION 1: new alloc for instr 1: i 1 time 10.40363: 0.00000 i 1 time 10.40363: 0.00000 i 1 time 10.58957: 1.00000 i 1 time 10.58957: 1.00000 i 1 time 10.68254: 2.00000 i 1 time 10.68254: 2.00000 i 1 time 10.86848: 3.00000 i 1 time 10.86848: 3.00000 i 1 time 10.96145: 4.00000 i 1 time 10.96145: 4.00000 i 1 time 11.05442: 5.00000 i 1 time 11.05442: 5.00000 i 1 time 11.24036: 6.00000 i 1 time 11.24036: 6.00000 i 1 time 11.33333: 7.00000 i 1 time 11.33333: 7.00000 i 1 time 11.51927: 8.00000 i 1 time 11.51927: 8.00000 i 1 time 11.61224: 9.00000 i 1 time 11.61224: 9.00000 2016-04-10 1:06 GMT+02:00 Richard |