Csound Csound-dev Csound-tekno Search About

[Csnd] Best way to send Table values over OSC

Date2011-09-21 18:34
FromEd 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 

Date2011-09-21 21:41
Fromjoachim heintz
SubjectRe: [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"

Date2011-09-21 23:42
FromEd Costello
SubjectRe: [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?

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"



Date2011-09-22 00:50
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] Best way to send Table values over OSC
AttachmentsNone  None  

Date2011-09-22 02:17
FromEd Costello
SubjectRe: [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.


<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>


sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1


#define Tables #2#

#define Widgets #3#


instr Init, 1


turnon $Tables

turnon $Widgets

gk_Slider1 init 0


endin


instr Tables, 2


gi_TableSize = 16

gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize, gi_TableSize

gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0, 1, 16, 0.001


endin


instr Widgets, 3


kvalue invalue "slider1"


if kvalue != gk_Slider1 then


gk_Slider1 = kvalue

event "i", "TableEdit", 0, 1

endif


endin

instr TableEdit


kndx = 0


loop:

kres table kndx, gi_ExponentialTable

tablew kres * gk_Slider1, kndx, gi_WriteTable


loop_lt kndx, 1, gi_TableSize, loop

event "i", "OSCSend", 0, 1

turnoff


endin



instr OSCSend


S_Table = ""

indx = 0


loop:

ires table indx, gi_WriteTable

Sout sprintf "%f ", ires

S_Table strcat Sout, S_Table


loop_lt indx, 1, gi_TableSize, loop


OSCsend 0, "", 4444, "/csound", "s", S_Table


endin


</CsInstruments>

<CsScore>

i "Init" 0 10000

</CsScore>

</CsoundSynthesizer>


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.

Victor


----- Original Message -----
From: Ed Costello <edwardcostello@gmail.com>
Date: Wednesday, September 21, 2011 11:43 pm
Subject: Re: [Csnd] Best way to send Table values over OSC
To: csound@lists.bath.ac.uk

> 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?
>
> 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"
>
>


Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
National University of Ireland, Maynooth


Date2011-09-22 08:12
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] Best way to send Table values over OSC
AttachmentsNone  None  

Date2011-09-22 08:44
FromTarmo Johannes
SubjectRe: [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: Thursday, September 22, 2011 2:17 am
> Subject: Re: [Csnd] Best way to send Table values over OSC
> To: csound@lists.bath.ac.uk
> 
> > 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.
> > 
>   > 
>  > 
>  > 
>  > 
>  > 
> 
>  
>  > sr = 44100
>  > ksmps = 128
>  > nchnls = 2
>  > 0dbfs = 1
>  > 
> 
>  
>  > #define Tables #2#
>  > #define Widgets #3#
>  > 
> 
>  
>  > instr Init, 1
>  > 
> 
>  
>   > 	turnon $Tables
>  > 	turnon $Widgets
>  > 	gk_Slider1 init 0
>    > 	
>  > 
> 
>  
>  > endin
>  > 
> 
>  
>  > instr Tables, 2
>  > 
> 
>  
>   > 	gi_TableSize = 16
>  > 	gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize, gi_TableSize
>  >  	gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0, 1, 16, 0.001
>    > 
> 
>  
>  > endin
>  > 
> 
>  
>  > instr Widgets, 3
>  > 
> 
>  
>   > 	kvalue invalue "slider1"
>  > 
> 
> >  	if kvalue != gk_Slider1 then	
> > 
> 
>  >  		gk_Slider1 = kvalue
>  > 		event "i", "TableEdit", 0, 1
>  >  	endif
> > 
> 
> > endin
> > 
> >  instr TableEdit
> > 
> 
>  > 	kndx = 0
>  > 
> 
> >  	loop:
>  >      		kres table kndx, gi_ExponentialTable 
>  >     		tablew kres * gk_Slider1, kndx, gi_WriteTable 
>  > 
> 
>  > 	loop_lt kndx, 1, gi_TableSize, loop
>  > 	event "i", "OSCSend", 0, 1
>  > 	turnoff
>  > 
> 
>  
>   > 	
>     > 	
>   
>   
>   > 	
>     
>   
>   
>   > 	
>  > endin
>  > 
> 
> > 
> 
>  
>  > instr OSCSend
>  > 
> 
>  
>   > 	S_Table = ""
>  > 	indx = 0
>  > 
> 
>  > 	loop:
>  >      		ires table indx, gi_WriteTable
>  >     		Sout sprintf "%f ", ires
>  >      		S_Table strcat Sout, S_Table
> > 
> 
>  >  	loop_lt indx, 1, gi_TableSize, loop
> > 
> 
>  > 	OSCsend 0, "", 4444, "/csound", "s", S_Table
>        
>   > 	
>  > 
> 
>  > endin
>  > 
> 
>  
>  > 
>  > 
>  
>  > i	"Init"	0	10000
>  
>  
>  
>  > 
>  > 
> > 
> > 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,   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.
> > 
> > Victor> 
> > 
> > ----- Original Message -----
> > From: Ed Costello 
> >  Date: Wednesday, September 21, 2011 11:43 pm
> > Subject: Re: [Csnd] Best way to send Table values over OSC
> > To: csound@lists.bath.ac.uk
> > 
> > > 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  wrote:
>   > > 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"
>   > > 
> >  > > 
>   > 
> > 
> > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> > National University of Ireland, Maynooth
>  > 
>  
> 
> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> National University of Ireland, Maynooth
> 
> 
> 
> 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"
> 
> 


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"

Date2011-09-22 09:00
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] Best way to send Table values over OSC
AttachmentsNone  None  

Date2011-09-22 10:26
FromVictor Lazzarini
SubjectRe: [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.


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1

#define Tables #2#
#define Widgets #3#

instr Init, 1

turnon $Tables
turnon $Widgets
gk_Slider1 init 0


endin

instr Tables, 2

gi_TableSize = 16
gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize, gi_TableSize
gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0, 1, 16, 0.001

endin

instr Widgets, 3

kvalue invalue "slider1"

if kvalue != gk_Slider1 then

gk_Slider1 = kvalue
event "i", "TableEdit", 0, 1
endif

endin

instr TableEdit

kndx = 0

loop:
kres table kndx, gi_ExponentialTable
tablew kres * gk_Slider1, kndx, gi_WriteTable

loop_lt kndx, 1, gi_TableSize, loop
event "i", "OSCSend", 0, 1
turnoff

endin


instr OSCSend

S_Table = ""
indx = 0

loop:
ires table indx, gi_WriteTable
Sout sprintf "%f ", ires
S_Table strcat Sout, S_Table

loop_lt indx, 1, gi_TableSize, loop

OSCsend 0, "", 4444, "/csound", "s", S_Table


endin

</CsInstruments>
<CsScore>

i "Init" 0 10000

</CsScore>
</CsoundSynthesizer>

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.

Victor


----- Original Message -----
From: Ed Costello <edwardcostello@gmail.com>
Date: Wednesday, September 21, 2011 11:43 pm
Subject: Re: [Csnd] Best way to send Table values over OSC
To: csound@lists.bath.ac.uk

> 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?
>
> 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"
>
>


Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
National University of Ireland, Maynooth


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-09-22 11:22
Fromjpff@cs.bath.ac.uk
SubjectRe: [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: Thursday, September 22, 2011 2:17 am
>> Subject: Re: [Csnd] Best way to send Table values over OSC
>> To: csound@lists.bath.ac.uk
>>
>> > 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.
>> >
>>   > 
>>  > 
>>  > 
>>  > 
>>  >
>>
>>
>>  > sr = 44100
>>  > ksmps = 128
>>  > nchnls = 2
>>  > 0dbfs = 1
>>  >
>>
>>
>>  > #define Tables #2#
>>  > #define Widgets #3#
>>  >
>>
>>
>>  > instr Init, 1
>>  >
>>
>>
>>   > 	turnon $Tables
>>  > 	turnon $Widgets
>>  > 	gk_Slider1 init 0
>>    >
>>  >
>>
>>
>>  > endin
>>  >
>>
>>
>>  > instr Tables, 2
>>  >
>>
>>
>>   > 	gi_TableSize = 16
>>  > 	gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize,
>> gi_TableSize
>>  >  	gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0,
>> 1, 16, 0.001
>>    >
>>
>>
>>  > endin
>>  >
>>
>>
>>  > instr Widgets, 3
>>  >
>>
>>
>>   > 	kvalue invalue "slider1"
>>  >
>>
>> >  	if kvalue != gk_Slider1 then
>> >
>>
>>  >  		gk_Slider1 = kvalue
>>  > 		event "i", "TableEdit", 0, 1
>>  >  	endif
>> >
>>
>> > endin
>> >
>> >  instr TableEdit
>> >
>>
>>  > 	kndx = 0
>>  >
>>
>> >  	loop:
>>  >      		kres table kndx, gi_ExponentialTable
>>  >     		tablew kres * gk_Slider1, kndx, gi_WriteTable
>>  >
>>
>>  > 	loop_lt kndx, 1, gi_TableSize, loop
>>  > 	event "i", "OSCSend", 0, 1
>>  > 	turnoff
>>  >
>>
>>
>>   >
>>     >
>>
>>
>>   >
>>
>>
>>
>>   >
>>  > endin
>>  >
>>
>> >
>>
>>
>>  > instr OSCSend
>>  >
>>
>>
>>   > 	S_Table = ""
>>  > 	indx = 0
>>  >
>>
>>  > 	loop:
>>  >      		ires table indx, gi_WriteTable
>>  >     		Sout sprintf "%f ", ires
>>  >      		S_Table strcat Sout, S_Table
>> >
>>
>>  >  	loop_lt indx, 1, gi_TableSize, loop
>> >
>>
>>  > 	OSCsend 0, "", 4444, "/csound", "s", S_Table
>>
>>   >
>>  >
>>
>>  > endin
>>  >
>>
>>
>>  > 
>>  > 
>>
>>  > i	"Init"	0	10000
>>
>>
>>
>>  > 
>>  > 
>> >
>> > 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,   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.
>> >
>> > Victor>
>> >
>> > ----- Original Message -----
>> > From: Ed Costello 
>> >  Date: Wednesday, September 21, 2011 11:43 pm
>> > Subject: Re: [Csnd] Best way to send Table values over OSC
>> > To: csound@lists.bath.ac.uk
>> >
>> > > 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 
>> wrote:
>>   > > 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"
>>   > >
>> >  > >
>>   >
>> >
>> > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
>> > National University of Ireland, Maynooth
>>  >
>>
>>
>> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
>> National University of Ireland, Maynooth
>>
>>
>>
>> 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"
>>
>>
>
>
> 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"
>
>
>
>




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"

Date2011-09-22 12:15
FromTarmo Johannes
SubjectRe: [Csnd] Best way to send Table values over OSC
Attachmentsosc-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 
#include 
#include 

#define LENGTH 5

int main() {
  
   lo_address target=lo_address_new("localhost", "8888");
   int res;
   float data[LENGTH]={0.0,0.1,0.2,0.3,0.4}; 
   
   
   lo_blob myblob=lo_blob_new(sizeof(data[0])*LENGTH, data);
   if ((res=lo_send(target,"/blob/test","b",myblob))==-1) {
     printf("Error in sending blob\n");
     return -1;
   }
   
   return 0;
  
}

---------

running oscdump in another terminal reported correctly:

~> oscdump 8888
/blob/test b [20 byte blob]


The maximum length that one could send with floats is 
LENGTH 8184

(oscdump):
/blob/test b [32736 byte blob]

so it is quite a lot.

Thus the maximum data sent at once can be 32768 bytes and a bit less ( I think there is some extra info in the blob, I don't know).


Have a look also to http://liblo.sourceforge.net/examples/example_client.c

greetings,
tarmo


On Thursday 22 September 2011 13:22:40 jpff@cs.bath.ac.uk wrote:
> 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: Thursday, September 22, 2011 2:17 am
> >> Subject: Re: [Csnd] Best way to send Table values over OSC
> >> To: csound@lists.bath.ac.uk
> >>
> >> > 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.
> >> >
> >>   > 
> >>  > 
> >>  > 
> >>  > 
> >>  >
> >>
> >>
> >>  > sr = 44100
> >>  > ksmps = 128
> >>  > nchnls = 2
> >>  > 0dbfs = 1
> >>  >
> >>
> >>
> >>  > #define Tables #2#
> >>  > #define Widgets #3#
> >>  >
> >>
> >>
> >>  > instr Init, 1
> >>  >
> >>
> >>
> >>   > 	turnon $Tables
> >>  > 	turnon $Widgets
> >>  > 	gk_Slider1 init 0
> >>    >
> >>  >
> >>
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > instr Tables, 2
> >>  >
> >>
> >>
> >>   > 	gi_TableSize = 16
> >>  > 	gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize,
> >> gi_TableSize
> >>  >  	gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0,
> >> 1, 16, 0.001
> >>    >
> >>
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > instr Widgets, 3
> >>  >
> >>
> >>
> >>   > 	kvalue invalue "slider1"
> >>  >
> >>
> >> >  	if kvalue != gk_Slider1 then
> >> >
> >>
> >>  >  		gk_Slider1 = kvalue
> >>  > 		event "i", "TableEdit", 0, 1
> >>  >  	endif
> >> >
> >>
> >> > endin
> >> >
> >> >  instr TableEdit
> >> >
> >>
> >>  > 	kndx = 0
> >>  >
> >>
> >> >  	loop:
> >>  >      		kres table kndx, gi_ExponentialTable
> >>  >     		tablew kres * gk_Slider1, kndx, gi_WriteTable
> >>  >
> >>
> >>  > 	loop_lt kndx, 1, gi_TableSize, loop
> >>  > 	event "i", "OSCSend", 0, 1
> >>  > 	turnoff
> >>  >
> >>
> >>
> >>   >
> >>     >
> >>
> >>
> >>   >
> >>
> >>
> >>
> >>   >
> >>  > endin
> >>  >
> >>
> >> >
> >>
> >>
> >>  > instr OSCSend
> >>  >
> >>
> >>
> >>   > 	S_Table = ""
> >>  > 	indx = 0
> >>  >
> >>
> >>  > 	loop:
> >>  >      		ires table indx, gi_WriteTable
> >>  >     		Sout sprintf "%f ", ires
> >>  >      		S_Table strcat Sout, S_Table
> >> >
> >>
> >>  >  	loop_lt indx, 1, gi_TableSize, loop
> >> >
> >>
> >>  > 	OSCsend 0, "", 4444, "/csound", "s", S_Table
> >>
> >>   >
> >>  >
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > 
> >>  > 
> >>
> >>  > i	"Init"	0	10000
> >>
> >>
> >>
> >>  > 
> >>  > 
> >> >
> >> > 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,   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.
> >> >
> >> > Victor>
> >> >
> >> > ----- Original Message -----
> >> > From: Ed Costello 
> >> >  Date: Wednesday, September 21, 2011 11:43 pm
> >> > Subject: Re: [Csnd] Best way to send Table values over OSC
> >> > To: csound@lists.bath.ac.uk
> >> >
> >> > > 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 
> >> wrote:
> >>   > > 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"
> >>   > >
> >> >  > >
> >>   >
> >> >
> >> > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> >> > National University of Ireland, Maynooth
> >>  >
> >>
> >>
> >> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> >> National University of Ireland, Maynooth
> >>
> >>
> >>
> >> 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"
> >>
> >>
> >
> >
> > 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"
> >
> >
> >
> >
> 
> 
> 
> 
> 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"
> 
> 

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"


Date2011-09-22 16:37
FromEd Costello
SubjectRe: [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:

OSCsend 0, "", 4444, "/csound", "ffff", k1, k2, k3, k4

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:

instr Widgets, 3


kvalue invalue "slider1"

kint = int (kvalue * 10)


if kint != gk_Slider1 then

gk_Slider1 = kint

event "i", "TableEdit", 0, 1

endif

endin


On 22 September 2011 12:15, Tarmo Johannes <tarmo@otsakool.edu.ee> wrote:
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 <lo/lo.h>
#include <stdio.h>
#include <stdlib.h>

#define LENGTH 5

int main() {

  lo_address target=lo_address_new("localhost", "8888");
  int res;
  float data[LENGTH]={0.0,0.1,0.2,0.3,0.4};


  lo_blob myblob=lo_blob_new(sizeof(data[0])*LENGTH, data);
  if ((res=lo_send(target,"/blob/test","b",myblob))==-1) {
    printf("Error in sending blob\n");
    return -1;
  }

  return 0;

}

---------

running oscdump in another terminal reported correctly:

~> oscdump 8888
/blob/test b [20 byte blob]


The maximum length that one could send with floats is
LENGTH 8184

(oscdump):
/blob/test b [32736 byte blob]

so it is quite a lot.

Thus the maximum data sent at once can be 32768 bytes and a bit less ( I think there is some extra info in the blob, I don't know).


Have a look also to http://liblo.sourceforge.net/examples/example_client.c

greetings,
tarmo


On Thursday 22 September 2011 13:22:40 jpff@cs.bath.ac.uk wrote:
> 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 <edwardcostello@gmail.com>
> >> Date: Thursday, September 22, 2011 2:17 am
> >> Subject: Re: [Csnd] Best way to send Table values over OSC
> >> To: csound@lists.bath.ac.uk
> >>
> >> > 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.
> >> >
> >>   > <CsoundSynthesizer>
> >>  > <CsOptions>
> >>  > </CsOptions>
> >>  > <CsInstruments>
> >>  >
> >>
> >>
> >>  > sr = 44100
> >>  > ksmps = 128
> >>  > nchnls = 2
> >>  > 0dbfs = 1
> >>  >
> >>
> >>
> >>  > #define Tables #2#
> >>  > #define Widgets #3#
> >>  >
> >>
> >>
> >>  > instr Init, 1
> >>  >
> >>
> >>
> >>   >        turnon $Tables
> >>  >         turnon $Widgets
> >>  >         gk_Slider1 init 0
> >>    >
> >>  >
> >>
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > instr Tables, 2
> >>  >
> >>
> >>
> >>   >        gi_TableSize = 16
> >>  >         gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize,
> >> gi_TableSize
> >>  >         gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0,
> >> 1, 16, 0.001
> >>    >
> >>
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > instr Widgets, 3
> >>  >
> >>
> >>
> >>   >        kvalue invalue "slider1"
> >>  >
> >>
> >> >          if kvalue != gk_Slider1 then
> >> >
> >>
> >>  >                 gk_Slider1 = kvalue
> >>  >                 event "i", "TableEdit", 0, 1
> >>  >         endif
> >> >
> >>
> >> > endin
> >> >
> >> >  instr TableEdit
> >> >
> >>
> >>  >         kndx = 0
> >>  >
> >>
> >> >          loop:
> >>  >                 kres table kndx, gi_ExponentialTable
> >>  >                 tablew kres * gk_Slider1, kndx, gi_WriteTable
> >>  >
> >>
> >>  >         loop_lt kndx, 1, gi_TableSize, loop
> >>  >         event "i", "OSCSend", 0, 1
> >>  >         turnoff
> >>  >
> >>
> >>
> >>   >
> >>     >
> >>
> >>
> >>   >
> >>
> >>
> >>
> >>   >
> >>  > endin
> >>  >
> >>
> >> >
> >>
> >>
> >>  > instr OSCSend
> >>  >
> >>
> >>
> >>   >        S_Table = ""
> >>  >         indx = 0
> >>  >
> >>
> >>  >         loop:
> >>  >                 ires table indx, gi_WriteTable
> >>  >                 Sout sprintf "%f ", ires
> >>  >                 S_Table strcat Sout, S_Table
> >> >
> >>
> >>  >         loop_lt indx, 1, gi_TableSize, loop
> >> >
> >>
> >>  >         OSCsend 0, "", 4444, "/csound", "s", S_Table
> >>
> >>   >
> >>  >
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > </CsInstruments>
> >>  > <CsScore>
> >>
> >>  > i       "Init"  0       10000
> >>
> >>
> >>
> >>  > </CsScore>
> >>  > </CsoundSynthesizer>
> >> >
> >> > 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.
> >> >
> >> > Victor>
> >> >
> >> > ----- Original Message -----
> >> > From: Ed Costello <edwardcostello@gmail.com>
> >> >  Date: Wednesday, September 21, 2011 11:43 pm
> >> > Subject: Re: [Csnd] Best way to send Table values over OSC
> >> > To: csound@lists.bath.ac.uk
> >> >
> >> > > 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?
> >>   > >
> >> > >  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"
> >>   > >
> >> >  > >
> >>   >
> >> >
> >> > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> >> > National University of Ireland, Maynooth
> >>  >
> >>
> >>
> >> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> >> National University of Ireland, Maynooth
> >>
> >>
> >>
> >> 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"
> >>
> >>
> >
> >
> > 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"
> >
> >
> >
> >
>
>
>
>
> 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"
>
>

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"



Date2011-09-22 22:04
FromEd Costello
SubjectRe: [Csnd] Best way to send Table values over OSC
I changed the OSC instrument also to this:

instr OSCSend


gi_Count = gi_Count + 1


; S_Table = ""

; indx = 0

; loop:

; ires table indx, gi_WriteTable

; Sout sprintf "%f ", ires

; S_Table strcat Sout, S_Table

;

; loop_lt indx, 1, gi_TableSize, loop



i1 table 0, gi_WriteTable

i2 table 1, gi_WriteTable

i3 table 2, gi_WriteTable

i4 table 3, gi_WriteTable

i5 table 4, gi_WriteTable

i6 table 5, gi_WriteTable

i7 table 6, gi_WriteTable

i8 table 7, gi_WriteTable

i9 table 8, gi_WriteTable

i10 table 9, gi_WriteTable

i11 table 10, gi_WriteTable

i12 table 11, gi_WriteTable

i13 table 12, gi_WriteTable

i14 table 13, gi_WriteTable

i15 table 14, gi_WriteTable

i16 table 15, gi_WriteTable


OSCsend 0, "", 4444, "/csound", "ffffffffffffffff", i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16


print gi_Count

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-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.
 
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:

OSCsend 0, "", 4444, "/csound", "ffff", k1, k2, k3, k4

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:

instr Widgets, 3


kvalue invalue "slider1"

kint = int (kvalue * 10)


if kint != gk_Slider1 then

gk_Slider1 = kint

event "i", "TableEdit", 0, 1

endif

endin


On 22 September 2011 12:15, Tarmo Johannes <tarmo@otsakool.edu.ee> wrote:
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 <lo/lo.h>
#include <stdio.h>
#include <stdlib.h>

#define LENGTH 5

int main() {

  lo_address target=lo_address_new("localhost", "8888");
  int res;
  float data[LENGTH]={0.0,0.1,0.2,0.3,0.4};


  lo_blob myblob=lo_blob_new(sizeof(data[0])*LENGTH, data);
  if ((res=lo_send(target,"/blob/test","b",myblob))==-1) {
    printf("Error in sending blob\n");
    return -1;
  }

  return 0;

}

---------

running oscdump in another terminal reported correctly:

~> oscdump 8888
/blob/test b [20 byte blob]


The maximum length that one could send with floats is
LENGTH 8184

(oscdump):
/blob/test b [32736 byte blob]

so it is quite a lot.

Thus the maximum data sent at once can be 32768 bytes and a bit less ( I think there is some extra info in the blob, I don't know).


Have a look also to http://liblo.sourceforge.net/examples/example_client.c

greetings,
tarmo


On Thursday 22 September 2011 13:22:40 jpff@cs.bath.ac.uk wrote:
> 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 <edwardcostello@gmail.com>
> >> Date: Thursday, September 22, 2011 2:17 am
> >> Subject: Re: [Csnd] Best way to send Table values over OSC
> >> To: csound@lists.bath.ac.uk
> >>
> >> > 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.
> >> >
> >>   > <CsoundSynthesizer>
> >>  > <CsOptions>
> >>  > </CsOptions>
> >>  > <CsInstruments>
> >>  >
> >>
> >>
> >>  > sr = 44100
> >>  > ksmps = 128
> >>  > nchnls = 2
> >>  > 0dbfs = 1
> >>  >
> >>
> >>
> >>  > #define Tables #2#
> >>  > #define Widgets #3#
> >>  >
> >>
> >>
> >>  > instr Init, 1
> >>  >
> >>
> >>
> >>   >        turnon $Tables
> >>  >         turnon $Widgets
> >>  >         gk_Slider1 init 0
> >>    >
> >>  >
> >>
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > instr Tables, 2
> >>  >
> >>
> >>
> >>   >        gi_TableSize = 16
> >>  >         gi_WriteTable ftgen 100, 0, gi_TableSize, 7, 1, gi_TableSize,
> >> gi_TableSize
> >>  >         gi_ExponentialTable ftgen 101, 0, gi_TableSize, 5, 1, 0, 0.0001, 0,
> >> 1, 16, 0.001
> >>    >
> >>
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > instr Widgets, 3
> >>  >
> >>
> >>
> >>   >        kvalue invalue "slider1"
> >>  >
> >>
> >> >          if kvalue != gk_Slider1 then
> >> >
> >>
> >>  >                 gk_Slider1 = kvalue
> >>  >                 event "i", "TableEdit", 0, 1
> >>  >         endif
> >> >
> >>
> >> > endin
> >> >
> >> >  instr TableEdit
> >> >
> >>
> >>  >         kndx = 0
> >>  >
> >>
> >> >          loop:
> >>  >                 kres table kndx, gi_ExponentialTable
> >>  >                 tablew kres * gk_Slider1, kndx, gi_WriteTable
> >>  >
> >>
> >>  >         loop_lt kndx, 1, gi_TableSize, loop
> >>  >         event "i", "OSCSend", 0, 1
> >>  >         turnoff
> >>  >
> >>
> >>
> >>   >
> >>     >
> >>
> >>
> >>   >
> >>
> >>
> >>
> >>   >
> >>  > endin
> >>  >
> >>
> >> >
> >>
> >>
> >>  > instr OSCSend
> >>  >
> >>
> >>
> >>   >        S_Table = ""
> >>  >         indx = 0
> >>  >
> >>
> >>  >         loop:
> >>  >                 ires table indx, gi_WriteTable
> >>  >                 Sout sprintf "%f ", ires
> >>  >                 S_Table strcat Sout, S_Table
> >> >
> >>
> >>  >         loop_lt indx, 1, gi_TableSize, loop
> >> >
> >>
> >>  >         OSCsend 0, "", 4444, "/csound", "s", S_Table
> >>
> >>   >
> >>  >
> >>
> >>  > endin
> >>  >
> >>
> >>
> >>  > </CsInstruments>
> >>  > <CsScore>
> >>
> >>  > i       "Init"  0       10000
> >>
> >>
> >>
> >>  > </CsScore>
> >>  > </CsoundSynthesizer>
> >> >
> >> > 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.
> >> >
> >> > Victor>
> >> >
> >> > ----- Original Message -----
> >> > From: Ed Costello <edwardcostello@gmail.com>
> >> >  Date: Wednesday, September 21, 2011 11:43 pm
> >> > Subject: Re: [Csnd] Best way to send Table values over OSC
> >> > To: csound@lists.bath.ac.uk
> >> >
> >> > > 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?
> >>   > >
> >> > >  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"
> >>   > >
> >> >  > >
> >>   >
> >> >
> >> > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> >> > National University of Ireland, Maynooth
> >>  >
> >>
> >>
> >> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> >> National University of Ireland, Maynooth
> >>
> >>
> >>
> >> 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"
> >>
> >>
> >
> >
> > 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"
> >
> >
> >
> >
>
>
>
>
> 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"
>
>

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"




Date2011-09-23 13:15
Fromjpff@cs.bath.ac.uk
SubjectRe: [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"

Date2011-09-23 17:26
FromEd Costello
SubjectRe: [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:

> 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"



Date2011-09-23 19:26
Fromjpff@cs.bath.ac.uk
SubjectRe: [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,  wrote:
>
>>
>> > 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"
>>
>>
>
> 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"
>
>




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"

Date2011-09-23 20:17
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] Best way to send Table values over OSC
AttachmentsNone  None