Csound Csound-dev Csound-tekno Search About

OSCsend-problem

Date2015-06-16 21:44
FromSchnitzer Wolfgang
SubjectOSCsend-problem
Hi,
I have a bigger project with csound and oscsend. One problem that occurs 
is: if I send more than one osc-message for the first time with oscsend, 
only one message gets through. If sending the messages a second time, 
all the messages arrive as expected. Waiting about one minute and 
starting the process once again, the problem comes up again. I use 
Windows 7 over network with two machines, not localhost.

Wolfgang

/*Send-Instrument*/



-b128 -B256 -d -m263 -odac7


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

#define    IPADDRESS        # "192.168.0.103" #
#define    S_PORT         # 9001 #

instr    1
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
endin



i 1 0 0.5
;i 1 0.5 0.5



/*Receive-Instrument*/



-b128 -B256 -d -m263 -odac7


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


#define    R_PORT         # 9001 #
giPort     OSCinit        9001

instr    2
     kMessage1        init    0
     kMessage1t    init    0
     kMessage2        init    0
     kMessage2t    init    0
     kMessage3        init    0
     kMessage3t    init    0
     kMessage4        init    0
     kMessage4t    init    0
     kMessage5        init    0
     kMessage5t    init    0
     kMessage6        init    0
     kMessage6t    init    0
     kMessage7        init    0
     kMessage7t    init    0
     kMessage8        init    0
     kMessage8t    init    0
     kMessage9        init    0
     kMessage9t    init    0
     kMessage10        init    0
     kMessage10t    init    0
     kMessage11        init    0
     kMessage11t    init    0
     kMessage12        init    0
     kMessage12t    init    0
     kMessage13        init    0
     kMessage13t    init    0
     kMessage14        init    0
     kMessage14t    init    0
     kMessage15        init    0
     kMessage15t    init    0
NXTMSG:
     kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
     if (kNewM1 == 1) then
         kMessage1 = kMessage1t
         printks "Neue Nachricht1: %f\n",0,kMessage1
     endif
     kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
     if (kNewM2 == 1) then
         kMessage2 = kMessage2t
         printks "Neue Nachricht2: %f\n",0,kMessage2
     endif
     kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
     if (kNewM3 == 1) then
         kMessage3 = kMessage3t
         printks "Neue Nachricht3: %f\n",0,kMessage3
     endif
     kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
     if (kNewM4 == 1) then
         kMessage4 = kMessage4t
         printks "Neue Nachricht4: %f\n",0,kMessage4
     endif
     kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
     if (kNewM5 == 1) then
         kMessage5 = kMessage5t
         printks "Neue Nachricht5: %f\n",0,kMessage5
     endif
     kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
     if (kNewM6 == 1) then
         kMessage6 = kMessage6t
         printks "Neue Nachricht6: %f\n",0,kMessage6
     endif
     kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
     if (kNewM7 == 1) then
         kMessage7 = kMessage7t
         printks "Neue Nachricht7: %f\n",0,kMessage7
     endif
     kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
     if (kNewM8 == 1) then
         kMessage8 = kMessage8t
         printks "Neue Nachricht8: %f\n",0,kMessage8
     endif
     kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
     if (kNewM9 == 1) then
         kMessage9 = kMessage9t
         printks "Neue Nachricht9: %f\n",0,kMessage9
     endif
     kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
     if (kNewM10 == 1) then
         kMessage10 = kMessage10t
         printks "Neue Nachricht10: %f\n",0,kMessage10
     endif
     kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
     if (kNewM11 == 1) then
         kMessage11 = kMessage11t
         printks "Neue Nachricht11: %f\n",0,kMessage11
     endif
     kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
     if (kNewM12 == 1) then
         kMessage12 = kMessage12t
         printks "Neue Nachricht12: %f\n",0,kMessage12
     endif
     kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
     if (kNewM13 == 1) then
         kMessage13 = kMessage13t
         printks "Neue Nachricht13: %f\n",0,kMessage13
     endif
     kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
     if (kNewM14 == 1) then
         kMessage14 = kMessage14t
         printks "Neue Nachricht14: %f\n",0,kMessage14
     endif
     kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
     if (kNewM15 == 1) then
         kMessage15 = kMessage15t
         printks "Neue Nachricht15: %f\n",0,kMessage15
     endif
     kNewM    = 
kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
     if ( kNewM == 0 ) goto CONTINUE
     kgoto NXTMSG
CONTINUE:
     endin



i 2 0 20




------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-16 23:36
FromOeyvind Brandtsegg
SubjectRe: OSCsend-problem
Hi Wolfgang,
By waiting one minute and starting the process again, do you mean
restarting Csound, or just adding the same instrument call at time 60
in the (same) score?
If you are restarting Csound, I would expect the same thing to happen
over and over. ... or do you mean the messages all come through if you
run the sender csd twice in a row (restarting Csound) without waiting
more than a few seconds?

Also, the receiver instrument looks a bit odd to me, maybe I'm
overlooking something(?)
What I mean is that you multiply the kNewM variables, which mean that
if *any* of the OSClisten instances has an empty message queue, you
will skip to continue. That could potentially leave messages in some
of the queues, and could mess up the expected order of received
events, I think.
A simple thing to test would be to use addition instead
(kNewM1+kNewM2+...), which should let you loop until all queues are
empty. However, if it was me, I'd make one loop for each OSClisten,
making sure that they all read until the queue is empty and then do
not read again until the next k-pass. This may or may not relate to
the erratic behaviour you experience, not sure.

Oeyvind

2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang :
> Hi,
> I have a bigger project with csound and oscsend. One problem that occurs
> is: if I send more than one osc-message for the first time with oscsend,
> only one message gets through. If sending the messages a second time,
> all the messages arrive as expected. Waiting about one minute and
> starting the process once again, the problem comes up again. I use
> Windows 7 over network with two machines, not localhost.
>
> Wolfgang
>
> /*Send-Instrument*/
>
> 
> 
> -b128 -B256 -d -m263 -odac7
> 
> 
> sr        =    44100
> ksmps    =    32
> nchnls    =    2
> 0dbfs    =    1
>
> #define    IPADDRESS        # "192.168.0.103" #
> #define    S_PORT         # 9001 #
>
> instr    1
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
> endin
>
> 
> 
> i 1 0 0.5
> ;i 1 0.5 0.5
> 
> 
>
> /*Receive-Instrument*/
>
> 
> 
> -b128 -B256 -d -m263 -odac7
> 
> 
> sr        =    44100
> ksmps    =    32
> nchnls    =    2
> 0dbfs    =    1
>
>
> #define    R_PORT         # 9001 #
> giPort     OSCinit        9001
>
> instr    2
>      kMessage1        init    0
>      kMessage1t    init    0
>      kMessage2        init    0
>      kMessage2t    init    0
>      kMessage3        init    0
>      kMessage3t    init    0
>      kMessage4        init    0
>      kMessage4t    init    0
>      kMessage5        init    0
>      kMessage5t    init    0
>      kMessage6        init    0
>      kMessage6t    init    0
>      kMessage7        init    0
>      kMessage7t    init    0
>      kMessage8        init    0
>      kMessage8t    init    0
>      kMessage9        init    0
>      kMessage9t    init    0
>      kMessage10        init    0
>      kMessage10t    init    0
>      kMessage11        init    0
>      kMessage11t    init    0
>      kMessage12        init    0
>      kMessage12t    init    0
>      kMessage13        init    0
>      kMessage13t    init    0
>      kMessage14        init    0
>      kMessage14t    init    0
>      kMessage15        init    0
>      kMessage15t    init    0
> NXTMSG:
>      kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
>      if (kNewM1 == 1) then
>          kMessage1 = kMessage1t
>          printks "Neue Nachricht1: %f\n",0,kMessage1
>      endif
>      kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
>      if (kNewM2 == 1) then
>          kMessage2 = kMessage2t
>          printks "Neue Nachricht2: %f\n",0,kMessage2
>      endif
>      kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
>      if (kNewM3 == 1) then
>          kMessage3 = kMessage3t
>          printks "Neue Nachricht3: %f\n",0,kMessage3
>      endif
>      kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
>      if (kNewM4 == 1) then
>          kMessage4 = kMessage4t
>          printks "Neue Nachricht4: %f\n",0,kMessage4
>      endif
>      kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
>      if (kNewM5 == 1) then
>          kMessage5 = kMessage5t
>          printks "Neue Nachricht5: %f\n",0,kMessage5
>      endif
>      kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
>      if (kNewM6 == 1) then
>          kMessage6 = kMessage6t
>          printks "Neue Nachricht6: %f\n",0,kMessage6
>      endif
>      kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
>      if (kNewM7 == 1) then
>          kMessage7 = kMessage7t
>          printks "Neue Nachricht7: %f\n",0,kMessage7
>      endif
>      kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
>      if (kNewM8 == 1) then
>          kMessage8 = kMessage8t
>          printks "Neue Nachricht8: %f\n",0,kMessage8
>      endif
>      kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
>      if (kNewM9 == 1) then
>          kMessage9 = kMessage9t
>          printks "Neue Nachricht9: %f\n",0,kMessage9
>      endif
>      kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
>      if (kNewM10 == 1) then
>          kMessage10 = kMessage10t
>          printks "Neue Nachricht10: %f\n",0,kMessage10
>      endif
>      kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
>      if (kNewM11 == 1) then
>          kMessage11 = kMessage11t
>          printks "Neue Nachricht11: %f\n",0,kMessage11
>      endif
>      kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
>      if (kNewM12 == 1) then
>          kMessage12 = kMessage12t
>          printks "Neue Nachricht12: %f\n",0,kMessage12
>      endif
>      kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
>      if (kNewM13 == 1) then
>          kMessage13 = kMessage13t
>          printks "Neue Nachricht13: %f\n",0,kMessage13
>      endif
>      kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
>      if (kNewM14 == 1) then
>          kMessage14 = kMessage14t
>          printks "Neue Nachricht14: %f\n",0,kMessage14
>      endif
>      kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
>      if (kNewM15 == 1) then
>          kMessage15 = kMessage15t
>          printks "Neue Nachricht15: %f\n",0,kMessage15
>      endif
>      kNewM    =
> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
>      if ( kNewM == 0 ) goto CONTINUE
>      kgoto NXTMSG
> CONTINUE:
>      endin
>
> 
> 
> i 2 0 20
> 
> 
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Date2015-06-17 06:20
FromEduardo Moguillansky
SubjectRe: OSCsend-problem
Hi Wolfgang,

Both your sending and receiving instruments are working here (linux), 
both on localhost and over the network, all messages are sent the first 
time. Maybe something Windows specific?

Eduardo



