[Csnd] Best way to send Table values over OSC
Date | 2011-09-21 18:34 |
From | Ed Costello |
Subject | [Csnd] Best way to send Table values over OSC |
Hi, I am using Csound with Quartz Composer, I am linking the programs using OSC. I was just wondering if there is an easier way of sending a large amount of table values in one OSC message. I am aware that you can use the table opcode to read values and assign them variables that are passed to an OSCSend, but is there a better way of doing this with large tables?
Thanks Ed
|
Date | 2011-09-21 21:41 |
From | joachim heintz |
Subject | Re: [Csnd] Best way to send Table values over OSC |
perhaps it's possible to send the table values as a string? Am 21.09.2011 19:34, schrieb Ed Costello: > Hi, > > I am using Csound with Quartz Composer, I am linking the programs using > OSC. I was just wondering if there is an easier way of sending a large > amount of table values in one OSC message. I am aware that you can use > the table opcode to read values and assign them variables that are > passed to an OSCSend, but is there a better way of doing this with large > tables? > Thanks > Ed Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-09-21 23:42 |
From | Ed Costello |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Can you print the values of a table to a string? If so yes it should work. On 21 September 2011 21:41, joachim heintz <jh@joachimheintz.de> wrote: perhaps it's possible to send the table values as a string? |
Date | 2011-09-22 00:50 |
From | Victor.Lazzarini@nuim.ie |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Attachments | None None |
Date | 2011-09-22 02:17 |
From | Ed Costello |
Subject | Re: [Csnd] Best way to send Table values over OSC |
After some playing around I came up with something that works but not for very long, the OSC stops sending after a few seconds and if I try to restart QuteCsound it crashes.
endin
I'm using a slider widget and every time it moves it triggers an instrument which reads from a table, scales its values and then writes them to the table I want to send over OSC. This then triggers the OSCSend instrument which concatenates the table numbers to a string and sends them over OSC. Along with the crashing Csound also complains of buffer overflows if my table is too big, I'm using a size of 16 here, but it complains at 32. Any ideas?
On 22 September 2011 00:50, <Victor.Lazzarini@nuim.ie> wrote: I would have thought a k-rate loop would be better. However, I'm not sure OSC is designed to handle big amounts of data. |
Date | 2011-09-22 08:12 |
From | Victor.Lazzarini@nuim.ie |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Attachments | None None |
Date | 2011-09-22 08:44 |
From | Tarmo Johannes |
Subject | Re: [Csnd] Best way to send Table values over OSC |
hello, this is not a solution, more for discussion: the osc library http://liblo.sourceforge.net/docs/group__liblo.html has declared a type blob - basically an array of binary data created with function lo_blob lo_blob_new (int32_t size, const void *data) Create a new OSC blob type. I think it is not implemented in Csound and not sure if other programs support it eihter, but in such cases (to forward a lot of data) it could be the ideal solution. greetings, tarmo On Thursday 22 September 2011 10:12:59 Victor.Lazzarini@nuim.ie wrote: > Why are you sending numeric data as strings? I would send them as floats (or doubles). The problem might be with Sprintf, possibly. > > Try to send one table at a time, too. You might be triggering too many events. > > ----- Original Message ----- > From: Ed Costello |
Date | 2011-09-22 09:00 |
From | Victor.Lazzarini@nuim.ie |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Attachments | None None |
Date | 2011-09-22 10:26 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Best way to send Table values over OSC |
I tested your code here and I am positive that using a slider like that is your source of trouble. There are simply too many OSC messages being sent. It's not what OSC is designed for. Use a button to trigger new messages and you will see no crashes. Victor On 22 Sep 2011, at 02:17, Ed Costello wrote: After some playing around I came up with something that works but not for very long, the OSC stops sending after a few seconds and if I try to restart QuteCsound it crashes. Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2011-09-22 11:22 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Csnd] Best way to send Table values over OSC |
At present, and I have no plans to change, we rely on the liblo package. If the blob is accepted into liblo we might attempt to deploy it. ==John ff > hello, > > this is not a solution, more for discussion: > > the osc library http://liblo.sourceforge.net/docs/group__liblo.html > has declared a type blob - basically an array of binary data > created with function > > lo_blob lo_blob_new (int32_t size, const void *data) > Create a new OSC blob type. > > > I think it is not implemented in Csound and not sure if other programs > support it eihter, but in such cases (to forward a lot of data) it could > be the ideal solution. > > greetings, > tarmo > > > > On Thursday 22 September 2011 10:12:59 Victor.Lazzarini@nuim.ie wrote: >> Why are you sending numeric data as strings? I would send them as floats >> (or doubles). The problem might be with Sprintf, possibly. >> >> Try to send one table at a time, too. You might be triggering too many >> events. >> >> ----- Original Message ----- >> From: Ed Costello |
Date | 2011-09-22 12:15 |
From | Tarmo Johannes |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Attachments | osc-send-blob.c |
yes, I think it is a part of liblo. I wrote a very simple test program (also attached): -------- // to test, if sendosc blob type works // link with -llo flag #include |
Date | 2011-09-22 16:37 |
From | Ed Costello |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Quartz composer has support for receiving arrays of floats over OSC, are these equivalent to OSC blobs? For example you can do an:And this will be interpreted as a size 4 array of OSC floats. I tried changing my widget instrument code so that it only fires the OSC messages when the position of the slider (0.0 - 1.0) multiplied by 10 is an integer. It still stops working after a few seconds though. Is using a button the only option? I am trying to visualize tables in real time using QC as QuteCsound can't do that at this time.
The widget instrument is:
On 22 September 2011 12:15, Tarmo Johannes <tarmo@otsakool.edu.ee> wrote: yes, I think it is a part of liblo. |
Date | 2011-09-22 22:04 |
From | Ed Costello |
Subject | Re: [Csnd] Best way to send Table values over OSC |
I changed the OSC instrument also to this: instr OSCSend
endin This instrument is called less often than I had before because I changed the code to send OSC messages every 1/10 the length of the slider I was using. I thought this way would work properly but strangely it stops working exactly after 242 calls of the OSCSend instrument, this also happens if I just send 8 values instead of 16. I found this error in the console when it stopped working:
QuteCsound also cannot save any changes to open files after this error. Ed On 22 September 2011 16:37, Ed Costello <edwardcostello@gmail.com> wrote: Quartz composer has support for receiving arrays of floats over OSC, are these equivalent to OSC blobs? For example you can do an: |
Date | 2011-09-23 13:15 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Csnd] Best way to send Table values over OSC |
> I > thought this way would work properly but strangely it stops working > exactly > after 242 calls of the OSCSend instrument, this also happens if I just > send > 8 values instead of 16. I found this error in the console when it stopped > working: > > qutecsound-f[1022]: dnssd_clientstub deliver_request: socketpair failed 24 > (Too many open files) > > QuteCsound also cannot save any changes to open files after this error. > > This looks odd but interesting. Too many open files woriesme as I would not expect any files to be opened. Can you remind me which platform this is? I am fairly sure that the Csound/OSC code does not open files, so either liblo is or your code is.... ==John ff Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-09-23 17:26 |
From | Ed Costello |
Subject | Re: [Csnd] Best way to send Table values over OSC |
I rewrote my code so a lot of the work is done by just one instrument. I don't know how the OSCSend works in Csound, but It seems that every time the instrument that sends the OSC messages is called it instantiates another OSC sender that is not removed when the instrument is turned off. When the amount of instantiated OSC senders reaches 242 it seems to run out of memory and just stops working.
Ed
On 23 September 2011 13:15, <jpff@cs.bath.ac.uk> wrote:
|
Date | 2011-09-23 19:26 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Csnd] Best way to send Table values over OSC |
It looks as if there is no code to remove listeners. I think I was expecting people would have universal instruments for this. Staring at the code but not sure where to fix. Looks like the need for a destructor. ==John ff > I rewrote my code so a lot of the work is done by just one instrument. I > don't know how the OSCSend works in Csound, but It seems that every time > the instrument that sends the OSC messages is called it instantiates > another > OSC sender that is not removed when the instrument is turned off. When > the > amount of instantiated OSC senders reaches 242 it seems to run out of > memory > and just stops working. > Ed > > On 23 September 2011 13:15, |
Date | 2011-09-23 20:17 |
From | Victor.Lazzarini@nuim.ie |
Subject | Re: [Csnd] Best way to send Table values over OSC |
Attachments | None None |