On 16.06.2015 22:44, Schnitzer Wolfgang wrote:
> Hi,
> I have a bigger project with csound and oscsend. One problem that occurs
> is: if I send more than one osc-message for the first time with oscsend,
> only one message gets through. If sending the messages a second time,
> all the messages arrive as expected. Waiting about one minute and
> starting the process once again, the problem comes up again. I use
> Windows 7 over network with two machines, not localhost.
>
> Wolfgang
>
> /*Send-Instrument*/
>
> 
> 
> -b128 -B256 -d -m263 -odac7
> 
> 
> sr        =    44100
> ksmps    =    32
> nchnls    =    2
> 0dbfs    =    1
>
> #define    IPADDRESS        # "192.168.0.103" #
> #define    S_PORT         # 9001 #
>
> instr    1
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
> endin
>
> 
> 
> i 1 0 0.5
> ;i 1 0.5 0.5
> 
> 
>
> /*Receive-Instrument*/
>
> 
> 
> -b128 -B256 -d -m263 -odac7
> 
> 
> sr        =    44100
> ksmps    =    32
> nchnls    =    2
> 0dbfs    =    1
>
>
> #define    R_PORT         # 9001 #
> giPort     OSCinit        9001
>
> instr    2
>       kMessage1        init    0
>       kMessage1t    init    0
>       kMessage2        init    0
>       kMessage2t    init    0
>       kMessage3        init    0
>       kMessage3t    init    0
>       kMessage4        init    0
>       kMessage4t    init    0
>       kMessage5        init    0
>       kMessage5t    init    0
>       kMessage6        init    0
>       kMessage6t    init    0
>       kMessage7        init    0
>       kMessage7t    init    0
>       kMessage8        init    0
>       kMessage8t    init    0
>       kMessage9        init    0
>       kMessage9t    init    0
>       kMessage10        init    0
>       kMessage10t    init    0
>       kMessage11        init    0
>       kMessage11t    init    0
>       kMessage12        init    0
>       kMessage12t    init    0
>       kMessage13        init    0
>       kMessage13t    init    0
>       kMessage14        init    0
>       kMessage14t    init    0
>       kMessage15        init    0
>       kMessage15t    init    0
> NXTMSG:
>       kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
>       if (kNewM1 == 1) then
>           kMessage1 = kMessage1t
>           printks "Neue Nachricht1: %f\n",0,kMessage1
>       endif
>       kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
>       if (kNewM2 == 1) then
>           kMessage2 = kMessage2t
>           printks "Neue Nachricht2: %f\n",0,kMessage2
>       endif
>       kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
>       if (kNewM3 == 1) then
>           kMessage3 = kMessage3t
>           printks "Neue Nachricht3: %f\n",0,kMessage3
>       endif
>       kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
>       if (kNewM4 == 1) then
>           kMessage4 = kMessage4t
>           printks "Neue Nachricht4: %f\n",0,kMessage4
>       endif
>       kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
>       if (kNewM5 == 1) then
>           kMessage5 = kMessage5t
>           printks "Neue Nachricht5: %f\n",0,kMessage5
>       endif
>       kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
>       if (kNewM6 == 1) then
>           kMessage6 = kMessage6t
>           printks "Neue Nachricht6: %f\n",0,kMessage6
>       endif
>       kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
>       if (kNewM7 == 1) then
>           kMessage7 = kMessage7t
>           printks "Neue Nachricht7: %f\n",0,kMessage7
>       endif
>       kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
>       if (kNewM8 == 1) then
>           kMessage8 = kMessage8t
>           printks "Neue Nachricht8: %f\n",0,kMessage8
>       endif
>       kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
>       if (kNewM9 == 1) then
>           kMessage9 = kMessage9t
>           printks "Neue Nachricht9: %f\n",0,kMessage9
>       endif
>       kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
>       if (kNewM10 == 1) then
>           kMessage10 = kMessage10t
>           printks "Neue Nachricht10: %f\n",0,kMessage10
>       endif
>       kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
>       if (kNewM11 == 1) then
>           kMessage11 = kMessage11t
>           printks "Neue Nachricht11: %f\n",0,kMessage11
>       endif
>       kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
>       if (kNewM12 == 1) then
>           kMessage12 = kMessage12t
>           printks "Neue Nachricht12: %f\n",0,kMessage12
>       endif
>       kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
>       if (kNewM13 == 1) then
>           kMessage13 = kMessage13t
>           printks "Neue Nachricht13: %f\n",0,kMessage13
>       endif
>       kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
>       if (kNewM14 == 1) then
>           kMessage14 = kMessage14t
>           printks "Neue Nachricht14: %f\n",0,kMessage14
>       endif
>       kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
>       if (kNewM15 == 1) then
>           kMessage15 = kMessage15t
>           printks "Neue Nachricht15: %f\n",0,kMessage15
>       endif
>       kNewM    =
> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
>       if ( kNewM == 0 ) goto CONTINUE
>       kgoto NXTMSG
> CONTINUE:
>       endin
>
> 
> 
> i 2 0 20
> 
> 
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-17 21:39
FromSchnitzer Wolfgang
SubjectRe: OSCsend-problem
Hi,
thanks for your hints Oeyvind and Eduardo for testing on linux. I have 
done some more testing myself, but the problem remains the same. I have 
used addition instead of multiplication (kNewM1+kNewM2+...),  also 
adding one loop for each OSClisten as Oeyvind suggests, but nevertheless 
just one message comes through by starting the send-instrument for the 
first time. A workaround is to start the send-instrument twice ( i 1 0 
0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument. 
Restarting csound  within a short time has the same effect as starting 
the send-instrument twice. If I wait with the second start more than a 
minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go 
through again (the same ist with restarting csound a second time after 
more than 1 minute).
Any hints are welcome.
Greetings
Wolfgang

Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
> Hi Wolfgang,
> By waiting one minute and starting the process again, do you mean
> restarting Csound, or just adding the same instrument call at time 60
> in the (same) score?
> If you are restarting Csound, I would expect the same thing to happen
> over and over. ... or do you mean the messages all come through if you
> run the sender csd twice in a row (restarting Csound) without waiting
> more than a few seconds?
>
> Also, the receiver instrument looks a bit odd to me, maybe I'm
> overlooking something(?)
> What I mean is that you multiply the kNewM variables, which mean that
> if *any* of the OSClisten instances has an empty message queue, you
> will skip to continue. That could potentially leave messages in some
> of the queues, and could mess up the expected order of received
> events, I think.
> A simple thing to test would be to use addition instead
> (kNewM1+kNewM2+...), which should let you loop until all queues are
> empty. However, if it was me, I'd make one loop for each OSClisten,
> making sure that they all read until the queue is empty and then do
> not read again until the next k-pass. This may or may not relate to
> the erratic behaviour you experience, not sure.
>
> Oeyvind
>
> 2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang :
>> Hi,
>> I have a bigger project with csound and oscsend. One problem that occurs
>> is: if I send more than one osc-message for the first time with oscsend,
>> only one message gets through. If sending the messages a second time,
>> all the messages arrive as expected. Waiting about one minute and
>> starting the process once again, the problem comes up again. I use
>> Windows 7 over network with two machines, not localhost.
>>
>> Wolfgang
>>
>> /*Send-Instrument*/
>>
>> 
>> 
>> -b128 -B256 -d -m263 -odac7
>> 
>> 
>> sr        =    44100
>> ksmps    =    32
>> nchnls    =    2
>> 0dbfs    =    1
>>
>> #define    IPADDRESS        # "192.168.0.103" #
>> #define    S_PORT         # 9001 #
>>
>> instr    1
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
>>       OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
>> endin
>>
>> 
>> 
>> i 1 0 0.5
>> ;i 1 0.5 0.5
>> 
>> 
>>
>> /*Receive-Instrument*/
>>
>> 
>> 
>> -b128 -B256 -d -m263 -odac7
>> 
>> 
>> sr        =    44100
>> ksmps    =    32
>> nchnls    =    2
>> 0dbfs    =    1
>>
>>
>> #define    R_PORT         # 9001 #
>> giPort     OSCinit        9001
>>
>> instr    2
>>       kMessage1        init    0
>>       kMessage1t    init    0
>>       kMessage2        init    0
>>       kMessage2t    init    0
>>       kMessage3        init    0
>>       kMessage3t    init    0
>>       kMessage4        init    0
>>       kMessage4t    init    0
>>       kMessage5        init    0
>>       kMessage5t    init    0
>>       kMessage6        init    0
>>       kMessage6t    init    0
>>       kMessage7        init    0
>>       kMessage7t    init    0
>>       kMessage8        init    0
>>       kMessage8t    init    0
>>       kMessage9        init    0
>>       kMessage9t    init    0
>>       kMessage10        init    0
>>       kMessage10t    init    0
>>       kMessage11        init    0
>>       kMessage11t    init    0
>>       kMessage12        init    0
>>       kMessage12t    init    0
>>       kMessage13        init    0
>>       kMessage13t    init    0
>>       kMessage14        init    0
>>       kMessage14t    init    0
>>       kMessage15        init    0
>>       kMessage15t    init    0
>> NXTMSG:
>>       kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
>>       if (kNewM1 == 1) then
>>           kMessage1 = kMessage1t
>>           printks "Neue Nachricht1: %f\n",0,kMessage1
>>       endif
>>       kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
>>       if (kNewM2 == 1) then
>>           kMessage2 = kMessage2t
>>           printks "Neue Nachricht2: %f\n",0,kMessage2
>>       endif
>>       kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
>>       if (kNewM3 == 1) then
>>           kMessage3 = kMessage3t
>>           printks "Neue Nachricht3: %f\n",0,kMessage3
>>       endif
>>       kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
>>       if (kNewM4 == 1) then
>>           kMessage4 = kMessage4t
>>           printks "Neue Nachricht4: %f\n",0,kMessage4
>>       endif
>>       kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
>>       if (kNewM5 == 1) then
>>           kMessage5 = kMessage5t
>>           printks "Neue Nachricht5: %f\n",0,kMessage5
>>       endif
>>       kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
>>       if (kNewM6 == 1) then
>>           kMessage6 = kMessage6t
>>           printks "Neue Nachricht6: %f\n",0,kMessage6
>>       endif
>>       kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
>>       if (kNewM7 == 1) then
>>           kMessage7 = kMessage7t
>>           printks "Neue Nachricht7: %f\n",0,kMessage7
>>       endif
>>       kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
>>       if (kNewM8 == 1) then
>>           kMessage8 = kMessage8t
>>           printks "Neue Nachricht8: %f\n",0,kMessage8
>>       endif
>>       kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
>>       if (kNewM9 == 1) then
>>           kMessage9 = kMessage9t
>>           printks "Neue Nachricht9: %f\n",0,kMessage9
>>       endif
>>       kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
>>       if (kNewM10 == 1) then
>>           kMessage10 = kMessage10t
>>           printks "Neue Nachricht10: %f\n",0,kMessage10
>>       endif
>>       kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
>>       if (kNewM11 == 1) then
>>           kMessage11 = kMessage11t
>>           printks "Neue Nachricht11: %f\n",0,kMessage11
>>       endif
>>       kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
>>       if (kNewM12 == 1) then
>>           kMessage12 = kMessage12t
>>           printks "Neue Nachricht12: %f\n",0,kMessage12
>>       endif
>>       kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
>>       if (kNewM13 == 1) then
>>           kMessage13 = kMessage13t
>>           printks "Neue Nachricht13: %f\n",0,kMessage13
>>       endif
>>       kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
>>       if (kNewM14 == 1) then
>>           kMessage14 = kMessage14t
>>           printks "Neue Nachricht14: %f\n",0,kMessage14
>>       endif
>>       kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
>>       if (kNewM15 == 1) then
>>           kMessage15 = kMessage15t
>>           printks "Neue Nachricht15: %f\n",0,kMessage15
>>       endif
>>       kNewM    =
>> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
>>       if ( kNewM == 0 ) goto CONTINUE
>>       kgoto NXTMSG
>> CONTINUE:
>>       endin
>>
>> 
>> 
>> i 2 0 20
>> 
>> 
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Csound-users mailing list
>> Csound-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-users
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-17 23:31
FromDavid Worrall
SubjectRe: OSCsend-problem
AttachmentsNone  None  
Guten Tag Wolfram,

a couple of stabs in the dark:
1. That it runs for Oeyvind and Eduardo suggests it might be a possible port assignment issue.
i.e. if you’re playing around with the formatting/addressing and you mess up the addressing, 
it can take a while for the OS to release the port, so when you try to address it, sometimes works, sometimes doesn’t.
So between successive runs, until you have the code stable, try changing ports every alternative run.

2. This could be my imagination, but I also found that OSCsend seemed to worked more smoothly if I fed it a single string. 
So I composed the string first the fed it to OSCsend. Like this:

Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr, istartTime, instrNr,ifreq1, ifreq2, idur
Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST
Stringy strcat Stringy1, Stringy2

OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to demoRoom
puts Stringy, 1 ; print the UDP message to the monitor

3. Test the send routine more simply. I have found it useful to just run csound with the OSCsend code in it
and read the UDP port with a simple script - I use python - to read it - as raw UDP. I can post a simple python script for doing that if it would be useful. This should give you a sense of whether it is the port that is blocking or not.

Für was es wert ist. … Viel Glück!

D.




On 17.06.2015, at 22:39, Schnitzer Wolfgang <wschnitzer@gmx.de> wrote:

Hi,
thanks for your hints Oeyvind and Eduardo for testing on linux. I have
done some more testing myself, but the problem remains the same. I have
used addition instead of multiplication (kNewM1+kNewM2+...),  also
adding one loop for each OSClisten as Oeyvind suggests, but nevertheless
just one message comes through by starting the send-instrument for the
first time. A workaround is to start the send-instrument twice ( i 1 0
0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.
Restarting csound  within a short time has the same effect as starting
the send-instrument twice. If I wait with the second start more than a
minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go
through again (the same ist with restarting csound a second time after
more than 1 minute).
Any hints are welcome.
Greetings
Wolfgang

Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
Hi Wolfgang,
By waiting one minute and starting the process again, do you mean
restarting Csound, or just adding the same instrument call at time 60
in the (same) score?
If you are restarting Csound, I would expect the same thing to happen
over and over. ... or do you mean the messages all come through if you
run the sender csd twice in a row (restarting Csound) without waiting
more than a few seconds?

Also, the receiver instrument looks a bit odd to me, maybe I'm
overlooking something(?)
What I mean is that you multiply the kNewM variables, which mean that
if *any* of the OSClisten instances has an empty message queue, you
will skip to continue. That could potentially leave messages in some
of the queues, and could mess up the expected order of received
events, I think.
A simple thing to test would be to use addition instead
(kNewM1+kNewM2+...), which should let you loop until all queues are
empty. However, if it was me, I'd make one loop for each OSClisten,
making sure that they all read until the queue is empty and then do
not read again until the next k-pass. This may or may not relate to
the erratic behaviour you experience, not sure.

Oeyvind

2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang <wschnitzer@gmx.de>:
Hi,
I have a bigger project with csound and oscsend. One problem that occurs
is: if I send more than one osc-message for the first time with oscsend,
only one message gets through. If sending the messages a second time,
all the messages arrive as expected. Waiting about one minute and
starting the process once again, the problem comes up again. I use
Windows 7 over network with two machines, not localhost.

Wolfgang

/*Send-Instrument*/

<CsoundSynthesizer>
<CsOptions>
-b128 -B256 -d -m263 -odac7
</CsOptions>
<CsInstruments>
sr        =    44100
ksmps    =    32
nchnls    =    2
0dbfs    =    1

#define    IPADDRESS        # "192.168.0.103" #
#define    S_PORT         # 9001 #

instr    1
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
endin

</CsInstruments>
<CsScore>
i 1 0 0.5
;i 1 0.5 0.5
</CsScore>
</CsoundSynthesizer>

/*Receive-Instrument*/

<CsoundSynthesizer>
<CsOptions>
-b128 -B256 -d -m263 -odac7
</CsOptions>
<CsInstruments>
sr        =    44100
ksmps    =    32
nchnls    =    2
0dbfs    =    1


#define    R_PORT         # 9001 #
giPort     OSCinit        9001

instr    2
     kMessage1        init    0
     kMessage1t    init    0
     kMessage2        init    0
     kMessage2t    init    0
     kMessage3        init    0
     kMessage3t    init    0
     kMessage4        init    0
     kMessage4t    init    0
     kMessage5        init    0
     kMessage5t    init    0
     kMessage6        init    0
     kMessage6t    init    0
     kMessage7        init    0
     kMessage7t    init    0
     kMessage8        init    0
     kMessage8t    init    0
     kMessage9        init    0
     kMessage9t    init    0
     kMessage10        init    0
     kMessage10t    init    0
     kMessage11        init    0
     kMessage11t    init    0
     kMessage12        init    0
     kMessage12t    init    0
     kMessage13        init    0
     kMessage13t    init    0
     kMessage14        init    0
     kMessage14t    init    0
     kMessage15        init    0
     kMessage15t    init    0
NXTMSG:
     kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
     if (kNewM1 == 1) then
         kMessage1 = kMessage1t
         printks "Neue Nachricht1: %f\n",0,kMessage1
     endif
     kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
     if (kNewM2 == 1) then
         kMessage2 = kMessage2t
         printks "Neue Nachricht2: %f\n",0,kMessage2
     endif
     kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
     if (kNewM3 == 1) then
         kMessage3 = kMessage3t
         printks "Neue Nachricht3: %f\n",0,kMessage3
     endif
     kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
     if (kNewM4 == 1) then
         kMessage4 = kMessage4t
         printks "Neue Nachricht4: %f\n",0,kMessage4
     endif
     kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
     if (kNewM5 == 1) then
         kMessage5 = kMessage5t
         printks "Neue Nachricht5: %f\n",0,kMessage5
     endif
     kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
     if (kNewM6 == 1) then
         kMessage6 = kMessage6t
         printks "Neue Nachricht6: %f\n",0,kMessage6
     endif
     kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
     if (kNewM7 == 1) then
         kMessage7 = kMessage7t
         printks "Neue Nachricht7: %f\n",0,kMessage7
     endif
     kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
     if (kNewM8 == 1) then
         kMessage8 = kMessage8t
         printks "Neue Nachricht8: %f\n",0,kMessage8
     endif
     kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
     if (kNewM9 == 1) then
         kMessage9 = kMessage9t
         printks "Neue Nachricht9: %f\n",0,kMessage9
     endif
     kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
     if (kNewM10 == 1) then
         kMessage10 = kMessage10t
         printks "Neue Nachricht10: %f\n",0,kMessage10
     endif
     kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
     if (kNewM11 == 1) then
         kMessage11 = kMessage11t
         printks "Neue Nachricht11: %f\n",0,kMessage11
     endif
     kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
     if (kNewM12 == 1) then
         kMessage12 = kMessage12t
         printks "Neue Nachricht12: %f\n",0,kMessage12
     endif
     kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
     if (kNewM13 == 1) then
         kMessage13 = kMessage13t
         printks "Neue Nachricht13: %f\n",0,kMessage13
     endif
     kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
     if (kNewM14 == 1) then
         kMessage14 = kMessage14t
         printks "Neue Nachricht14: %f\n",0,kMessage14
     endif
     kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
     if (kNewM15 == 1) then
         kMessage15 = kMessage15t
         printks "Neue Nachricht15: %f\n",0,kMessage15
     endif
     kNewM    =
kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
     if ( kNewM == 0 ) goto CONTINUE
     kgoto NXTMSG
CONTINUE:
     endin

</CsInstruments>
<CsScore>
i 2 0 20
</CsScore>
</CsoundSynthesizer>


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

_____________________________________
Prof. Dr. David Worrall
International Audio Laboratories Erlangen
Fraunhofer-Institut für Integrierte Schaltungen IIS
Am Wolfsmantel 33
91058 Erlangen
www: iis.fraunhofer.de 
---
Adjunct Senior Research Fellow
School of Music, Australian National University











Date2015-06-17 23:55
FromDavid Worrall
SubjectRe: OSCsend-problem
AttachmentsNone  None  
another thing to try is to initialise the port for listening before you send.

On 18.06.2015, at 00:31, David Worrall <david.worrall@iis.fraunhofer.de> wrote:

Guten Tag Wolfram,

a couple of stabs in the dark:
1. That it runs for Oeyvind and Eduardo suggests it might be a possible port assignment issue.
i.e. if you’re playing around with the formatting/addressing and you mess up the addressing, 
it can take a while for the OS to release the port, so when you try to address it, sometimes works, sometimes doesn’t.
So between successive runs, until you have the code stable, try changing ports every alternative run.

2. This could be my imagination, but I also found that OSCsend seemed to worked more smoothly if I fed it a single string. 
So I composed the string first the fed it to OSCsend. Like this:

Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr, istartTime, instrNr,ifreq1, ifreq2, idur
Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST
Stringy strcat Stringy1, Stringy2

OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to demoRoom
puts Stringy, 1 ; print the UDP message to the monitor

3. Test the send routine more simply. I have found it useful to just run csound with the OSCsend code in it
and read the UDP port with a simple script - I use python - to read it - as raw UDP. I can post a simple python script for doing that if it would be useful. This should give you a sense of whether it is the port that is blocking or not.

Für was es wert ist. … Viel Glück!

D.




On 17.06.2015, at 22:39, Schnitzer Wolfgang <wschnitzer@gmx.de> wrote:

Hi,
thanks for your hints Oeyvind and Eduardo for testing on linux. I have
done some more testing myself, but the problem remains the same. I have
used addition instead of multiplication (kNewM1+kNewM2+...),  also
adding one loop for each OSClisten as Oeyvind suggests, but nevertheless
just one message comes through by starting the send-instrument for the
first time. A workaround is to start the send-instrument twice ( i 1 0
0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.
Restarting csound  within a short time has the same effect as starting
the send-instrument twice. If I wait with the second start more than a
minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go
through again (the same ist with restarting csound a second time after
more than 1 minute).
Any hints are welcome.
Greetings
Wolfgang

Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
Hi Wolfgang,
By waiting one minute and starting the process again, do you mean
restarting Csound, or just adding the same instrument call at time 60
in the (same) score?
If you are restarting Csound, I would expect the same thing to happen
over and over. ... or do you mean the messages all come through if you
run the sender csd twice in a row (restarting Csound) without waiting
more than a few seconds?

Also, the receiver instrument looks a bit odd to me, maybe I'm
overlooking something(?)
What I mean is that you multiply the kNewM variables, which mean that
if *any* of the OSClisten instances has an empty message queue, you
will skip to continue. That could potentially leave messages in some
of the queues, and could mess up the expected order of received
events, I think.
A simple thing to test would be to use addition instead
(kNewM1+kNewM2+...), which should let you loop until all queues are
empty. However, if it was me, I'd make one loop for each OSClisten,
making sure that they all read until the queue is empty and then do
not read again until the next k-pass. This may or may not relate to
the erratic behaviour you experience, not sure.

Oeyvind

2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang <wschnitzer@gmx.de>:
Hi,
I have a bigger project with csound and oscsend. One problem that occurs
is: if I send more than one osc-message for the first time with oscsend,
only one message gets through. If sending the messages a second time,
all the messages arrive as expected. Waiting about one minute and
starting the process once again, the problem comes up again. I use
Windows 7 over network with two machines, not localhost.

Wolfgang

/*Send-Instrument*/

<CsoundSynthesizer>
<CsOptions>
-b128 -B256 -d -m263 -odac7
</CsOptions>
<CsInstruments>
sr        =    44100
ksmps    =    32
nchnls    =    2
0dbfs    =    1

#define    IPADDRESS        # "192.168.0.103" #
#define    S_PORT         # 9001 #

instr    1
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
endin

</CsInstruments>
<CsScore>
i 1 0 0.5
;i 1 0.5 0.5
</CsScore>
</CsoundSynthesizer>

/*Receive-Instrument*/

<CsoundSynthesizer>
<CsOptions>
-b128 -B256 -d -m263 -odac7
</CsOptions>
<CsInstruments>
sr        =    44100
ksmps    =    32
nchnls    =    2
0dbfs    =    1


#define    R_PORT         # 9001 #
giPort     OSCinit        9001

instr    2
     kMessage1        init    0
     kMessage1t    init    0
     kMessage2        init    0
     kMessage2t    init    0
     kMessage3        init    0
     kMessage3t    init    0
     kMessage4        init    0
     kMessage4t    init    0
     kMessage5        init    0
     kMessage5t    init    0
     kMessage6        init    0
     kMessage6t    init    0
     kMessage7        init    0
     kMessage7t    init    0
     kMessage8        init    0
     kMessage8t    init    0
     kMessage9        init    0
     kMessage9t    init    0
     kMessage10        init    0
     kMessage10t    init    0
     kMessage11        init    0
     kMessage11t    init    0
     kMessage12        init    0
     kMessage12t    init    0
     kMessage13        init    0
     kMessage13t    init    0
     kMessage14        init    0
     kMessage14t    init    0
     kMessage15        init    0
     kMessage15t    init    0
NXTMSG:
     kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
     if (kNewM1 == 1) then
         kMessage1 = kMessage1t
         printks "Neue Nachricht1: %f\n",0,kMessage1
     endif
     kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
     if (kNewM2 == 1) then
         kMessage2 = kMessage2t
         printks "Neue Nachricht2: %f\n",0,kMessage2
     endif
     kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
     if (kNewM3 == 1) then
         kMessage3 = kMessage3t
         printks "Neue Nachricht3: %f\n",0,kMessage3
     endif
     kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
     if (kNewM4 == 1) then
         kMessage4 = kMessage4t
         printks "Neue Nachricht4: %f\n",0,kMessage4
     endif
     kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
     if (kNewM5 == 1) then
         kMessage5 = kMessage5t
         printks "Neue Nachricht5: %f\n",0,kMessage5
     endif
     kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
     if (kNewM6 == 1) then
         kMessage6 = kMessage6t
         printks "Neue Nachricht6: %f\n",0,kMessage6
     endif
     kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
     if (kNewM7 == 1) then
         kMessage7 = kMessage7t
         printks "Neue Nachricht7: %f\n",0,kMessage7
     endif
     kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
     if (kNewM8 == 1) then
         kMessage8 = kMessage8t
         printks "Neue Nachricht8: %f\n",0,kMessage8
     endif
     kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
     if (kNewM9 == 1) then
         kMessage9 = kMessage9t
         printks "Neue Nachricht9: %f\n",0,kMessage9
     endif
     kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
     if (kNewM10 == 1) then
         kMessage10 = kMessage10t
         printks "Neue Nachricht10: %f\n",0,kMessage10
     endif
     kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
     if (kNewM11 == 1) then
         kMessage11 = kMessage11t
         printks "Neue Nachricht11: %f\n",0,kMessage11
     endif
     kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
     if (kNewM12 == 1) then
         kMessage12 = kMessage12t
         printks "Neue Nachricht12: %f\n",0,kMessage12
     endif
     kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
     if (kNewM13 == 1) then
         kMessage13 = kMessage13t
         printks "Neue Nachricht13: %f\n",0,kMessage13
     endif
     kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
     if (kNewM14 == 1) then
         kMessage14 = kMessage14t
         printks "Neue Nachricht14: %f\n",0,kMessage14
     endif
     kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
     if (kNewM15 == 1) then
         kMessage15 = kMessage15t
         printks "Neue Nachricht15: %f\n",0,kMessage15
     endif
     kNewM    =
kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
     if ( kNewM == 0 ) goto CONTINUE
     kgoto NXTMSG
CONTINUE:
     endin

</CsInstruments>
<CsScore>
i 2 0 20
</CsScore>
</CsoundSynthesizer>


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

_____________________________________
Prof. Dr. David Worrall
International Audio Laboratories Erlangen
Fraunhofer-Institut für Integrierte Schaltungen IIS
Am Wolfsmantel 33
91058 Erlangen
www: iis.fraunhofer.de 
---
Adjunct Senior Research Fellow
School of Music, Australian National University










------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

_____________________________________
Prof. Dr. David Worrall
International Audio Laboratories Erlangen
Fraunhofer-Institut für Integrierte Schaltungen IIS
Am Wolfsmantel 33
91058 Erlangen
www: iis.fraunhofer.de 
---
Adjunct Senior Research Fellow
School of Music, Australian National University











Date2015-06-18 22:07
FromSchnitzer Wolfgang
SubjectRe: OSCsend-problem
Hi David,
thanks a lot for your suggestions. It would be very useful if you can 
post a simple python script to read the raw UDP. Next week I will have 
access to the computers again and could do some more tests.
Best regards
Wolfgang

Am 18.06.2015 um 00:31 schrieb David Worrall:
> Guten Tag Wolfram,
>
> a couple of stabs in the dark:
> 1. That it runs for Oeyvind and Eduardo suggests it might be a 
> possible port assignment issue.
> i.e. if you’re playing around with the formatting/addressing and you 
> mess up the addressing,
> it can take a while for the OS to release the port, so when you try to 
> address it, sometimes works, sometimes doesn’t.
> So between successive runs, until you have the code stable, try 
> changing ports every alternative run.
>
> 2. This could be my imagination, but I also found that OSCsend seemed 
> to worked more smoothly if I fed it a single string.
> So I composed the string first the fed it to OSCsend. Like this:
>
> Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr, 
> istartTime, instrNr,ifreq1, ifreq2, idur
> Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST
> Stringy strcat Stringy1, Stringy2
>
> OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to 
> demoRoom
> puts Stringy, 1 ; print the UDP message to the monitor
>
> 3. Test the send routine more simply. I have found it useful to just 
> run csound with the OSCsend code in it
> and read the UDP port with a simple script - I use python - to read it 
> - as raw UDP. I can post a simple python script for doing that if it 
> would be useful. This should give you a sense of whether it is the 
> port that is blocking or not.
>
> Für was es wert ist. … Viel Glück!
>
> D.
>
>
>
>
> On 17.06.2015, at 22:39, Schnitzer Wolfgang  > wrote:
>
>> Hi,
>> thanks for your hints Oeyvind and Eduardo for testing on linux. I have
>> done some more testing myself, but the problem remains the same. I have
>> used addition instead of multiplication (kNewM1+kNewM2+...),  also
>> adding one loop for each OSClisten as Oeyvind suggests, but nevertheless
>> just one message comes through by starting the send-instrument for the
>> first time. A workaround is to start the send-instrument twice ( i 1 0
>> 0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.
>> Restarting csound  within a short time has the same effect as starting
>> the send-instrument twice. If I wait with the second start more than a
>> minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go
>> through again (the same ist with restarting csound a second time after
>> more than 1 minute).
>> Any hints are welcome.
>> Greetings
>> Wolfgang
>>
>> Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
>>> Hi Wolfgang,
>>> By waiting one minute and starting the process again, do you mean
>>> restarting Csound, or just adding the same instrument call at time 60
>>> in the (same) score?
>>> If you are restarting Csound, I would expect the same thing to happen
>>> over and over. ... or do you mean the messages all come through if you
>>> run the sender csd twice in a row (restarting Csound) without waiting
>>> more than a few seconds?
>>>
>>> Also, the receiver instrument looks a bit odd to me, maybe I'm
>>> overlooking something(?)
>>> What I mean is that you multiply the kNewM variables, which mean that
>>> if *any* of the OSClisten instances has an empty message queue, you
>>> will skip to continue. That could potentially leave messages in some
>>> of the queues, and could mess up the expected order of received
>>> events, I think.
>>> A simple thing to test would be to use addition instead
>>> (kNewM1+kNewM2+...), which should let you loop until all queues are
>>> empty. However, if it was me, I'd make one loop for each OSClisten,
>>> making sure that they all read until the queue is empty and then do
>>> not read again until the next k-pass. This may or may not relate to
>>> the erratic behaviour you experience, not sure.
>>>
>>> Oeyvind
>>>
>>> 2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang >> >:
>>>> Hi,
>>>> I have a bigger project with csound and oscsend. One problem that 
>>>> occurs
>>>> is: if I send more than one osc-message for the first time with 
>>>> oscsend,
>>>> only one message gets through. If sending the messages a second time,
>>>> all the messages arrive as expected. Waiting about one minute and
>>>> starting the process once again, the problem comes up again. I use
>>>> Windows 7 over network with two machines, not localhost.
>>>>
>>>> Wolfgang
>>>>
>>>> /*Send-Instrument*/
>>>>
>>>> 
>>>> 
>>>> -b128 -B256 -d -m263 -odac7
>>>> 
>>>> 
>>>> sr        =    44100
>>>> ksmps    =    32
>>>> nchnls    =    2
>>>> 0dbfs    =    1
>>>>
>>>> #define    IPADDRESS        # "192.168.0.103" #
>>>> #define    S_PORT         # 9001 #
>>>>
>>>> instr    1
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
>>>>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
>>>> endin
>>>>
>>>> 
>>>> 
>>>> i 1 0 0.5
>>>> ;i 1 0.5 0.5
>>>> 
>>>> 
>>>>
>>>> /*Receive-Instrument*/
>>>>
>>>> 
>>>> 
>>>> -b128 -B256 -d -m263 -odac7
>>>> 
>>>> 
>>>> sr        =    44100
>>>> ksmps    =    32
>>>> nchnls    =    2
>>>> 0dbfs    =    1
>>>>
>>>>
>>>> #define    R_PORT         # 9001 #
>>>> giPort     OSCinit        9001
>>>>
>>>> instr    2
>>>>      kMessage1        init    0
>>>>      kMessage1t    init    0
>>>>      kMessage2        init    0
>>>>      kMessage2t    init    0
>>>>      kMessage3        init    0
>>>>      kMessage3t    init    0
>>>>      kMessage4        init    0
>>>>      kMessage4t    init    0
>>>>      kMessage5        init    0
>>>>      kMessage5t    init    0
>>>>      kMessage6        init    0
>>>>      kMessage6t    init    0
>>>>      kMessage7        init    0
>>>>      kMessage7t    init    0
>>>>      kMessage8        init    0
>>>>      kMessage8t    init    0
>>>>      kMessage9        init    0
>>>>      kMessage9t    init    0
>>>>      kMessage10        init    0
>>>>      kMessage10t    init    0
>>>>      kMessage11        init    0
>>>>      kMessage11t    init    0
>>>>      kMessage12        init    0
>>>>      kMessage12t    init    0
>>>>      kMessage13        init    0
>>>>      kMessage13t    init    0
>>>>      kMessage14        init    0
>>>>      kMessage14t    init    0
>>>>      kMessage15        init    0
>>>>      kMessage15t    init    0
>>>> NXTMSG:
>>>>      kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
>>>>      if (kNewM1 == 1) then
>>>>          kMessage1 = kMessage1t
>>>>          printks "Neue Nachricht1: %f\n",0,kMessage1
>>>>      endif
>>>>      kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
>>>>      if (kNewM2 == 1) then
>>>>          kMessage2 = kMessage2t
>>>>          printks "Neue Nachricht2: %f\n",0,kMessage2
>>>>      endif
>>>>      kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
>>>>      if (kNewM3 == 1) then
>>>>          kMessage3 = kMessage3t
>>>>          printks "Neue Nachricht3: %f\n",0,kMessage3
>>>>      endif
>>>>      kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
>>>>      if (kNewM4 == 1) then
>>>>          kMessage4 = kMessage4t
>>>>          printks "Neue Nachricht4: %f\n",0,kMessage4
>>>>      endif
>>>>      kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
>>>>      if (kNewM5 == 1) then
>>>>          kMessage5 = kMessage5t
>>>>          printks "Neue Nachricht5: %f\n",0,kMessage5
>>>>      endif
>>>>      kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
>>>>      if (kNewM6 == 1) then
>>>>          kMessage6 = kMessage6t
>>>>          printks "Neue Nachricht6: %f\n",0,kMessage6
>>>>      endif
>>>>      kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
>>>>      if (kNewM7 == 1) then
>>>>          kMessage7 = kMessage7t
>>>>          printks "Neue Nachricht7: %f\n",0,kMessage7
>>>>      endif
>>>>      kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
>>>>      if (kNewM8 == 1) then
>>>>          kMessage8 = kMessage8t
>>>>          printks "Neue Nachricht8: %f\n",0,kMessage8
>>>>      endif
>>>>      kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
>>>>      if (kNewM9 == 1) then
>>>>          kMessage9 = kMessage9t
>>>>          printks "Neue Nachricht9: %f\n",0,kMessage9
>>>>      endif
>>>>      kNewM10    OSClisten    giPort, 
>>>> "/scene/speedRandom","f",kMessage10t
>>>>      if (kNewM10 == 1) then
>>>>          kMessage10 = kMessage10t
>>>>          printks "Neue Nachricht10: %f\n",0,kMessage10
>>>>      endif
>>>>      kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
>>>>      if (kNewM11 == 1) then
>>>>          kMessage11 = kMessage11t
>>>>          printks "Neue Nachricht11: %f\n",0,kMessage11
>>>>      endif
>>>>      kNewM12    OSClisten    giPort, 
>>>> "/scene/colorWaveMode","f",kMessage12t
>>>>      if (kNewM12 == 1) then
>>>>          kMessage12 = kMessage12t
>>>>          printks "Neue Nachricht12: %f\n",0,kMessage12
>>>>      endif
>>>>      kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
>>>>      if (kNewM13 == 1) then
>>>>          kMessage13 = kMessage13t
>>>>          printks "Neue Nachricht13: %f\n",0,kMessage13
>>>>      endif
>>>>      kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
>>>>      if (kNewM14 == 1) then
>>>>          kMessage14 = kMessage14t
>>>>          printks "Neue Nachricht14: %f\n",0,kMessage14
>>>>      endif
>>>>      kNewM15    OSClisten    giPort, 
>>>> "/scene/colorChange","f",kMessage15t
>>>>      if (kNewM15 == 1) then
>>>>          kMessage15 = kMessage15t
>>>>          printks "Neue Nachricht15: %f\n",0,kMessage15
>>>>      endif
>>>>      kNewM    =
>>>> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
>>>>      if ( kNewM == 0 ) goto CONTINUE
>>>>      kgoto NXTMSG
>>>> CONTINUE:
>>>>      endin
>>>>
>>>> 
>>>> 
>>>> i 2 0 20
>>>> 
>>>> 
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Csound-users mailing list
>>>> Csound-users@lists.sourceforge.net 
>>>> 
>>>> https://lists.sourceforge.net/lists/listinfo/csound-users
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Csound-users mailing list
>> Csound-users@lists.sourceforge.net 
>> 
>> https://lists.sourceforge.net/lists/listinfo/csound-users
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> _____________________________________
> Prof. Dr. David Worrall
> International Audio Laboratories Erlangen
> Fraunhofer-Institut für Integrierte Schaltungen IIS
> Am Wolfsmantel 33
> 91058 Erlangen
> www: iis.fraunhofer.de 
> audiolabs-erlangen.de/research/emerging-audio-research 
> 
> ---
> Adjunct Senior Research Fellow
> School of Music, Australian National University
> david.worrall@anu.edu.au 
>
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-18 22:16
FromOeyvind Brandtsegg
SubjectRe: OSCsend-problem
In addition to the good suggestions by David,
I also come to think that it might sound like a power saving issue?
I'm not sure how your hardware is set up, but if one component in the
signal chain is very eager to go into sleep mode to save power, then
perhaps the first message only serves to wake it, then it will work
for a minute or two. It is admittedly a shot in the dark, but if
you're on a laptop, check the power management setting (go as deep
into the details as the system will let you to check any hardware that
is managed by power saving), set the general setting to "maximum
performance" and double check that the network interface and the cpu
does not go to sleep. Also, come to think of it, if you use wireless
network, try cable. Also, you probably have a router between the
machines (wired or wireless), which might play into the problem
somehow. If you are already on cable you might even try wireless, just
to use another route for the signal and see if it changes anything.

2015-06-18 0:55 GMT+02:00 David Worrall :
> another thing to try is to initialise the port for listening before you
> send.
>
> On 18.06.2015, at 00:31, David Worrall 
> wrote:
>
> Guten Tag Wolfram,
>
> a couple of stabs in the dark:
> 1. That it runs for Oeyvind and Eduardo suggests it might be a possible port
> assignment issue.
> i.e. if you’re playing around with the formatting/addressing and you mess up
> the addressing,
> it can take a while for the OS to release the port, so when you try to
> address it, sometimes works, sometimes doesn’t.
> So between successive runs, until you have the code stable, try changing
> ports every alternative run.
>
> 2. This could be my imagination, but I also found that OSCsend seemed to
> worked more smoothly if I fed it a single string.
> So I composed the string first the fed it to OSCsend. Like this:
>
> Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr, istartTime,
> instrNr,ifreq1, ifreq2, idur
> Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST
> Stringy strcat Stringy1, Stringy2
>
> OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to demoRoom
> puts Stringy, 1 ; print the UDP message to the monitor
>
> 3. Test the send routine more simply. I have found it useful to just run
> csound with the OSCsend code in it
> and read the UDP port with a simple script - I use python - to read it - as
> raw UDP. I can post a simple python script for doing that if it would be
> useful. This should give you a sense of whether it is the port that is
> blocking or not.
>
> Für was es wert ist. … Viel Glück!
>
> D.
>
>
>
>
> On 17.06.2015, at 22:39, Schnitzer Wolfgang  wrote:
>
> Hi,
> thanks for your hints Oeyvind and Eduardo for testing on linux. I have
> done some more testing myself, but the problem remains the same. I have
> used addition instead of multiplication (kNewM1+kNewM2+...),  also
> adding one loop for each OSClisten as Oeyvind suggests, but nevertheless
> just one message comes through by starting the send-instrument for the
> first time. A workaround is to start the send-instrument twice ( i 1 0
> 0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.
> Restarting csound  within a short time has the same effect as starting
> the send-instrument twice. If I wait with the second start more than a
> minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go
> through again (the same ist with restarting csound a second time after
> more than 1 minute).
> Any hints are welcome.
> Greetings
> Wolfgang
>
> Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
>
> Hi Wolfgang,
> By waiting one minute and starting the process again, do you mean
> restarting Csound, or just adding the same instrument call at time 60
> in the (same) score?
> If you are restarting Csound, I would expect the same thing to happen
> over and over. ... or do you mean the messages all come through if you
> run the sender csd twice in a row (restarting Csound) without waiting
> more than a few seconds?
>
> Also, the receiver instrument looks a bit odd to me, maybe I'm
> overlooking something(?)
> What I mean is that you multiply the kNewM variables, which mean that
> if *any* of the OSClisten instances has an empty message queue, you
> will skip to continue. That could potentially leave messages in some
> of the queues, and could mess up the expected order of received
> events, I think.
> A simple thing to test would be to use addition instead
> (kNewM1+kNewM2+...), which should let you loop until all queues are
> empty. However, if it was me, I'd make one loop for each OSClisten,
> making sure that they all read until the queue is empty and then do
> not read again until the next k-pass. This may or may not relate to
> the erratic behaviour you experience, not sure.
>
> Oeyvind
>
> 2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang :
>
> Hi,
> I have a bigger project with csound and oscsend. One problem that occurs
> is: if I send more than one osc-message for the first time with oscsend,
> only one message gets through. If sending the messages a second time,
> all the messages arrive as expected. Waiting about one minute and
> starting the process once again, the problem comes up again. I use
> Windows 7 over network with two machines, not localhost.
>
> Wolfgang
>
> /*Send-Instrument*/
>
> 
> 
> -b128 -B256 -d -m263 -odac7
> 
> 
> sr        =    44100
> ksmps    =    32
> nchnls    =    2
> 0dbfs    =    1
>
> #define    IPADDRESS        # "192.168.0.103" #
> #define    S_PORT         # 9001 #
>
> instr    1
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
>      OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
> endin
>
> 
> 
> i 1 0 0.5
> ;i 1 0.5 0.5
> 
> 
>
> /*Receive-Instrument*/
>
> 
> 
> -b128 -B256 -d -m263 -odac7
> 
> 
> sr        =    44100
> ksmps    =    32
> nchnls    =    2
> 0dbfs    =    1
>
>
> #define    R_PORT         # 9001 #
> giPort     OSCinit        9001
>
> instr    2
>      kMessage1        init    0
>      kMessage1t    init    0
>      kMessage2        init    0
>      kMessage2t    init    0
>      kMessage3        init    0
>      kMessage3t    init    0
>      kMessage4        init    0
>      kMessage4t    init    0
>      kMessage5        init    0
>      kMessage5t    init    0
>      kMessage6        init    0
>      kMessage6t    init    0
>      kMessage7        init    0
>      kMessage7t    init    0
>      kMessage8        init    0
>      kMessage8t    init    0
>      kMessage9        init    0
>      kMessage9t    init    0
>      kMessage10        init    0
>      kMessage10t    init    0
>      kMessage11        init    0
>      kMessage11t    init    0
>      kMessage12        init    0
>      kMessage12t    init    0
>      kMessage13        init    0
>      kMessage13t    init    0
>      kMessage14        init    0
>      kMessage14t    init    0
>      kMessage15        init    0
>      kMessage15t    init    0
> NXTMSG:
>      kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
>      if (kNewM1 == 1) then
>          kMessage1 = kMessage1t
>          printks "Neue Nachricht1: %f\n",0,kMessage1
>      endif
>      kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
>      if (kNewM2 == 1) then
>          kMessage2 = kMessage2t
>          printks "Neue Nachricht2: %f\n",0,kMessage2
>      endif
>      kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
>      if (kNewM3 == 1) then
>          kMessage3 = kMessage3t
>          printks "Neue Nachricht3: %f\n",0,kMessage3
>      endif
>      kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
>      if (kNewM4 == 1) then
>          kMessage4 = kMessage4t
>          printks "Neue Nachricht4: %f\n",0,kMessage4
>      endif
>      kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
>      if (kNewM5 == 1) then
>          kMessage5 = kMessage5t
>          printks "Neue Nachricht5: %f\n",0,kMessage5
>      endif
>      kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
>      if (kNewM6 == 1) then
>          kMessage6 = kMessage6t
>          printks "Neue Nachricht6: %f\n",0,kMessage6
>      endif
>      kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
>      if (kNewM7 == 1) then
>          kMessage7 = kMessage7t
>          printks "Neue Nachricht7: %f\n",0,kMessage7
>      endif
>      kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
>      if (kNewM8 == 1) then
>          kMessage8 = kMessage8t
>          printks "Neue Nachricht8: %f\n",0,kMessage8
>      endif
>      kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
>      if (kNewM9 == 1) then
>          kMessage9 = kMessage9t
>          printks "Neue Nachricht9: %f\n",0,kMessage9
>      endif
>      kNewM10    OSClisten    giPort, "/scene/speedRandom","f",kMessage10t
>      if (kNewM10 == 1) then
>          kMessage10 = kMessage10t
>          printks "Neue Nachricht10: %f\n",0,kMessage10
>      endif
>      kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
>      if (kNewM11 == 1) then
>          kMessage11 = kMessage11t
>          printks "Neue Nachricht11: %f\n",0,kMessage11
>      endif
>      kNewM12    OSClisten    giPort, "/scene/colorWaveMode","f",kMessage12t
>      if (kNewM12 == 1) then
>          kMessage12 = kMessage12t
>          printks "Neue Nachricht12: %f\n",0,kMessage12
>      endif
>      kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
>      if (kNewM13 == 1) then
>          kMessage13 = kMessage13t
>          printks "Neue Nachricht13: %f\n",0,kMessage13
>      endif
>      kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
>      if (kNewM14 == 1) then
>          kMessage14 = kMessage14t
>          printks "Neue Nachricht14: %f\n",0,kMessage14
>      endif
>      kNewM15    OSClisten    giPort, "/scene/colorChange","f",kMessage15t
>      if (kNewM15 == 1) then
>          kMessage15 = kMessage15t
>          printks "Neue Nachricht15: %f\n",0,kMessage15
>      endif
>      kNewM    =
> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
>      if ( kNewM == 0 ) goto CONTINUE
>      kgoto NXTMSG
> CONTINUE:
>      endin
>
> 
> 
> i 2 0 20
> 
> 
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> _____________________________________
> Prof. Dr. David Worrall
> International Audio Laboratories Erlangen
> Fraunhofer-Institut für Integrierte Schaltungen IIS
> Am Wolfsmantel 33
> 91058 Erlangen
> www: iis.fraunhofer.de
>          audiolabs-erlangen.de/research/emerging-audio-research
> ---
> Adjunct Senior Research Fellow
> School of Music, Australian National University
> david.worrall@anu.edu.au
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
> _____________________________________
> Prof. Dr. David Worrall
> International Audio Laboratories Erlangen
> Fraunhofer-Institut für Integrierte Schaltungen IIS
> Am Wolfsmantel 33
> 91058 Erlangen
> www: iis.fraunhofer.de
>          audiolabs-erlangen.de/research/emerging-audio-research
> ---
> Adjunct Senior Research Fellow
> School of Music, Australian National University
> david.worrall@anu.edu.au
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-18 22:22
FromTarmo Johannes
SubjectRe: OSCsend-problem
AttachmentsNone  None  

Hi,

 

you might have a look at

http://pymotw.com/2/socket/udp.html

https://wiki.python.org/moin/UdpCommunication

 

Although I am afraid that waiting for incoming udp messages inside a csound instrument like

 

pyrun "data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes"

 

would block other work.

 

If you write a separate python scrypt using Python API , and put csound in CsoundPerformanceThread and forward the values to there, it should work.

 

But I think it would be much easier still to make the OSC thing work.

 

Best!

tarmo

 

 

On Thursday 18 June 2015 23:07:05 Schnitzer Wolfgang wrote:

> Hi David,

> thanks a lot for your suggestions. It would be very useful if you can

> post a simple python script to read the raw UDP. Next week I will have

> access to the computers again and could do some more tests.

> Best regards

> Wolfgang

>

> Am 18.06.2015 um 00:31 schrieb David Worrall:

> > Guten Tag Wolfram,

> >

> > a couple of stabs in the dark:

> > 1. That it runs for Oeyvind and Eduardo suggests it might be a

> > possible port assignment issue.

> > i.e. if you’re playing around with the formatting/addressing and you

> > mess up the addressing,

> > it can take a while for the OS to release the port, so when you try to

> > address it, sometimes works, sometimes doesn’t.

> > So between successive runs, until you have the code stable, try

> > changing ports every alternative run.

> >

> > 2. This could be my imagination, but I also found that OSCsend seemed

> > to worked more smoothly if I fed it a single string.

> > So I composed the string first the fed it to OSCsend. Like this:

> >

> > Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr,

> > istartTime, instrNr,ifreq1, ifreq2, idur

> > Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST

> > Stringy strcat Stringy1, Stringy2

> >

> > OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to

> > demoRoom

> > puts Stringy, 1 ; print the UDP message to the monitor

> >

> > 3. Test the send routine more simply. I have found it useful to just

> > run csound with the OSCsend code in it

> > and read the UDP port with a simple script - I use python - to read it

> > - as raw UDP. I can post a simple python script for doing that if it

> > would be useful. This should give you a sense of whether it is the

> > port that is blocking or not.

> >

> > Für was es wert ist. … Viel Glück!

> >

> > D.

> >

> >

> >

> >

> > On 17.06.2015, at 22:39, Schnitzer Wolfgang <wschnitzer@gmx.de

> >

> > <mailto:wschnitzer@gmx.de>> wrote:

> >> Hi,

> >> thanks for your hints Oeyvind and Eduardo for testing on linux. I have

> >> done some more testing myself, but the problem remains the same. I have

> >> used addition instead of multiplication (kNewM1+kNewM2+...), also

> >> adding one loop for each OSClisten as Oeyvind suggests, but nevertheless

> >> just one message comes through by starting the send-instrument for the

> >> first time. A workaround is to start the send-instrument twice ( i 1 0

> >> 0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.

> >> Restarting csound within a short time has the same effect as starting

> >> the send-instrument twice. If I wait with the second start more than a

> >> minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go

> >> through again (the same ist with restarting csound a second time after

> >> more than 1 minute).

> >> Any hints are welcome.

> >> Greetings

> >> Wolfgang

> >>

> >> Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:

> >>> Hi Wolfgang,

> >>> By waiting one minute and starting the process again, do you mean

> >>> restarting Csound, or just adding the same instrument call at time 60

> >>> in the (same) score?

> >>> If you are restarting Csound, I would expect the same thing to happen

> >>> over and over. ... or do you mean the messages all come through if you

> >>> run the sender csd twice in a row (restarting Csound) without waiting

> >>> more than a few seconds?

> >>>

> >>> Also, the receiver instrument looks a bit odd to me, maybe I'm

> >>> overlooking something(?)

> >>> What I mean is that you multiply the kNewM variables, which mean that

> >>> if *any* of the OSClisten instances has an empty message queue, you

> >>> will skip to continue. That could potentially leave messages in some

> >>> of the queues, and could mess up the expected order of received

> >>> events, I think.

> >>> A simple thing to test would be to use addition instead

> >>> (kNewM1+kNewM2+...), which should let you loop until all queues are

> >>> empty. However, if it was me, I'd make one loop for each OSClisten,

> >>> making sure that they all read until the queue is empty and then do

> >>> not read again until the next k-pass. This may or may not relate to

> >>> the erratic behaviour you experience, not sure.

> >>>

> >>> Oeyvind

> >>>

> >>> 2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang <wschnitzer@gmx.de

> >>>

> >>> <mailto:wschnitzer@gmx.de>>:

> >>>> Hi,

> >>>> I have a bigger project with csound and oscsend. One problem that

> >>>> occurs

> >>>> is: if I send more than one osc-message for the first time with

> >>>> oscsend,

> >>>> only one message gets through. If sending the messages a second time,

> >>>> all the messages arrive as expected. Waiting about one minute and

> >>>> starting the process once again, the problem comes up again. I use

> >>>> Windows 7 over network with two machines, not localhost.

> >>>>

> >>>> Wolfgang

> >>>>

> >>>> /*Send-Instrument*/

> >>>>

> >>>> <CsoundSynthesizer>

> >>>> <CsOptions>

> >>>> -b128 -B256 -d -m263 -odac7

> >>>> </CsOptions>

> >>>> <CsInstruments>

> >>>> sr = 44100

> >>>> ksmps = 32

> >>>> nchnls = 2

> >>>> 0dbfs = 1

> >>>>

> >>>> #define IPADDRESS # "192.168.0.103" #

> >>>> #define S_PORT # 9001 #

> >>>>

> >>>> instr 1

> >>>>

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0

> >>>> OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0

> >>>>

> >>>> endin

> >>>>

> >>>> </CsInstruments>

> >>>> <CsScore>

> >>>> i 1 0 0.5

> >>>> ;i 1 0.5 0.5

> >>>> </CsScore>

> >>>> </CsoundSynthesizer>

> >>>>

> >>>> /*Receive-Instrument*/

> >>>>

> >>>> <CsoundSynthesizer>

> >>>> <CsOptions>

> >>>> -b128 -B256 -d -m263 -odac7

> >>>> </CsOptions>

> >>>> <CsInstruments>

> >>>> sr = 44100

> >>>> ksmps = 32

> >>>> nchnls = 2

> >>>> 0dbfs = 1

> >>>>

> >>>>

> >>>> #define R_PORT # 9001 #

> >>>> giPort OSCinit 9001

> >>>>

> >>>> instr 2

> >>>>

> >>>> kMessage1 init 0

> >>>> kMessage1t init 0

> >>>> kMessage2 init 0

> >>>> kMessage2t init 0

> >>>> kMessage3 init 0

> >>>> kMessage3t init 0

> >>>> kMessage4 init 0

> >>>> kMessage4t init 0

> >>>> kMessage5 init 0

> >>>> kMessage5t init 0

> >>>> kMessage6 init 0

> >>>> kMessage6t init 0

> >>>> kMessage7 init 0

> >>>> kMessage7t init 0

> >>>> kMessage8 init 0

> >>>> kMessage8t init 0

> >>>> kMessage9 init 0

> >>>> kMessage9t init 0

> >>>> kMessage10 init 0

> >>>> kMessage10t init 0

> >>>> kMessage11 init 0

> >>>> kMessage11t init 0

> >>>> kMessage12 init 0

> >>>> kMessage12t init 0

> >>>> kMessage13 init 0

> >>>> kMessage13t init 0

> >>>> kMessage14 init 0

> >>>> kMessage14t init 0

> >>>> kMessage15 init 0

> >>>> kMessage15t init 0

> >>>>

> >>>> NXTMSG:

> >>>> kNewM1 OSClisten giPort, "/scene/selectScene","f",kMessage1t

> >>>> if (kNewM1 == 1) then

> >>>>

> >>>> kMessage1 = kMessage1t

> >>>> printks "Neue Nachricht1: %f\n",0,kMessage1

> >>>>

> >>>> endif

> >>>> kNewM2 OSClisten giPort, "/scene/mixer1","f",kMessage2t

> >>>> if (kNewM2 == 1) then

> >>>>

> >>>> kMessage2 = kMessage2t

> >>>> printks "Neue Nachricht2: %f\n",0,kMessage2

> >>>>

> >>>> endif

> >>>> kNewM3 OSClisten giPort, "/scene/fader0","f",kMessage3t

> >>>> if (kNewM3 == 1) then

> >>>>

> >>>> kMessage3 = kMessage3t

> >>>> printks "Neue Nachricht3: %f\n",0,kMessage3

> >>>>

> >>>> endif

> >>>> kNewM4 OSClisten giPort, "/scene/fader1","f",kMessage4t

> >>>> if (kNewM4 == 1) then

> >>>>

> >>>> kMessage4 = kMessage4t

> >>>> printks "Neue Nachricht4: %f\n",0,kMessage4

> >>>>

> >>>> endif

> >>>> kNewM5 OSClisten giPort, "/scene/speedMixer","f",kMessage5t

> >>>> if (kNewM5 == 1) then

> >>>>

> >>>> kMessage5 = kMessage5t

> >>>> printks "Neue Nachricht5: %f\n",0,kMessage5

> >>>>

> >>>> endif

> >>>> kNewM6 OSClisten giPort, "/scene/selectTex","f",kMessage6t

> >>>> if (kNewM6 == 1) then

> >>>>

> >>>> kMessage6 = kMessage6t

> >>>> printks "Neue Nachricht6: %f\n",0,kMessage6

> >>>>

> >>>> endif

> >>>> kNewM7 OSClisten giPort, "/scene/selectTex2","f",kMessage7t

> >>>> if (kNewM7 == 1) then

> >>>>

> >>>> kMessage7 = kMessage7t

> >>>> printks "Neue Nachricht7: %f\n",0,kMessage7

> >>>>

> >>>> endif

> >>>> kNewM8 OSClisten giPort, "/scene/startFade","f",kMessage8t

> >>>> if (kNewM8 == 1) then

> >>>>

> >>>> kMessage8 = kMessage8t

> >>>> printks "Neue Nachricht8: %f\n",0,kMessage8

> >>>>

> >>>> endif

> >>>> kNewM9 OSClisten giPort, "/scene/randomMode","f",kMessage9t

> >>>> if (kNewM9 == 1) then

> >>>>

> >>>> kMessage9 = kMessage9t

> >>>> printks "Neue Nachricht9: %f\n",0,kMessage9

> >>>>

> >>>> endif

> >>>> kNewM10 OSClisten giPort,

> >>>>

> >>>> "/scene/speedRandom","f",kMessage10t

> >>>>

> >>>> if (kNewM10 == 1) then

> >>>>

> >>>> kMessage10 = kMessage10t

> >>>> printks "Neue Nachricht10: %f\n",0,kMessage10

> >>>>

> >>>> endif

> >>>> kNewM11 OSClisten giPort, "/scene/maskMode","f",kMessage11t

> >>>> if (kNewM11 == 1) then

> >>>>

> >>>> kMessage11 = kMessage11t

> >>>> printks "Neue Nachricht11: %f\n",0,kMessage11

> >>>>

> >>>> endif

> >>>> kNewM12 OSClisten giPort,

> >>>>

> >>>> "/scene/colorWaveMode","f",kMessage12t

> >>>>

> >>>> if (kNewM12 == 1) then

> >>>>

> >>>> kMessage12 = kMessage12t

> >>>> printks "Neue Nachricht12: %f\n",0,kMessage12

> >>>>

> >>>> endif

> >>>> kNewM13 OSClisten giPort, "/scene/gridDamp","f",kMessage13t

> >>>> if (kNewM13 == 1) then

> >>>>

> >>>> kMessage13 = kMessage13t

> >>>> printks "Neue Nachricht13: %f\n",0,kMessage13

> >>>>

> >>>> endif

> >>>> kNewM14 OSClisten giPort, "/scene/gridAmp","f",kMessage14t

> >>>> if (kNewM14 == 1) then

> >>>>

> >>>> kMessage14 = kMessage14t

> >>>> printks "Neue Nachricht14: %f\n",0,kMessage14

> >>>>

> >>>> endif

> >>>> kNewM15 OSClisten giPort,

> >>>>

> >>>> "/scene/colorChange","f",kMessage15t

> >>>>

> >>>> if (kNewM15 == 1) then

> >>>>

> >>>> kMessage15 = kMessage15t

> >>>> printks "Neue Nachricht15: %f\n",0,kMessage15

> >>>>

> >>>> endif

> >>>> kNewM =

> >>>>

> >>>> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*

> >>>> kNewM11*kNewM12*kNewM13*kNewM14*kNewM15>>>>

> >>>> if ( kNewM == 0 ) goto CONTINUE

> >>>> kgoto NXTMSG

> >>>>

> >>>> CONTINUE:

> >>>> endin

> >>>>

> >>>> </CsInstruments>

> >>>> <CsScore>

> >>>> i 2 0 20

> >>>> </CsScore>

> >>>> </CsoundSynthesizer>

> >>>>

> >>>>

> >>>> -----------------------------------------------------------------------

> >>>> ------- _______________________________________________

> >>>> Csound-users mailing list

> >>>> Csound-users@lists.sourceforge.net

> >>>> <mailto:Csound-users@lists.sourceforge.net>

> >>>> https://lists.sourceforge.net/lists/listinfo/csound-users

> >>>> Send bugs reports to

> >>>>

> >>>> https://github.com/csound/csound/issues

> >>>>

> >>>> Discussions of bugs and features can be posted here

> >>

> >> -------------------------------------------------------------------------

> >> ----- _______________________________________________

> >> Csound-users mailing list

> >> Csound-users@lists.sourceforge.net

> >> <mailto:Csound-users@lists.sourceforge.net>

> >> https://lists.sourceforge.net/lists/listinfo/csound-users

> >> Send bugs reports to

> >>

> >> https://github.com/csound/csound/issues

> >>

> >> Discussions of bugs and features can be posted here

> >

> > _____________________________________

> > Prof. Dr. David Worrall

> > International Audio Laboratories Erlangen

> > Fraunhofer-Institut für Integrierte Schaltungen IIS

> > Am Wolfsmantel 33

> > 91058 Erlangen

> > www: iis.fraunhofer.de <http://iis.fraunhofer.de>

> > audiolabs-erlangen.de/research/emerging-audio-research

> > <http://audiolabs-erlangen.de/research/emerging-audio-research>

> > ---

> > Adjunct Senior Research Fellow

> > School of Music, Australian National University

> > david.worrall@anu.edu.au <mailto:david.worrall@anu.edu.au>

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> > --------------------------------------------------------------------------

> > ----

> >

> >

> > _______________________________________________

> > Csound-users mailing list

> > Csound-users@lists.sourceforge.net

> > https://lists.sourceforge.net/lists/listinfo/csound-users

> > Send bugs reports to

> >

> > https://github.com/csound/csound/issues

> >

> > Discussions of bugs and features can be posted here

>

> ----------------------------------------------------------------------------

> -- _______________________________________________

> Csound-users mailing list

> Csound-users@lists.sourceforge.net

> https://lists.sourceforge.net/lists/listinfo/csound-users

> Send bugs reports to

> https://github.com/csound/csound/issues

> Discussions of bugs and features can be posted here

 


Date2015-06-19 03:42
FromDavid Worrall
SubjectRe: OSCsend-problem
AttachmentsNone  None  


# no frills python code to read (i.e. receive) udp data from addr IPv4 on port Port
# Set this code running first before initiating the send process.


from socket import *

IPv4 = “127.0.0.1”   # IPaddress
Port = 4444

ServerSock = socket(AF_INET, SOCK_DGRAM) # udp
ServerSock.bind((IPv4, Port))
print "Socket is ready to receive UDP data.."

while True:
data, addr = ServerSock.recvfrom(1024) # buffer size is 1024 bytes
print data

On 18.06.2015, at 23:07, Schnitzer Wolfgang <wschnitzer@gmx.de> wrote:

Hi David,
thanks a lot for your suggestions. It would be very useful if you can
post a simple python script to read the raw UDP. Next week I will have
access to the computers again and could do some more tests.
Best regards
Wolfgang

Am 18.06.2015 um 00:31 schrieb David Worrall:
Guten Tag Wolfram,

a couple of stabs in the dark:
1. That it runs for Oeyvind and Eduardo suggests it might be a
possible port assignment issue.
i.e. if you’re playing around with the formatting/addressing and you
mess up the addressing,
it can take a while for the OS to release the port, so when you try to
address it, sometimes works, sometimes doesn’t.
So between successive runs, until you have the code stable, try
changing ports every alternative run.

2. This could be my imagination, but I also found that OSCsend seemed
to worked more smoothly if I fed it a single string.
So I composed the string first the fed it to OSCsend. Like this:

Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr,
istartTime, instrNr,ifreq1, ifreq2, idur
Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST
Stringy strcat Stringy1, Stringy2

OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to
demoRoom
puts Stringy, 1 ; print the UDP message to the monitor

3. Test the send routine more simply. I have found it useful to just
run csound with the OSCsend code in it
and read the UDP port with a simple script - I use python - to read it
- as raw UDP. I can post a simple python script for doing that if it
would be useful. This should give you a sense of whether it is the
port that is blocking or not.

Für was es wert ist. … Viel Glück!

D.




On 17.06.2015, at 22:39, Schnitzer Wolfgang <wschnitzer@gmx.de
<mailto:wschnitzer@gmx.de>> wrote:

Hi,
thanks for your hints Oeyvind and Eduardo for testing on linux. I have
done some more testing myself, but the problem remains the same. I have
used addition instead of multiplication (kNewM1+kNewM2+...),  also
adding one loop for each OSClisten as Oeyvind suggests, but nevertheless
just one message comes through by starting the send-instrument for the
first time. A workaround is to start the send-instrument twice ( i 1 0
0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.
Restarting csound  within a short time has the same effect as starting
the send-instrument twice. If I wait with the second start more than a
minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go
through again (the same ist with restarting csound a second time after
more than 1 minute).
Any hints are welcome.
Greetings
Wolfgang

Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
Hi Wolfgang,
By waiting one minute and starting the process again, do you mean
restarting Csound, or just adding the same instrument call at time 60
in the (same) score?
If you are restarting Csound, I would expect the same thing to happen
over and over. ... or do you mean the messages all come through if you
run the sender csd twice in a row (restarting Csound) without waiting
more than a few seconds?

Also, the receiver instrument looks a bit odd to me, maybe I'm
overlooking something(?)
What I mean is that you multiply the kNewM variables, which mean that
if *any* of the OSClisten instances has an empty message queue, you
will skip to continue. That could potentially leave messages in some
of the queues, and could mess up the expected order of received
events, I think.
A simple thing to test would be to use addition instead
(kNewM1+kNewM2+...), which should let you loop until all queues are
empty. However, if it was me, I'd make one loop for each OSClisten,
making sure that they all read until the queue is empty and then do
not read again until the next k-pass. This may or may not relate to
the erratic behaviour you experience, not sure.

Oeyvind

2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang <wschnitzer@gmx.de
<mailto:wschnitzer@gmx.de>>:
Hi,
I have a bigger project with csound and oscsend. One problem that
occurs
is: if I send more than one osc-message for the first time with
oscsend,
only one message gets through. If sending the messages a second time,
all the messages arrive as expected. Waiting about one minute and
starting the process once again, the problem comes up again. I use
Windows 7 over network with two machines, not localhost.

Wolfgang

/*Send-Instrument*/

<CsoundSynthesizer>
<CsOptions>
-b128 -B256 -d -m263 -odac7
</CsOptions>
<CsInstruments>
sr        =    44100
ksmps    =    32
nchnls    =    2
0dbfs    =    1

#define    IPADDRESS        # "192.168.0.103" #
#define    S_PORT         # 9001 #

instr    1
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
    OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
endin

</CsInstruments>
<CsScore>
i 1 0 0.5
;i 1 0.5 0.5
</CsScore>
</CsoundSynthesizer>

/*Receive-Instrument*/

<CsoundSynthesizer>
<CsOptions>
-b128 -B256 -d -m263 -odac7
</CsOptions>
<CsInstruments>
sr        =    44100
ksmps    =    32
nchnls    =    2
0dbfs    =    1


#define    R_PORT         # 9001 #
giPort     OSCinit        9001

instr    2
    kMessage1        init    0
    kMessage1t    init    0
    kMessage2        init    0
    kMessage2t    init    0
    kMessage3        init    0
    kMessage3t    init    0
    kMessage4        init    0
    kMessage4t    init    0
    kMessage5        init    0
    kMessage5t    init    0
    kMessage6        init    0
    kMessage6t    init    0
    kMessage7        init    0
    kMessage7t    init    0
    kMessage8        init    0
    kMessage8t    init    0
    kMessage9        init    0
    kMessage9t    init    0
    kMessage10        init    0
    kMessage10t    init    0
    kMessage11        init    0
    kMessage11t    init    0
    kMessage12        init    0
    kMessage12t    init    0
    kMessage13        init    0
    kMessage13t    init    0
    kMessage14        init    0
    kMessage14t    init    0
    kMessage15        init    0
    kMessage15t    init    0
NXTMSG:
    kNewM1    OSClisten    giPort, "/scene/selectScene","f",kMessage1t
    if (kNewM1 == 1) then
        kMessage1 = kMessage1t
        printks "Neue Nachricht1: %f\n",0,kMessage1
    endif
    kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
    if (kNewM2 == 1) then
        kMessage2 = kMessage2t
        printks "Neue Nachricht2: %f\n",0,kMessage2
    endif
    kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
    if (kNewM3 == 1) then
        kMessage3 = kMessage3t
        printks "Neue Nachricht3: %f\n",0,kMessage3
    endif
    kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
    if (kNewM4 == 1) then
        kMessage4 = kMessage4t
        printks "Neue Nachricht4: %f\n",0,kMessage4
    endif
    kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
    if (kNewM5 == 1) then
        kMessage5 = kMessage5t
        printks "Neue Nachricht5: %f\n",0,kMessage5
    endif
    kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
    if (kNewM6 == 1) then
        kMessage6 = kMessage6t
        printks "Neue Nachricht6: %f\n",0,kMessage6
    endif
    kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
    if (kNewM7 == 1) then
        kMessage7 = kMessage7t
        printks "Neue Nachricht7: %f\n",0,kMessage7
    endif
    kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
    if (kNewM8 == 1) then
        kMessage8 = kMessage8t
        printks "Neue Nachricht8: %f\n",0,kMessage8
    endif
    kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
    if (kNewM9 == 1) then
        kMessage9 = kMessage9t
        printks "Neue Nachricht9: %f\n",0,kMessage9
    endif
    kNewM10    OSClisten    giPort,
"/scene/speedRandom","f",kMessage10t
    if (kNewM10 == 1) then
        kMessage10 = kMessage10t
        printks "Neue Nachricht10: %f\n",0,kMessage10
    endif
    kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
    if (kNewM11 == 1) then
        kMessage11 = kMessage11t
        printks "Neue Nachricht11: %f\n",0,kMessage11
    endif
    kNewM12    OSClisten    giPort,
"/scene/colorWaveMode","f",kMessage12t
    if (kNewM12 == 1) then
        kMessage12 = kMessage12t
        printks "Neue Nachricht12: %f\n",0,kMessage12
    endif
    kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
    if (kNewM13 == 1) then
        kMessage13 = kMessage13t
        printks "Neue Nachricht13: %f\n",0,kMessage13
    endif
    kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
    if (kNewM14 == 1) then
        kMessage14 = kMessage14t
        printks "Neue Nachricht14: %f\n",0,kMessage14
    endif
    kNewM15    OSClisten    giPort,
"/scene/colorChange","f",kMessage15t
    if (kNewM15 == 1) then
        kMessage15 = kMessage15t
        printks "Neue Nachricht15: %f\n",0,kMessage15
    endif
    kNewM    =
kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
    if ( kNewM == 0 ) goto CONTINUE
    kgoto NXTMSG
CONTINUE:
    endin

</CsInstruments>
<CsScore>
i 2 0 20
</CsScore>
</CsoundSynthesizer>


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
<mailto:Csound-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
<mailto:Csound-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
      https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

_____________________________________
Prof. Dr. David Worrall
International Audio Laboratories Erlangen
Fraunhofer-Institut für Integrierte Schaltungen IIS
Am Wolfsmantel 33
91058 Erlangen
www: iis.fraunhofer.de <http://iis.fraunhofer.de>
audiolabs-erlangen.de/research/emerging-audio-research
<http://audiolabs-erlangen.de/research/emerging-audio-research>
---
Adjunct Senior Research Fellow
School of Music, Australian National University
david.worrall@anu.edu.au <mailto:david.worrall@anu.edu.au>












------------------------------------------------------------------------------


_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

_____________________________________
Prof. Dr. David Worrall
International Audio Laboratories Erlangen
Fraunhofer-Institut für Integrierte Schaltungen IIS
Am Wolfsmantel 33
91058 Erlangen
www: iis.fraunhofer.de 
---
Adjunct Senior Research Fellow
School of Music, Australian National University











Date2015-06-20 17:58
FromSchnitzer Wolfgang
SubjectRe: OSCsend-problem
Hi everybody,

I think I’ve figured out what caused my problem with OSCsend. My aim is: 
sending a couple of OSC-messages within an instrument in Csound at 
init-time to a second computer in the network. Problem: only one message 
arrives at the receiver when I start the instrument for the first time. 
By reinitializing the instrument a second time in between less than 2 
minutes, all messages go through.The solution (at the moment): changing 
the entry in the arp-list of the send-computer from dynamic to static 
(in console -> arp –s IP-address MAC). Now all the messages arrive as 
expected on the second computer at once. My next step is to place a 
batch-file in the autostart - folder to do the work. But maybe someone 
knows a more simple solution? Thanks everybody for your help and suggestions

Wolfgang


Am 19.06.2015 um 04:42 schrieb David Worrall:
>
>
> # no frills python code to read (i.e. receive) udp data from addr IPv4 
> on port Port
> # Set this code running first before initiating the send process.
>
>
> from socket import *
>
> IPv4 = “127.0.0.1”   # IPaddress
> Port = 4444
>
> ServerSock = socket(AF_INET, SOCK_DGRAM) # udp
> ServerSock.bind((IPv4, Port))
> print "Socket is ready to receive UDP data.."
>
> while True:
> data, addr = ServerSock.recvfrom(1024) # buffer size is 1024 bytes
> print data
>
> On 18.06.2015, at 23:07, Schnitzer Wolfgang  > wrote:
>
>> Hi David,
>> thanks a lot for your suggestions. It would be very useful if you can
>> post a simple python script to read the raw UDP. Next week I will have
>> access to the computers again and could do some more tests.
>> Best regards
>> Wolfgang
>>
>> Am 18.06.2015 um 00:31 schrieb David Worrall:
>>> Guten Tag Wolfram,
>>>
>>> a couple of stabs in the dark:
>>> 1. That it runs for Oeyvind and Eduardo suggests it might be a
>>> possible port assignment issue.
>>> i.e. if you’re playing around with the formatting/addressing and you
>>> mess up the addressing,
>>> it can take a while for the OS to release the port, so when you try to
>>> address it, sometimes works, sometimes doesn’t.
>>> So between successive runs, until you have the code stable, try
>>> changing ports every alternative run.
>>>
>>> 2. This could be my imagination, but I also found that OSCsend seemed
>>> to worked more smoothly if I fed it a single string.
>>> So I composed the string first the fed it to OSCsend. Like this:
>>>
>>> Stringy1 sprintf ",%i,%5.2f,%i,%5.2f,%5.2f,%5.2f", ieventNr,
>>> istartTime, instrNr,ifreq1, ifreq2, idur
>>> Stringy2 sprintf ",%s, %s", ScoreLabelSRC, ScoreLabelDST
>>> Stringy strcat Stringy1, Stringy2
>>>
>>> OSCsend p1, gSudpDemoRoom, giudpDemoPort,"", "s", Stringy ; UDP to
>>> demoRoom
>>> puts Stringy, 1 ; print the UDP message to the monitor
>>>
>>> 3. Test the send routine more simply. I have found it useful to just
>>> run csound with the OSCsend code in it
>>> and read the UDP port with a simple script - I use python - to read it
>>> - as raw UDP. I can post a simple python script for doing that if it
>>> would be useful. This should give you a sense of whether it is the
>>> port that is blocking or not.
>>>
>>> Für was es wert ist. … Viel Glück!
>>>
>>> D.
>>>
>>>
>>>
>>>
>>> On 17.06.2015, at 22:39, Schnitzer Wolfgang >> 
>>> > wrote:
>>>
>>>> Hi,
>>>> thanks for your hints Oeyvind and Eduardo for testing on linux. I have
>>>> done some more testing myself, but the problem remains the same. I have
>>>> used addition instead of multiplication (kNewM1+kNewM2+...),  also
>>>> adding one loop for each OSClisten as Oeyvind suggests, but 
>>>> nevertheless
>>>> just one message comes through by starting the send-instrument for the
>>>> first time. A workaround is to start the send-instrument twice ( i 1 0
>>>> 0.5 - i 1 0.5 0.5). Then all messages arrive at the receive-instrument.
>>>> Restarting csound  within a short time has the same effect as starting
>>>> the send-instrument twice. If I wait with the second start more than a
>>>> minute (i1 0 0.5, i1 120 0.5) in the score, only a few messages go
>>>> through again (the same ist with restarting csound a second time after
>>>> more than 1 minute).
>>>> Any hints are welcome.
>>>> Greetings
>>>> Wolfgang
>>>>
>>>> Am 17.06.2015 um 00:36 schrieb Oeyvind Brandtsegg:
>>>>> Hi Wolfgang,
>>>>> By waiting one minute and starting the process again, do you mean
>>>>> restarting Csound, or just adding the same instrument call at time 60
>>>>> in the (same) score?
>>>>> If you are restarting Csound, I would expect the same thing to happen
>>>>> over and over. ... or do you mean the messages all come through if you
>>>>> run the sender csd twice in a row (restarting Csound) without waiting
>>>>> more than a few seconds?
>>>>>
>>>>> Also, the receiver instrument looks a bit odd to me, maybe I'm
>>>>> overlooking something(?)
>>>>> What I mean is that you multiply the kNewM variables, which mean that
>>>>> if *any* of the OSClisten instances has an empty message queue, you
>>>>> will skip to continue. That could potentially leave messages in some
>>>>> of the queues, and could mess up the expected order of received
>>>>> events, I think.
>>>>> A simple thing to test would be to use addition instead
>>>>> (kNewM1+kNewM2+...), which should let you loop until all queues are
>>>>> empty. However, if it was me, I'd make one loop for each OSClisten,
>>>>> making sure that they all read until the queue is empty and then do
>>>>> not read again until the next k-pass. This may or may not relate to
>>>>> the erratic behaviour you experience, not sure.
>>>>>
>>>>> Oeyvind
>>>>>
>>>>> 2015-06-16 22:44 GMT+02:00 Schnitzer Wolfgang >>>> 
>>>>> >:
>>>>>> Hi,
>>>>>> I have a bigger project with csound and oscsend. One problem that
>>>>>> occurs
>>>>>> is: if I send more than one osc-message for the first time with
>>>>>> oscsend,
>>>>>> only one message gets through. If sending the messages a second time,
>>>>>> all the messages arrive as expected. Waiting about one minute and
>>>>>> starting the process once again, the problem comes up again. I use
>>>>>> Windows 7 over network with two machines, not localhost.
>>>>>>
>>>>>> Wolfgang
>>>>>>
>>>>>> /*Send-Instrument*/
>>>>>>
>>>>>> 
>>>>>> 
>>>>>> -b128 -B256 -d -m263 -odac7
>>>>>> 
>>>>>> 
>>>>>> sr        =    44100
>>>>>> ksmps    =    32
>>>>>> nchnls    =    2
>>>>>> 0dbfs    =    1
>>>>>>
>>>>>> #define    IPADDRESS        # "192.168.0.103" #
>>>>>> #define    S_PORT         # 9001 #
>>>>>>
>>>>>> instr    1
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectScene","f",0.111111
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/mixer1","f",0.222222
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader0","f",0.333333
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/fader1","f",0.444444
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedMixer","f",0.555555
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex","f",34
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/selectTex2","f",35
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/startFade","f",36
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/randomMode","f",37
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/speedRandom","f",0.95
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/maskMode","f",2
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorWaveMode","f",2.1
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridDamp","f",1.0
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/gridAmp","f",2.0
>>>>>>     OSCsend 0,$IPADDRESS,$S_PORT,"/scene/colorChange","f",3.0
>>>>>> endin
>>>>>>
>>>>>> 
>>>>>> 
>>>>>> i 1 0 0.5
>>>>>> ;i 1 0.5 0.5
>>>>>> 
>>>>>> 
>>>>>>
>>>>>> /*Receive-Instrument*/
>>>>>>
>>>>>> 
>>>>>> 
>>>>>> -b128 -B256 -d -m263 -odac7
>>>>>> 
>>>>>> 
>>>>>> sr        =    44100
>>>>>> ksmps    =    32
>>>>>> nchnls    =    2
>>>>>> 0dbfs    =    1
>>>>>>
>>>>>>
>>>>>> #define    R_PORT         # 9001 #
>>>>>> giPort     OSCinit        9001
>>>>>>
>>>>>> instr    2
>>>>>>     kMessage1        init    0
>>>>>>     kMessage1t    init    0
>>>>>>     kMessage2        init    0
>>>>>>     kMessage2t    init    0
>>>>>>     kMessage3        init    0
>>>>>>     kMessage3t    init    0
>>>>>>     kMessage4        init    0
>>>>>>     kMessage4t    init    0
>>>>>>     kMessage5        init    0
>>>>>>     kMessage5t    init    0
>>>>>>     kMessage6        init    0
>>>>>>     kMessage6t    init    0
>>>>>>     kMessage7        init    0
>>>>>>     kMessage7t    init    0
>>>>>>     kMessage8        init    0
>>>>>>     kMessage8t    init    0
>>>>>>     kMessage9        init    0
>>>>>>     kMessage9t    init    0
>>>>>>     kMessage10        init    0
>>>>>>     kMessage10t    init    0
>>>>>>     kMessage11        init    0
>>>>>>     kMessage11t    init    0
>>>>>>     kMessage12        init    0
>>>>>>     kMessage12t    init    0
>>>>>>     kMessage13        init    0
>>>>>>     kMessage13t    init    0
>>>>>>     kMessage14        init    0
>>>>>>     kMessage14t    init    0
>>>>>>     kMessage15        init    0
>>>>>>     kMessage15t    init    0
>>>>>> NXTMSG:
>>>>>>     kNewM1    OSClisten    giPort, 
>>>>>> "/scene/selectScene","f",kMessage1t
>>>>>>     if (kNewM1 == 1) then
>>>>>>         kMessage1 = kMessage1t
>>>>>>         printks "Neue Nachricht1: %f\n",0,kMessage1
>>>>>>     endif
>>>>>>     kNewM2    OSClisten    giPort, "/scene/mixer1","f",kMessage2t
>>>>>>     if (kNewM2 == 1) then
>>>>>>         kMessage2 = kMessage2t
>>>>>>         printks "Neue Nachricht2: %f\n",0,kMessage2
>>>>>>     endif
>>>>>>     kNewM3    OSClisten    giPort, "/scene/fader0","f",kMessage3t
>>>>>>     if (kNewM3 == 1) then
>>>>>>         kMessage3 = kMessage3t
>>>>>>         printks "Neue Nachricht3: %f\n",0,kMessage3
>>>>>>     endif
>>>>>>     kNewM4    OSClisten    giPort, "/scene/fader1","f",kMessage4t
>>>>>>     if (kNewM4 == 1) then
>>>>>>         kMessage4 = kMessage4t
>>>>>>         printks "Neue Nachricht4: %f\n",0,kMessage4
>>>>>>     endif
>>>>>>     kNewM5    OSClisten    giPort, "/scene/speedMixer","f",kMessage5t
>>>>>>     if (kNewM5 == 1) then
>>>>>>         kMessage5 = kMessage5t
>>>>>>         printks "Neue Nachricht5: %f\n",0,kMessage5
>>>>>>     endif
>>>>>>     kNewM6    OSClisten    giPort, "/scene/selectTex","f",kMessage6t
>>>>>>     if (kNewM6 == 1) then
>>>>>>         kMessage6 = kMessage6t
>>>>>>         printks "Neue Nachricht6: %f\n",0,kMessage6
>>>>>>     endif
>>>>>>     kNewM7    OSClisten    giPort, "/scene/selectTex2","f",kMessage7t
>>>>>>     if (kNewM7 == 1) then
>>>>>>         kMessage7 = kMessage7t
>>>>>>         printks "Neue Nachricht7: %f\n",0,kMessage7
>>>>>>     endif
>>>>>>     kNewM8    OSClisten    giPort, "/scene/startFade","f",kMessage8t
>>>>>>     if (kNewM8 == 1) then
>>>>>>         kMessage8 = kMessage8t
>>>>>>         printks "Neue Nachricht8: %f\n",0,kMessage8
>>>>>>     endif
>>>>>>     kNewM9    OSClisten    giPort, "/scene/randomMode","f",kMessage9t
>>>>>>     if (kNewM9 == 1) then
>>>>>>         kMessage9 = kMessage9t
>>>>>>         printks "Neue Nachricht9: %f\n",0,kMessage9
>>>>>>     endif
>>>>>>     kNewM10    OSClisten    giPort,
>>>>>> "/scene/speedRandom","f",kMessage10t
>>>>>>     if (kNewM10 == 1) then
>>>>>>         kMessage10 = kMessage10t
>>>>>>         printks "Neue Nachricht10: %f\n",0,kMessage10
>>>>>>     endif
>>>>>>     kNewM11    OSClisten    giPort, "/scene/maskMode","f",kMessage11t
>>>>>>     if (kNewM11 == 1) then
>>>>>>         kMessage11 = kMessage11t
>>>>>>         printks "Neue Nachricht11: %f\n",0,kMessage11
>>>>>>     endif
>>>>>>     kNewM12    OSClisten    giPort,
>>>>>> "/scene/colorWaveMode","f",kMessage12t
>>>>>>     if (kNewM12 == 1) then
>>>>>>         kMessage12 = kMessage12t
>>>>>>         printks "Neue Nachricht12: %f\n",0,kMessage12
>>>>>>     endif
>>>>>>     kNewM13    OSClisten    giPort, "/scene/gridDamp","f",kMessage13t
>>>>>>     if (kNewM13 == 1) then
>>>>>>         kMessage13 = kMessage13t
>>>>>>         printks "Neue Nachricht13: %f\n",0,kMessage13
>>>>>>     endif
>>>>>>     kNewM14    OSClisten    giPort, "/scene/gridAmp","f",kMessage14t
>>>>>>     if (kNewM14 == 1) then
>>>>>>         kMessage14 = kMessage14t
>>>>>>         printks "Neue Nachricht14: %f\n",0,kMessage14
>>>>>>     endif
>>>>>>     kNewM15    OSClisten    giPort,
>>>>>> "/scene/colorChange","f",kMessage15t
>>>>>>     if (kNewM15 == 1) then
>>>>>>         kMessage15 = kMessage15t
>>>>>>         printks "Neue Nachricht15: %f\n",0,kMessage15
>>>>>>     endif
>>>>>>     kNewM    =
>>>>>> kNewM1*kNewM2*kNewM3*kNewM4*kNewM5*kNewM6*kNewM7*kNewM8*kNewM9*kNewM10*kNewM11*kNewM12*kNewM13*kNewM14*kNewM15
>>>>>>     if ( kNewM == 0 ) goto CONTINUE
>>>>>>     kgoto NXTMSG
>>>>>> CONTINUE:
>>>>>>     endin
>>>>>>
>>>>>> 
>>>>>> 
>>>>>> i 2 0 20
>>>>>> 
>>>>>> 
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> _______________________________________________
>>>>>> Csound-users mailing list
>>>>>> Csound-users@lists.sourceforge.net 
>>>>>> 
>>>>>> 
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-users
>>>>>> Send bugs reports to
>>>>>>        https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Csound-users mailing list
>>>> Csound-users@lists.sourceforge.net 
>>>> 
>>>> 
>>>> https://lists.sourceforge.net/lists/listinfo/csound-users
>>>> Send bugs reports to
>>>>       https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> _____________________________________
>>> Prof. Dr. David Worrall
>>> International Audio Laboratories Erlangen
>>> Fraunhofer-Institut für Integrierte Schaltungen IIS
>>> Am Wolfsmantel 33
>>> 91058 Erlangen
>>> www: iis.fraunhofer.de  
>>> 
>>> audiolabs-erlangen.de/research/emerging-audio-research 
>>> 
>>> 
>>> ---
>>> Adjunct Senior Research Fellow
>>> School of Music, Australian National University
>>> david.worrall@anu.edu.au  
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> Csound-users mailing list
>>> Csound-users@lists.sourceforge.net 
>>> 
>>> https://lists.sourceforge.net/lists/listinfo/csound-users
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Csound-users mailing list
>> Csound-users@lists.sourceforge.net 
>> 
>> https://lists.sourceforge.net/lists/listinfo/csound-users
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> _____________________________________
> Prof. Dr. David Worrall
> International Audio Laboratories Erlangen
> Fraunhofer-Institut für Integrierte Schaltungen IIS
> Am Wolfsmantel 33
> 91058 Erlangen
> www: iis.fraunhofer.de 
> audiolabs-erlangen.de/research/emerging-audio-research 
> 
> ---
> Adjunct Senior Research Fellow
> School of Music, Australian National University
> david.worrall@anu.edu.au 
>
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here