Quantcast

[Csnd] CSound "live coding" via open sound control

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] CSound "live coding" via open sound control

free coder
Hi,

I am experimenting with CSound live coding, running it in a terminal with the option  "-L stdin".
It is cool, but s there a way to send live code via an OSC port and not just type code in the terminal window ?
From what i understand now it is possible to live code from the terminal window (it works !), but I would like to 'live code' from other environments (processing, max, pd ...) sending OSC 'live code' messages.

is this already possible ? how is it possible to listen to 'live coding' on an OSC port ? (something live "-L oscport 9999" ?)

(note that i am not talking about the existing OSC  possibilities  in a .csd like initOSC etc ... as this is not live coding but parameter control via OSC)

many thanks if someone has any hints !

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

eddyc
I don’t know about OSC but this can be achieved using web sockets so it may be helpful to you, for instance, from a web page you can send an instrument like in the following example, in this case sending a trigger flag value and instrument string when a button is clicked in the web page:

            var kvarSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "kvar");
            var stringSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "Sstring");
            
            var trigger = 1;

            stringButton.onclick = function() {

                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0 \n out a1 \nendin\"");
                kvarSocket.send(new Float64Array([trigger]));
                trigger = !trigger;
            }

On the Csound side you can receive like this:

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
nchnls = 2
0dbfs = 1
ksmps = 256
sr = 44100

instr 1

iport init 8888
kvarChanged init 0
ktrigger init 0

kvar, Sstring websocket iport

if kvarChanged != kvar then
kvarChanged = kvar
ktrigger = 1
Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
endif

scoreline Sscore, ktrigger
ktrigger = 0

endin

instr 2

prints p4
Sstring = p4
ires compilestr Sstring
scoreline_i "i 3 0 3 .2 415"
turnoff
endin

</CsInstruments>
<CsScore>
i1 0 100
</CsScore>
</CsoundSynthesizer>

Maybe you can repurpose this example to use OSC instead, 
Cheers,
Ed

On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:

Hi,

I am experimenting with CSound live coding, running it in a terminal with the option  "-L stdin".
It is cool, but s there a way to send live code via an OSC port and not just type code in the terminal window ?
From what i understand now it is possible to live code from the terminal window (it works !), but I would like to 'live code' from other environments (processing, max, pd ...) sending OSC 'live code' messages.

is this already possible ? how is it possible to listen to 'live coding' on an OSC port ? (something live "-L oscport 9999" ?)

(note that i am not talking about the existing OSC  possibilities  in a .csd like initOSC etc ... as this is not live coding but parameter control via OSC)

many thanks if someone has any hints !

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Dave Seidel
Steven Yi wrote a nice Python program a few years ago that runs a CSD via the Csound API, and sets up a generic OSC server that allows the user to send score events, and to set channel values: https://github.com/kunstmusik/OSCsound


On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]> wrote:
I don’t know about OSC but this can be achieved using web sockets so it may be helpful to you, for instance, from a web page you can send an instrument like in the following example, in this case sending a trigger flag value and instrument string when a button is clicked in the web page:

            var kvarSocket = new WebSocket("ws://127.0.0.1:8888", "kvar");
            var stringSocket = new WebSocket("ws://127.0.0.1:8888", "Sstring");
            
            var trigger = 1;

            stringButton.onclick = function() {

                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0 \n out a1 \nendin\"");
                kvarSocket.send(new Float64Array([trigger]));
                trigger = !trigger;
            }

On the Csound side you can receive like this:

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
nchnls = 2
0dbfs = 1
ksmps = 256
sr = 44100

instr 1

iport init 8888
kvarChanged init 0
ktrigger init 0

kvar, Sstring websocket iport

if kvarChanged != kvar then
kvarChanged = kvar
ktrigger = 1
Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
endif

scoreline Sscore, ktrigger
ktrigger = 0

endin

instr 2

prints p4
Sstring = p4
ires compilestr Sstring
scoreline_i "i 3 0 3 .2 415"
turnoff
endin

</CsInstruments>
<CsScore>
i1 0 100
</CsScore>
</CsoundSynthesizer>

Maybe you can repurpose this example to use OSC instead, 
Cheers,
Ed

On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:

Hi,

I am experimenting with CSound live coding, running it in a terminal with the option  "-L stdin".
It is cool, but s there a way to send live code via an OSC port and not just type code in the terminal window ?
From what i understand now it is possible to live code from the terminal window (it works !), but I would like to 'live code' from other environments (processing, max, pd ...) sending OSC 'live code' messages.

is this already possible ? how is it possible to listen to 'live coding' on an OSC port ? (something live "-L oscport 9999" ?)

(note that i am not talking about the existing OSC  possibilities  in a .csd like initOSC etc ... as this is not live coding but parameter control via OSC)

many thanks if someone has any hints !

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Opcode to invert the phase of a signal

Celso Machado
In reply to this post by eddyc
Hi,

is there an opcode to invert the phase of an audio signal?
I’m working on a granular instrument and I’d like to try to alternate between a grain in phase and the next grain out of phase to hear the overall result.
Best Regards
Celso Machado

On Feb 17, 2017, at 23:28, Ed Costello <[hidden email]> wrote:

I don’t know about OSC but this can be achieved using web sockets so it may be helpful to you, for instance, from a web page you can send an instrument like in the following example, in this case sending a trigger flag value and instrument string when a button is clicked in the web page:

            var kvarSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "kvar");
            var stringSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "Sstring");
            
            var trigger = 1;

            stringButton.onclick = function() {

                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0 \n out a1 \nendin\"");
                kvarSocket.send(new Float64Array([trigger]));
                trigger = !trigger;
            }

On the Csound side you can receive like this:

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
nchnls = 2
0dbfs = 1
ksmps = 256
sr = 44100

instr 1

iport init 8888
kvarChanged init 0
ktrigger init 0

kvar, Sstring websocket iport

if kvarChanged != kvar then
kvarChanged = kvar
ktrigger = 1
Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
endif

scoreline Sscore, ktrigger
ktrigger = 0

endin

instr 2

prints p4
Sstring = p4
ires compilestr Sstring
scoreline_i "i 3 0 3 .2 415"
turnoff
endin

</CsInstruments>
<CsScore>
i1 0 100
</CsScore>
</CsoundSynthesizer>

Maybe you can repurpose this example to use OSC instead, 
Cheers,
Ed

On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:

Hi,

I am experimenting with CSound live coding, running it in a terminal with the option  "-L stdin".
It is cool, but s there a way to send live code via an OSC port and not just type code in the terminal window ?
From what i understand now it is possible to live code from the terminal window (it works !), but I would like to 'live code' from other environments (processing, max, pd ...) sending OSC 'live code' messages.

is this already possible ? how is it possible to listen to 'live coding' on an OSC port ? (something live "-L oscport 9999" ?)

(note that i am not talking about the existing OSC  possibilities  in a .csd like initOSC etc ... as this is not live coding but parameter control via OSC)

many thanks if someone has any hints !

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Opcode to invert the phase of a signal

eddyc
Can you not just multiply the audio signal by -1?
Ed

On 17 Feb 2017, at 14:40, Celso Machado <[hidden email]> wrote:

Hi,

is there an opcode to invert the phase of an audio signal?
I’m working on a granular instrument and I’d like to try to alternate between a grain in phase and the next grain out of phase to hear the overall result.
Best Regards
Celso Machado

On Feb 17, 2017, at 23:28, Ed Costello <[hidden email]> wrote:

I don’t know about OSC but this can be achieved using web sockets so it may be helpful to you, for instance, from a web page you can send an instrument like in the following example, in this case sending a trigger flag value and instrument string when a button is clicked in the web page:

            var kvarSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "kvar");
            var stringSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "Sstring");
            
            var trigger = 1;

            stringButton.onclick = function() {

                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0 \n out a1 \nendin\"");
                kvarSocket.send(new Float64Array([trigger]));
                trigger = !trigger;
            }

On the Csound side you can receive like this:

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
nchnls = 2
0dbfs = 1
ksmps = 256
sr = 44100

instr 1

iport init 8888
kvarChanged init 0
ktrigger init 0

kvar, Sstring websocket iport

if kvarChanged != kvar then
kvarChanged = kvar
ktrigger = 1
Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
endif

scoreline Sscore, ktrigger
ktrigger = 0

endin

instr 2

prints p4
Sstring = p4
ires compilestr Sstring
scoreline_i "i 3 0 3 .2 415"
turnoff
endin

</CsInstruments>
<CsScore>
i1 0 100
</CsScore>
</CsoundSynthesizer>

Maybe you can repurpose this example to use OSC instead, 
Cheers,
Ed

On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:

Hi,

I am experimenting with CSound live coding, running it in a terminal with the option  "-L stdin".
It is cool, but s there a way to send live code via an OSC port and not just type code in the terminal window ?
From what i understand now it is possible to live code from the terminal window (it works !), but I would like to 'live code' from other environments (processing, max, pd ...) sending OSC 'live code' messages.

is this already possible ? how is it possible to listen to 'live coding' on an OSC port ? (something live "-L oscport 9999" ?)

(note that i am not talking about the existing OSC  possibilities  in a .csd like initOSC etc ... as this is not live coding but parameter control via OSC)

many thanks if someone has any hints !

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Steven Yi
In reply to this post by Dave Seidel
Wow, I forgot about that project, thanks for mentioning it! :)  (It
actually may be very useful for a project I had in mind for
distributed sound generation...)

I was about to write that I tend to do live code with Csound these
days using UDP and csound's --port=10000 (or whatever port number you
want to use) flag.  Using that, you can send orchestra code to Csound
via the port.  The small Vim plugin I have:

https://github.com/kunstmusik/csound-repl

Shows how it uses python to send code to a running Csound via UDP.

Regarding OSCsound, it'd probably be useful to update it to take in
and /orc message with orchestra code. Since I need something like this
anyways, I'll look at updating that Python script this weekend.

On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]> wrote:

> Steven Yi wrote a nice Python program a few years ago that runs a CSD via
> the Csound API, and sets up a generic OSC server that allows the user to
> send score events, and to set channel values:
> https://github.com/kunstmusik/OSCsound
>
>
> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]> wrote:
>>
>> I don’t know about OSC but this can be achieved using web sockets so it
>> may be helpful to you, for instance, from a web page you can send an
>> instrument like in the following example, in this case sending a trigger
>> flag value and instrument string when a button is clicked in the web page:
>>
>>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888", "kvar");
>>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> "Sstring");
>>
>>             var trigger = 1;
>>
>>             stringButton.onclick = function() {
>>
>>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0
>> \n out a1 \nendin\"");
>>                 kvarSocket.send(new Float64Array([trigger]));
>>                 trigger = !trigger;
>>             }
>>
>> On the Csound side you can receive like this:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac
>> </CsOptions>
>> <CsInstruments>
>> nchnls = 2
>> 0dbfs = 1
>> ksmps = 256
>> sr = 44100
>>
>> instr 1
>>
>> iport init 8888
>> kvarChanged init 0
>> ktrigger init 0
>>
>> kvar, Sstring websocket iport
>>
>> if kvarChanged != kvar then
>> kvarChanged = kvar
>> ktrigger = 1
>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> endif
>>
>> scoreline Sscore, ktrigger
>> ktrigger = 0
>>
>> endin
>>
>> instr 2
>>
>> prints p4
>> Sstring = p4
>> ires compilestr Sstring
>> scoreline_i "i 3 0 3 .2 415"
>> turnoff
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 100
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Maybe you can repurpose this example to use OSC instead,
>> Cheers,
>> Ed
>>
>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>
>> Hi,
>>
>> I am experimenting with CSound live coding, running it in a terminal with
>> the option  "-L stdin".
>> It is cool, but s there a way to send live code via an OSC port and not
>> just type code in the terminal window ?
>> From what i understand now it is possible to live code from the terminal
>> window (it works !), but I would like to 'live code' from other environments
>> (processing, max, pd ...) sending OSC 'live code' messages.
>>
>> is this already possible ? how is it possible to listen to 'live coding'
>> on an OSC port ? (something live "-L oscport 9999" ?)
>>
>> (note that i am not talking about the existing OSC  possibilities  in a
>> .csd like initOSC etc ... as this is not live coding but parameter control
>> via OSC)
>>
>> many thanks if someone has any hints !
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Dave Seidel
Steven, you may want to take a look at my fork. :-) I've added very little so far, just been restructuring to make it easier to reuse some of the code. My changes may or may not be to your taste (or match you plans), bur may as well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor

On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <[hidden email]> wrote:
Wow, I forgot about that project, thanks for mentioning it! :)  (It
actually may be very useful for a project I had in mind for
distributed sound generation...)

I was about to write that I tend to do live code with Csound these
days using UDP and csound's --port=10000 (or whatever port number you
want to use) flag.  Using that, you can send orchestra code to Csound
via the port.  The small Vim plugin I have:

https://github.com/kunstmusik/csound-repl

Shows how it uses python to send code to a running Csound via UDP.

Regarding OSCsound, it'd probably be useful to update it to take in
and /orc message with orchestra code. Since I need something like this
anyways, I'll look at updating that Python script this weekend.

On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]> wrote:
> Steven Yi wrote a nice Python program a few years ago that runs a CSD via
> the Csound API, and sets up a generic OSC server that allows the user to
> send score events, and to set channel values:
> https://github.com/kunstmusik/OSCsound
>
>
> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]> wrote:
>>
>> I don’t know about OSC but this can be achieved using web sockets so it
>> may be helpful to you, for instance, from a web page you can send an
>> instrument like in the following example, in this case sending a trigger
>> flag value and instrument string when a button is clicked in the web page:
>>
>>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888", "kvar");
>>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> "Sstring");
>>
>>             var trigger = 1;
>>
>>             stringButton.onclick = function() {
>>
>>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0
>> \n out a1 \nendin\"");
>>                 kvarSocket.send(new Float64Array([trigger]));
>>                 trigger = !trigger;
>>             }
>>
>> On the Csound side you can receive like this:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac
>> </CsOptions>
>> <CsInstruments>
>> nchnls = 2
>> 0dbfs = 1
>> ksmps = 256
>> sr = 44100
>>
>> instr 1
>>
>> iport init 8888
>> kvarChanged init 0
>> ktrigger init 0
>>
>> kvar, Sstring websocket iport
>>
>> if kvarChanged != kvar then
>> kvarChanged = kvar
>> ktrigger = 1
>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> endif
>>
>> scoreline Sscore, ktrigger
>> ktrigger = 0
>>
>> endin
>>
>> instr 2
>>
>> prints p4
>> Sstring = p4
>> ires compilestr Sstring
>> scoreline_i "i 3 0 3 .2 415"
>> turnoff
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 100
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Maybe you can repurpose this example to use OSC instead,
>> Cheers,
>> Ed
>>
>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>
>> Hi,
>>
>> I am experimenting with CSound live coding, running it in a terminal with
>> the option  "-L stdin".
>> It is cool, but s there a way to send live code via an OSC port and not
>> just type code in the terminal window ?
>> From what i understand now it is possible to live code from the terminal
>> window (it works !), but I would like to 'live code' from other environments
>> (processing, max, pd ...) sending OSC 'live code' messages.
>>
>> is this already possible ? how is it possible to listen to 'live coding'
>> on an OSC port ? (something live "-L oscport 9999" ?)
>>
>> (note that i am not talking about the existing OSC  possibilities  in a
>> .csd like initOSC etc ... as this is not live coding but parameter control
>> via OSC)
>>
>> many thanks if someone has any hints !
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



--
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Steven Yi
Neat!  I'll study the code more carefully but on first glance it looks
nice with the with() syntax support and other more modern Python
practices. Perhaps it might even be better to base things on Felipe's
ctcsound ctypes binding now too.  I'll follow up here once I get
somewhere with all of this. :)

On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <[hidden email]> wrote:

> Steven, you may want to take a look at my fork. :-) I've added very little
> so far, just been restructuring to make it easier to reuse some of the code.
> My changes may or may not be to your taste (or match you plans), bur may as
> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>
> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <[hidden email]> wrote:
>>
>> Wow, I forgot about that project, thanks for mentioning it! :)  (It
>> actually may be very useful for a project I had in mind for
>> distributed sound generation...)
>>
>> I was about to write that I tend to do live code with Csound these
>> days using UDP and csound's --port=10000 (or whatever port number you
>> want to use) flag.  Using that, you can send orchestra code to Csound
>> via the port.  The small Vim plugin I have:
>>
>> https://github.com/kunstmusik/csound-repl
>>
>> Shows how it uses python to send code to a running Csound via UDP.
>>
>> Regarding OSCsound, it'd probably be useful to update it to take in
>> and /orc message with orchestra code. Since I need something like this
>> anyways, I'll look at updating that Python script this weekend.
>>
>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]>
>> wrote:
>> > Steven Yi wrote a nice Python program a few years ago that runs a CSD
>> > via
>> > the Csound API, and sets up a generic OSC server that allows the user to
>> > send score events, and to set channel values:
>> > https://github.com/kunstmusik/OSCsound
>> >
>> >
>> > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]>
>> > wrote:
>> >>
>> >> I don’t know about OSC but this can be achieved using web sockets so it
>> >> may be helpful to you, for instance, from a web page you can send an
>> >> instrument like in the following example, in this case sending a
>> >> trigger
>> >> flag value and instrument string when a button is clicked in the web
>> >> page:
>> >>
>> >>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "kvar");
>> >>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "Sstring");
>> >>
>> >>             var trigger = 1;
>> >>
>> >>             stringButton.onclick = function() {
>> >>
>> >>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2,
>> >> 0
>> >> \n out a1 \nendin\"");
>> >>                 kvarSocket.send(new Float64Array([trigger]));
>> >>                 trigger = !trigger;
>> >>             }
>> >>
>> >> On the Csound side you can receive like this:
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac
>> >> </CsOptions>
>> >> <CsInstruments>
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >> ksmps = 256
>> >> sr = 44100
>> >>
>> >> instr 1
>> >>
>> >> iport init 8888
>> >> kvarChanged init 0
>> >> ktrigger init 0
>> >>
>> >> kvar, Sstring websocket iport
>> >>
>> >> if kvarChanged != kvar then
>> >> kvarChanged = kvar
>> >> ktrigger = 1
>> >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> >> endif
>> >>
>> >> scoreline Sscore, ktrigger
>> >> ktrigger = 0
>> >>
>> >> endin
>> >>
>> >> instr 2
>> >>
>> >> prints p4
>> >> Sstring = p4
>> >> ires compilestr Sstring
>> >> scoreline_i "i 3 0 3 .2 415"
>> >> turnoff
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >> i1 0 100
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Maybe you can repurpose this example to use OSC instead,
>> >> Cheers,
>> >> Ed
>> >>
>> >> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am experimenting with CSound live coding, running it in a terminal
>> >> with
>> >> the option  "-L stdin".
>> >> It is cool, but s there a way to send live code via an OSC port and not
>> >> just type code in the terminal window ?
>> >> From what i understand now it is possible to live code from the
>> >> terminal
>> >> window (it works !), but I would like to 'live code' from other
>> >> environments
>> >> (processing, max, pd ...) sending OSC 'live code' messages.
>> >>
>> >> is this already possible ? how is it possible to listen to 'live
>> >> coding'
>> >> on an OSC port ? (something live "-L oscport 9999" ?)
>> >>
>> >> (note that i am not talking about the existing OSC  possibilities  in a
>> >> .csd like initOSC etc ... as this is not live coding but parameter
>> >> control
>> >> via OSC)
>> >>
>> >> many thanks if someone has any hints !
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> >
>> >
>> > --
>> > http://mysterybear.net
>> > https://soundcloud.com/mysterybear
>> > https://mysterybear.bandcamp.com
>> > Csound mailing list [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Dave Seidel
Yes, ctcsound looks great, thanks for the reminder!

On Fri, Feb 17, 2017 at 6:01 PM, Steven Yi <[hidden email]> wrote:
Neat!  I'll study the code more carefully but on first glance it looks
nice with the with() syntax support and other more modern Python
practices. Perhaps it might even be better to base things on Felipe's
ctcsound ctypes binding now too.  I'll follow up here once I get
somewhere with all of this. :)

On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <[hidden email]> wrote:
> Steven, you may want to take a look at my fork. :-) I've added very little
> so far, just been restructuring to make it easier to reuse some of the code.
> My changes may or may not be to your taste (or match you plans), bur may as
> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>
> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <[hidden email]> wrote:
>>
>> Wow, I forgot about that project, thanks for mentioning it! :)  (It
>> actually may be very useful for a project I had in mind for
>> distributed sound generation...)
>>
>> I was about to write that I tend to do live code with Csound these
>> days using UDP and csound's --port=10000 (or whatever port number you
>> want to use) flag.  Using that, you can send orchestra code to Csound
>> via the port.  The small Vim plugin I have:
>>
>> https://github.com/kunstmusik/csound-repl
>>
>> Shows how it uses python to send code to a running Csound via UDP.
>>
>> Regarding OSCsound, it'd probably be useful to update it to take in
>> and /orc message with orchestra code. Since I need something like this
>> anyways, I'll look at updating that Python script this weekend.
>>
>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]>
>> wrote:
>> > Steven Yi wrote a nice Python program a few years ago that runs a CSD
>> > via
>> > the Csound API, and sets up a generic OSC server that allows the user to
>> > send score events, and to set channel values:
>> > https://github.com/kunstmusik/OSCsound
>> >
>> >
>> > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]>
>> > wrote:
>> >>
>> >> I don’t know about OSC but this can be achieved using web sockets so it
>> >> may be helpful to you, for instance, from a web page you can send an
>> >> instrument like in the following example, in this case sending a
>> >> trigger
>> >> flag value and instrument string when a button is clicked in the web
>> >> page:
>> >>
>> >>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "kvar");
>> >>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "Sstring");
>> >>
>> >>             var trigger = 1;
>> >>
>> >>             stringButton.onclick = function() {
>> >>
>> >>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2,
>> >> 0
>> >> \n out a1 \nendin\"");
>> >>                 kvarSocket.send(new Float64Array([trigger]));
>> >>                 trigger = !trigger;
>> >>             }
>> >>
>> >> On the Csound side you can receive like this:
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac
>> >> </CsOptions>
>> >> <CsInstruments>
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >> ksmps = 256
>> >> sr = 44100
>> >>
>> >> instr 1
>> >>
>> >> iport init 8888
>> >> kvarChanged init 0
>> >> ktrigger init 0
>> >>
>> >> kvar, Sstring websocket iport
>> >>
>> >> if kvarChanged != kvar then
>> >> kvarChanged = kvar
>> >> ktrigger = 1
>> >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> >> endif
>> >>
>> >> scoreline Sscore, ktrigger
>> >> ktrigger = 0
>> >>
>> >> endin
>> >>
>> >> instr 2
>> >>
>> >> prints p4
>> >> Sstring = p4
>> >> ires compilestr Sstring
>> >> scoreline_i "i 3 0 3 .2 415"
>> >> turnoff
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >> i1 0 100
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Maybe you can repurpose this example to use OSC instead,
>> >> Cheers,
>> >> Ed
>> >>
>> >> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am experimenting with CSound live coding, running it in a terminal
>> >> with
>> >> the option  "-L stdin".
>> >> It is cool, but s there a way to send live code via an OSC port and not
>> >> just type code in the terminal window ?
>> >> From what i understand now it is possible to live code from the
>> >> terminal
>> >> window (it works !), but I would like to 'live code' from other
>> >> environments
>> >> (processing, max, pd ...) sending OSC 'live code' messages.
>> >>
>> >> is this already possible ? how is it possible to listen to 'live
>> >> coding'
>> >> on an OSC port ? (something live "-L oscport 9999" ?)
>> >>
>> >> (note that i am not talking about the existing OSC  possibilities  in a
>> >> .csd like initOSC etc ... as this is not live coding but parameter
>> >> control
>> >> via OSC)
>> >>
>> >> many thanks if someone has any hints !
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> >
>> >
>> > --
>> > http://mysterybear.net
>> > https://soundcloud.com/mysterybear
>> > https://mysterybear.bandcamp.com
>> > Csound mailing list [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



--
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Victor Lazzarini
In reply to this post by Steven Yi
Francois Pinot's ctcsound...

and Python3 and numpy. Great combination.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 17 Feb 2017, at 23:01, Steven Yi <[hidden email]> wrote:
>
> Neat!  I'll study the code more carefully but on first glance it looks
> nice with the with() syntax support and other more modern Python
> practices. Perhaps it might even be better to base things on Felipe's
> ctcsound ctypes binding now too.  I'll follow up here once I get
> somewhere with all of this. :)
>
>> On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <[hidden email]> wrote:
>> Steven, you may want to take a look at my fork. :-) I've added very little
>> so far, just been restructuring to make it easier to reuse some of the code.
>> My changes may or may not be to your taste (or match you plans), bur may as
>> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>>
>>> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <[hidden email]> wrote:
>>>
>>> Wow, I forgot about that project, thanks for mentioning it! :)  (It
>>> actually may be very useful for a project I had in mind for
>>> distributed sound generation...)
>>>
>>> I was about to write that I tend to do live code with Csound these
>>> days using UDP and csound's --port=10000 (or whatever port number you
>>> want to use) flag.  Using that, you can send orchestra code to Csound
>>> via the port.  The small Vim plugin I have:
>>>
>>> https://github.com/kunstmusik/csound-repl
>>>
>>> Shows how it uses python to send code to a running Csound via UDP.
>>>
>>> Regarding OSCsound, it'd probably be useful to update it to take in
>>> and /orc message with orchestra code. Since I need something like this
>>> anyways, I'll look at updating that Python script this weekend.
>>>
>>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]>
>>> wrote:
>>>> Steven Yi wrote a nice Python program a few years ago that runs a CSD
>>>> via
>>>> the Csound API, and sets up a generic OSC server that allows the user to
>>>> send score events, and to set channel values:
>>>> https://github.com/kunstmusik/OSCsound
>>>>
>>>>
>>>> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]>
>>>> wrote:
>>>>>
>>>>> I don’t know about OSC but this can be achieved using web sockets so it
>>>>> may be helpful to you, for instance, from a web page you can send an
>>>>> instrument like in the following example, in this case sending a
>>>>> trigger
>>>>> flag value and instrument string when a button is clicked in the web
>>>>> page:
>>>>>
>>>>>            var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>>>>> "kvar");
>>>>>            var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>>>>> "Sstring");
>>>>>
>>>>>            var trigger = 1;
>>>>>
>>>>>            stringButton.onclick = function() {
>>>>>
>>>>>                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2,
>>>>> 0
>>>>> \n out a1 \nendin\"");
>>>>>                kvarSocket.send(new Float64Array([trigger]));
>>>>>                trigger = !trigger;
>>>>>            }
>>>>>
>>>>> On the Csound side you can receive like this:
>>>>>
>>>>> <CsoundSynthesizer>
>>>>> <CsOptions>
>>>>> -odac
>>>>> </CsOptions>
>>>>> <CsInstruments>
>>>>> nchnls = 2
>>>>> 0dbfs = 1
>>>>> ksmps = 256
>>>>> sr = 44100
>>>>>
>>>>> instr 1
>>>>>
>>>>> iport init 8888
>>>>> kvarChanged init 0
>>>>> ktrigger init 0
>>>>>
>>>>> kvar, Sstring websocket iport
>>>>>
>>>>> if kvarChanged != kvar then
>>>>> kvarChanged = kvar
>>>>> ktrigger = 1
>>>>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>>>>> endif
>>>>>
>>>>> scoreline Sscore, ktrigger
>>>>> ktrigger = 0
>>>>>
>>>>> endin
>>>>>
>>>>> instr 2
>>>>>
>>>>> prints p4
>>>>> Sstring = p4
>>>>> ires compilestr Sstring
>>>>> scoreline_i "i 3 0 3 .2 415"
>>>>> turnoff
>>>>> endin
>>>>>
>>>>> </CsInstruments>
>>>>> <CsScore>
>>>>> i1 0 100
>>>>> </CsScore>
>>>>> </CsoundSynthesizer>
>>>>>
>>>>> Maybe you can repurpose this example to use OSC instead,
>>>>> Cheers,
>>>>> Ed
>>>>>
>>>>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I am experimenting with CSound live coding, running it in a terminal
>>>>> with
>>>>> the option  "-L stdin".
>>>>> It is cool, but s there a way to send live code via an OSC port and not
>>>>> just type code in the terminal window ?
>>>>> From what i understand now it is possible to live code from the
>>>>> terminal
>>>>> window (it works !), but I would like to 'live code' from other
>>>>> environments
>>>>> (processing, max, pd ...) sending OSC 'live code' messages.
>>>>>
>>>>> is this already possible ? how is it possible to listen to 'live
>>>>> coding'
>>>>> on an OSC port ? (something live "-L oscport 9999" ?)
>>>>>
>>>>> (note that i am not talking about the existing OSC  possibilities  in a
>>>>> .csd like initOSC etc ... as this is not live coding but parameter
>>>>> control
>>>>> via OSC)
>>>>>
>>>>> many thanks if someone has any hints !
>>>>>
>>>>> Csound mailing list [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>> features can
>>>>> be posted here
>>>>>
>>>>>
>>>>> Csound mailing list [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>> features can
>>>>> be posted here
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://mysterybear.net
>>>> https://soundcloud.com/mysterybear
>>>> https://mysterybear.bandcamp.com
>>>> Csound mailing list [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>> can
>>>> be posted here
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>>
>>
>>
>> --
>> http://mysterybear.net
>> https://soundcloud.com/mysterybear
>> https://mysterybear.bandcamp.com
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Steven Yi
Ah oops!  Apologies, I meant Francois, not Felipe (who I both thank
for their many contributions to the community! ;) ).

On Fri, Feb 17, 2017 at 6:05 PM, Victor Lazzarini
<[hidden email]> wrote:

> Francois Pinot's ctcsound...
>
> and Python3 and numpy. Great combination.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 17 Feb 2017, at 23:01, Steven Yi <[hidden email]> wrote:
>>
>> Neat!  I'll study the code more carefully but on first glance it looks
>> nice with the with() syntax support and other more modern Python
>> practices. Perhaps it might even be better to base things on Felipe's
>> ctcsound ctypes binding now too.  I'll follow up here once I get
>> somewhere with all of this. :)
>>
>>> On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <[hidden email]> wrote:
>>> Steven, you may want to take a look at my fork. :-) I've added very little
>>> so far, just been restructuring to make it easier to reuse some of the code.
>>> My changes may or may not be to your taste (or match you plans), bur may as
>>> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>>>
>>>> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <[hidden email]> wrote:
>>>>
>>>> Wow, I forgot about that project, thanks for mentioning it! :)  (It
>>>> actually may be very useful for a project I had in mind for
>>>> distributed sound generation...)
>>>>
>>>> I was about to write that I tend to do live code with Csound these
>>>> days using UDP and csound's --port=10000 (or whatever port number you
>>>> want to use) flag.  Using that, you can send orchestra code to Csound
>>>> via the port.  The small Vim plugin I have:
>>>>
>>>> https://github.com/kunstmusik/csound-repl
>>>>
>>>> Shows how it uses python to send code to a running Csound via UDP.
>>>>
>>>> Regarding OSCsound, it'd probably be useful to update it to take in
>>>> and /orc message with orchestra code. Since I need something like this
>>>> anyways, I'll look at updating that Python script this weekend.
>>>>
>>>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]>
>>>> wrote:
>>>>> Steven Yi wrote a nice Python program a few years ago that runs a CSD
>>>>> via
>>>>> the Csound API, and sets up a generic OSC server that allows the user to
>>>>> send score events, and to set channel values:
>>>>> https://github.com/kunstmusik/OSCsound
>>>>>
>>>>>
>>>>> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]>
>>>>> wrote:
>>>>>>
>>>>>> I don’t know about OSC but this can be achieved using web sockets so it
>>>>>> may be helpful to you, for instance, from a web page you can send an
>>>>>> instrument like in the following example, in this case sending a
>>>>>> trigger
>>>>>> flag value and instrument string when a button is clicked in the web
>>>>>> page:
>>>>>>
>>>>>>            var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>>>>>> "kvar");
>>>>>>            var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>>>>>> "Sstring");
>>>>>>
>>>>>>            var trigger = 1;
>>>>>>
>>>>>>            stringButton.onclick = function() {
>>>>>>
>>>>>>                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2,
>>>>>> 0
>>>>>> \n out a1 \nendin\"");
>>>>>>                kvarSocket.send(new Float64Array([trigger]));
>>>>>>                trigger = !trigger;
>>>>>>            }
>>>>>>
>>>>>> On the Csound side you can receive like this:
>>>>>>
>>>>>> <CsoundSynthesizer>
>>>>>> <CsOptions>
>>>>>> -odac
>>>>>> </CsOptions>
>>>>>> <CsInstruments>
>>>>>> nchnls = 2
>>>>>> 0dbfs = 1
>>>>>> ksmps = 256
>>>>>> sr = 44100
>>>>>>
>>>>>> instr 1
>>>>>>
>>>>>> iport init 8888
>>>>>> kvarChanged init 0
>>>>>> ktrigger init 0
>>>>>>
>>>>>> kvar, Sstring websocket iport
>>>>>>
>>>>>> if kvarChanged != kvar then
>>>>>> kvarChanged = kvar
>>>>>> ktrigger = 1
>>>>>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>>>>>> endif
>>>>>>
>>>>>> scoreline Sscore, ktrigger
>>>>>> ktrigger = 0
>>>>>>
>>>>>> endin
>>>>>>
>>>>>> instr 2
>>>>>>
>>>>>> prints p4
>>>>>> Sstring = p4
>>>>>> ires compilestr Sstring
>>>>>> scoreline_i "i 3 0 3 .2 415"
>>>>>> turnoff
>>>>>> endin
>>>>>>
>>>>>> </CsInstruments>
>>>>>> <CsScore>
>>>>>> i1 0 100
>>>>>> </CsScore>
>>>>>> </CsoundSynthesizer>
>>>>>>
>>>>>> Maybe you can repurpose this example to use OSC instead,
>>>>>> Cheers,
>>>>>> Ed
>>>>>>
>>>>>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am experimenting with CSound live coding, running it in a terminal
>>>>>> with
>>>>>> the option  "-L stdin".
>>>>>> It is cool, but s there a way to send live code via an OSC port and not
>>>>>> just type code in the terminal window ?
>>>>>> From what i understand now it is possible to live code from the
>>>>>> terminal
>>>>>> window (it works !), but I would like to 'live code' from other
>>>>>> environments
>>>>>> (processing, max, pd ...) sending OSC 'live code' messages.
>>>>>>
>>>>>> is this already possible ? how is it possible to listen to 'live
>>>>>> coding'
>>>>>> on an OSC port ? (something live "-L oscport 9999" ?)
>>>>>>
>>>>>> (note that i am not talking about the existing OSC  possibilities  in a
>>>>>> .csd like initOSC etc ... as this is not live coding but parameter
>>>>>> control
>>>>>> via OSC)
>>>>>>
>>>>>> many thanks if someone has any hints !
>>>>>>
>>>>>> Csound mailing list [hidden email]
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>> features can
>>>>>> be posted here
>>>>>>
>>>>>>
>>>>>> Csound mailing list [hidden email]
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>> features can
>>>>>> be posted here
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> http://mysterybear.net
>>>>> https://soundcloud.com/mysterybear
>>>>> https://mysterybear.bandcamp.com
>>>>> Csound mailing list [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>>> can
>>>>> be posted here
>>>>
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>        https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>>
>>>
>>>
>>> --
>>> http://mysterybear.net
>>> https://soundcloud.com/mysterybear
>>> https://mysterybear.bandcamp.com
>>> Csound mailing list [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> https://github.com/csound/csound/issues Discussions of bugs and features can
>>> be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Opcode to invert the phase of a signal

Celso Machado
In reply to this post by eddyc
Ed, how didn’t I think that?! LOL
Thank you!
Celso 

On Feb 17, 2017, at 23:41, Ed Costello <[hidden email]> wrote:

Can you not just multiply the audio signal by -1?
Ed

On 17 Feb 2017, at 14:40, Celso Machado <[hidden email]> wrote:

Hi,

is there an opcode to invert the phase of an audio signal?
I’m working on a granular instrument and I’d like to try to alternate between a grain in phase and the next grain out of phase to hear the overall result.
Best Regards
Celso Machado

On Feb 17, 2017, at 23:28, Ed Costello <[hidden email]> wrote:

I don’t know about OSC but this can be achieved using web sockets so it may be helpful to you, for instance, from a web page you can send an instrument like in the following example, in this case sending a trigger flag value and instrument string when a button is clicked in the web page:

            var kvarSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "kvar");
            var stringSocket = new WebSocket("<a href="ws://127.0.0.1:8888" class="">ws://127.0.0.1:8888", "Sstring");
            
            var trigger = 1;

            stringButton.onclick = function() {

                stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0 \n out a1 \nendin\"");
                kvarSocket.send(new Float64Array([trigger]));
                trigger = !trigger;
            }

On the Csound side you can receive like this:

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
nchnls = 2
0dbfs = 1
ksmps = 256
sr = 44100

instr 1

iport init 8888
kvarChanged init 0
ktrigger init 0

kvar, Sstring websocket iport

if kvarChanged != kvar then
kvarChanged = kvar
ktrigger = 1
Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
endif

scoreline Sscore, ktrigger
ktrigger = 0

endin

instr 2

prints p4
Sstring = p4
ires compilestr Sstring
scoreline_i "i 3 0 3 .2 415"
turnoff
endin

</CsInstruments>
<CsScore>
i1 0 100
</CsScore>
</CsoundSynthesizer>

Maybe you can repurpose this example to use OSC instead, 
Cheers,
Ed

On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:

Hi,

I am experimenting with CSound live coding, running it in a terminal with the option  "-L stdin".
It is cool, but s there a way to send live code via an OSC port and not just type code in the terminal window ?
From what i understand now it is possible to live code from the terminal window (it works !), but I would like to 'live code' from other environments (processing, max, pd ...) sending OSC 'live code' messages.

is this already possible ? how is it possible to listen to 'live coding' on an OSC port ? (something live "-L oscport 9999" ?)

(note that i am not talking about the existing OSC  possibilities  in a .csd like initOSC etc ... as this is not live coding but parameter control via OSC)

many thanks if someone has any hints !

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

thorin kerr
In reply to this post by Steven Yi
Emacs can send UDP to Csound (with --port option) as well.

Here's a short example of live coding Csound in emacs:

Thorin

On 18 Feb 2017 8:42 AM, "Steven Yi" <[hidden email]> wrote:
Wow, I forgot about that project, thanks for mentioning it! :)  (It
actually may be very useful for a project I had in mind for
distributed sound generation...)

I was about to write that I tend to do live code with Csound these
days using UDP and csound's --port=10000 (or whatever port number you
want to use) flag.  Using that, you can send orchestra code to Csound
via the port.  The small Vim plugin I have:

https://github.com/kunstmusik/csound-repl

Shows how it uses python to send code to a running Csound via UDP.

Regarding OSCsound, it'd probably be useful to update it to take in
and /orc message with orchestra code. Since I need something like this
anyways, I'll look at updating that Python script this weekend.

On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]> wrote:
> Steven Yi wrote a nice Python program a few years ago that runs a CSD via
> the Csound API, and sets up a generic OSC server that allows the user to
> send score events, and to set channel values:
> https://github.com/kunstmusik/OSCsound
>
>
> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]> wrote:
>>
>> I don’t know about OSC but this can be achieved using web sockets so it
>> may be helpful to you, for instance, from a web page you can send an
>> instrument like in the following example, in this case sending a trigger
>> flag value and instrument string when a button is clicked in the web page:
>>
>>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888", "kvar");
>>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> "Sstring");
>>
>>             var trigger = 1;
>>
>>             stringButton.onclick = function() {
>>
>>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0
>> \n out a1 \nendin\"");
>>                 kvarSocket.send(new Float64Array([trigger]));
>>                 trigger = !trigger;
>>             }
>>
>> On the Csound side you can receive like this:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac
>> </CsOptions>
>> <CsInstruments>
>> nchnls = 2
>> 0dbfs = 1
>> ksmps = 256
>> sr = 44100
>>
>> instr 1
>>
>> iport init 8888
>> kvarChanged init 0
>> ktrigger init 0
>>
>> kvar, Sstring websocket iport
>>
>> if kvarChanged != kvar then
>> kvarChanged = kvar
>> ktrigger = 1
>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> endif
>>
>> scoreline Sscore, ktrigger
>> ktrigger = 0
>>
>> endin
>>
>> instr 2
>>
>> prints p4
>> Sstring = p4
>> ires compilestr Sstring
>> scoreline_i "i 3 0 3 .2 415"
>> turnoff
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 100
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Maybe you can repurpose this example to use OSC instead,
>> Cheers,
>> Ed
>>
>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>
>> Hi,
>>
>> I am experimenting with CSound live coding, running it in a terminal with
>> the option  "-L stdin".
>> It is cool, but s there a way to send live code via an OSC port and not
>> just type code in the terminal window ?
>> From what i understand now it is possible to live code from the terminal
>> window (it works !), but I would like to 'live code' from other environments
>> (processing, max, pd ...) sending OSC 'live code' messages.
>>
>> is this already possible ? how is it possible to listen to 'live coding'
>> on an OSC port ? (something live "-L oscport 9999" ?)
>>
>> (note that i am not talking about the existing OSC  possibilities  in a
>> .csd like initOSC etc ... as this is not live coding but parameter control
>> via OSC)
>>
>> many thanks if someone has any hints !
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

rorywalsh
Nice. I have to admit to really enjoying watching live coding. It's quite addictive. 

On 17 February 2017 at 23:14, thorin kerr <[hidden email]> wrote:
Emacs can send UDP to Csound (with --port option) as well.

Here's a short example of live coding Csound in emacs:

Thorin

On 18 Feb 2017 8:42 AM, "Steven Yi" <[hidden email]> wrote:
Wow, I forgot about that project, thanks for mentioning it! :)  (It
actually may be very useful for a project I had in mind for
distributed sound generation...)

I was about to write that I tend to do live code with Csound these
days using UDP and csound's --port=10000 (or whatever port number you
want to use) flag.  Using that, you can send orchestra code to Csound
via the port.  The small Vim plugin I have:

https://github.com/kunstmusik/csound-repl

Shows how it uses python to send code to a running Csound via UDP.

Regarding OSCsound, it'd probably be useful to update it to take in
and /orc message with orchestra code. Since I need something like this
anyways, I'll look at updating that Python script this weekend.

On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]> wrote:
> Steven Yi wrote a nice Python program a few years ago that runs a CSD via
> the Csound API, and sets up a generic OSC server that allows the user to
> send score events, and to set channel values:
> https://github.com/kunstmusik/OSCsound
>
>
> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]> wrote:
>>
>> I don’t know about OSC but this can be achieved using web sockets so it
>> may be helpful to you, for instance, from a web page you can send an
>> instrument like in the following example, in this case sending a trigger
>> flag value and instrument string when a button is clicked in the web page:
>>
>>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888", "kvar");
>>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> "Sstring");
>>
>>             var trigger = 1;
>>
>>             stringButton.onclick = function() {
>>
>>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0
>> \n out a1 \nendin\"");
>>                 kvarSocket.send(new Float64Array([trigger]));
>>                 trigger = !trigger;
>>             }
>>
>> On the Csound side you can receive like this:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac
>> </CsOptions>
>> <CsInstruments>
>> nchnls = 2
>> 0dbfs = 1
>> ksmps = 256
>> sr = 44100
>>
>> instr 1
>>
>> iport init 8888
>> kvarChanged init 0
>> ktrigger init 0
>>
>> kvar, Sstring websocket iport
>>
>> if kvarChanged != kvar then
>> kvarChanged = kvar
>> ktrigger = 1
>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> endif
>>
>> scoreline Sscore, ktrigger
>> ktrigger = 0
>>
>> endin
>>
>> instr 2
>>
>> prints p4
>> Sstring = p4
>> ires compilestr Sstring
>> scoreline_i "i 3 0 3 .2 415"
>> turnoff
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 100
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Maybe you can repurpose this example to use OSC instead,
>> Cheers,
>> Ed
>>
>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>
>> Hi,
>>
>> I am experimenting with CSound live coding, running it in a terminal with
>> the option  "-L stdin".
>> It is cool, but s there a way to send live code via an OSC port and not
>> just type code in the terminal window ?
>> From what i understand now it is possible to live code from the terminal
>> window (it works !), but I would like to 'live code' from other environments
>> (processing, max, pd ...) sending OSC 'live code' messages.
>>
>> is this already possible ? how is it possible to listen to 'live coding'
>> on an OSC port ? (something live "-L oscport 9999" ?)
>>
>> (note that i am not talking about the existing OSC  possibilities  in a
>> .csd like initOSC etc ... as this is not live coding but parameter control
>> via OSC)
>>
>> many thanks if someone has any hints !
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Steven Yi
+1 Great to see that Thorin, thanks!

On Fri, Feb 17, 2017 at 6:21 PM, Rory Walsh <[hidden email]> wrote:

> Nice. I have to admit to really enjoying watching live coding. It's quite
> addictive.
>
> On 17 February 2017 at 23:14, thorin kerr <[hidden email]> wrote:
>>
>> Emacs can send UDP to Csound (with --port option) as well.
>>
>> Here's a short example of live coding Csound in emacs:
>> https://vimeo.com/152973336
>>
>> Thorin
>>
>> On 18 Feb 2017 8:42 AM, "Steven Yi" <[hidden email]> wrote:
>>
>> Wow, I forgot about that project, thanks for mentioning it! :)  (It
>> actually may be very useful for a project I had in mind for
>> distributed sound generation...)
>>
>> I was about to write that I tend to do live code with Csound these
>> days using UDP and csound's --port=10000 (or whatever port number you
>> want to use) flag.  Using that, you can send orchestra code to Csound
>> via the port.  The small Vim plugin I have:
>>
>> https://github.com/kunstmusik/csound-repl
>>
>> Shows how it uses python to send code to a running Csound via UDP.
>>
>> Regarding OSCsound, it'd probably be useful to update it to take in
>> and /orc message with orchestra code. Since I need something like this
>> anyways, I'll look at updating that Python script this weekend.
>>
>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]>
>> wrote:
>> > Steven Yi wrote a nice Python program a few years ago that runs a CSD
>> > via
>> > the Csound API, and sets up a generic OSC server that allows the user to
>> > send score events, and to set channel values:
>> > https://github.com/kunstmusik/OSCsound
>> >
>> >
>> > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]>
>> > wrote:
>> >>
>> >> I don’t know about OSC but this can be achieved using web sockets so it
>> >> may be helpful to you, for instance, from a web page you can send an
>> >> instrument like in the following example, in this case sending a
>> >> trigger
>> >> flag value and instrument string when a button is clicked in the web
>> >> page:
>> >>
>> >>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "kvar");
>> >>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "Sstring");
>> >>
>> >>             var trigger = 1;
>> >>
>> >>             stringButton.onclick = function() {
>> >>
>> >>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2,
>> >> 0
>> >> \n out a1 \nendin\"");
>> >>                 kvarSocket.send(new Float64Array([trigger]));
>> >>                 trigger = !trigger;
>> >>             }
>> >>
>> >> On the Csound side you can receive like this:
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac
>> >> </CsOptions>
>> >> <CsInstruments>
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >> ksmps = 256
>> >> sr = 44100
>> >>
>> >> instr 1
>> >>
>> >> iport init 8888
>> >> kvarChanged init 0
>> >> ktrigger init 0
>> >>
>> >> kvar, Sstring websocket iport
>> >>
>> >> if kvarChanged != kvar then
>> >> kvarChanged = kvar
>> >> ktrigger = 1
>> >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> >> endif
>> >>
>> >> scoreline Sscore, ktrigger
>> >> ktrigger = 0
>> >>
>> >> endin
>> >>
>> >> instr 2
>> >>
>> >> prints p4
>> >> Sstring = p4
>> >> ires compilestr Sstring
>> >> scoreline_i "i 3 0 3 .2 415"
>> >> turnoff
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >> i1 0 100
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Maybe you can repurpose this example to use OSC instead,
>> >> Cheers,
>> >> Ed
>> >>
>> >> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am experimenting with CSound live coding, running it in a terminal
>> >> with
>> >> the option  "-L stdin".
>> >> It is cool, but s there a way to send live code via an OSC port and not
>> >> just type code in the terminal window ?
>> >> From what i understand now it is possible to live code from the
>> >> terminal
>> >> window (it works !), but I would like to 'live code' from other
>> >> environments
>> >> (processing, max, pd ...) sending OSC 'live code' messages.
>> >>
>> >> is this already possible ? how is it possible to listen to 'live
>> >> coding'
>> >> on an OSC port ? (something live "-L oscport 9999" ?)
>> >>
>> >> (note that i am not talking about the existing OSC  possibilities  in a
>> >> .csd like initOSC etc ... as this is not live coding but parameter
>> >> control
>> >> via OSC)
>> >>
>> >> many thanks if someone has any hints !
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> >
>> >
>> > --
>> > http://mysterybear.net
>> > https://soundcloud.com/mysterybear
>> > https://mysterybear.bandcamp.com
>> > Csound mailing list [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

free coder
In reply to this post by Steven Yi
great !!
many thanks for your answers, i will have a look at the different suggestions (i think websockets and UDP should work rather well from another environment)


Saturday, 18 February 2017, 00:01 +0100 from Steven Yi <[hidden email]>:
Neat! I'll study the code more carefully but on first glance it looks
nice with the with() syntax support and other more modern Python
practices. Perhaps it might even be better to base things on Felipe's
ctcsound ctypes binding now too. I'll follow up here once I get
somewhere with all of this. :)

On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <dave.seidel@...> wrote:
> Steven, you may want to take a look at my fork. :-) I've added very little
> so far, just been restructuring to make it easier to reuse some of the code.
> My changes may or may not be to your taste (or match you plans), bur may as
> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>
> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <stevenyi@...> wrote:
>>
>> Wow, I forgot about that project, thanks for mentioning it! :) (It
>> actually may be very useful for a project I had in mind for
>> distributed sound generation...)
>>
>> I was about to write that I tend to do live code with Csound these
>> days using UDP and csound's --port=10000 (or whatever port number you
>> want to use) flag. Using that, you can send orchestra code to Csound
>> via the port. The small Vim plugin I have:
>>
>> https://github.com/kunstmusik/csound-repl
>>
>> Shows how it uses python to send code to a running Csound via UDP.
>>
>> Regarding OSCsound, it'd probably be useful to update it to take in
>> and /orc message with orchestra code. Since I need something like this
>> anyways, I'll look at updating that Python script this weekend.
>>
>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <dave.seidel@...>
>> wrote:
>> > Steven Yi wrote a nice Python program a few years ago that runs a CSD
>> > via
>> > the Csound API, and sets up a generic OSC server that allows the user to
>> > send score events, and to set channel values:
>> > https://github.com/kunstmusik/OSCsound
>> >
>> >
>> > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <phasereset@...>
>> > wrote:
>> >>
>> >> I don’t know about OSC but this can be achieved using web sockets so it
>> >> may be helpful to you, for instance, from a web page you can send an
>> >> instrument like in the following example, in this case sending a
>> >> trigger
>> >> flag value and instrument string when a button is clicked in the web
>> >> page:
>> >>
>> >> var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "kvar");
>> >> var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "Sstring");
>> >>
>> >> var trigger = 1;
>> >>
>> >> stringButton.onclick = function() {
>> >>
>> >> stringSocket.send(""instr 3\n a1 oscils p4/2, p5 / 2,
>> >> 0
>> >> \n out a1 \nendin"");
>> >> kvarSocket.send(new Float64Array([trigger]));
>> >> trigger = !trigger;
>> >> }
>> >>
>> >> On the Csound side you can receive like this:
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac
>> >> </CsOptions>
>> >> <CsInstruments>
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >> ksmps = 256
>> >> sr = 44100
>> >>
>> >> instr 1
>> >>
>> >> iport init 8888
>> >> kvarChanged init 0
>> >> ktrigger init 0
>> >>
>> >> kvar, Sstring websocket iport
>> >>
>> >> if kvarChanged != kvar then
>> >> kvarChanged = kvar
>> >> ktrigger = 1
>> >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> >> endif
>> >>
>> >> scoreline Sscore, ktrigger
>> >> ktrigger = 0
>> >>
>> >> endin
>> >>
>> >> instr 2
>> >>
>> >> prints p4
>> >> Sstring = p4
>> >> ires compilestr Sstring
>> >> scoreline_i "i 3 0 3 .2 415"
>> >> turnoff
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >> i1 0 100
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Maybe you can repurpose this example to use OSC instead,
>> >> Cheers,
>> >> Ed
>> >>
>> >> On 17 Feb 2017, at 14:04, free coder <zfreecoder@...> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am experimenting with CSound live coding, running it in a terminal
>> >> with
>> >> the option "-L stdin".
>> >> It is cool, but s there a way to send live code via an OSC port and not
>> >> just type code in the terminal window ?
>> >> From what i understand now it is possible to live code from the
>> >> terminal
>> >> window (it works !), but I would like to 'live code' from other
>> >> environments
>> >> (processing, max, pd ...) sending OSC 'live code' messages.
>> >>
>> >> is this already possible ? how is it possible to listen to 'live
>> >> coding'
>> >> on an OSC port ? (something live "-L oscport 9999" ?)
>> >>
>> >> (note that i am not talking about the existing OSC possibilities in a
>> >> .csd like initOSC etc ... as this is not live coding but parameter
>> >> control
>> >> via OSC)
>> >>
>> >> many thanks if someone has any hints !
>> >>
>> >> Csound mailing list Csound@...
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >>
>> >> Csound mailing list Csound@...
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> >
>> >
>> > --
>> > http://mysterybear.net
>> > https://soundcloud.com/mysterybear
>> > https://mysterybear.bandcamp.com
>> > Csound mailing list Csound@...
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@...
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>> https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list Csound@...
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@...
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

hlolli
Nice, emacs+csound <3


2017-02-18 0:25 GMT+01:00 free coder <[hidden email]>:
great !!
many thanks for your answers, i will have a look at the different suggestions (i think websockets and UDP should work rather well from another environment)


Saturday, 18 February 2017, 00:01 +0100 from Steven Yi <[hidden email]>:

Neat! I'll study the code more carefully but on first glance it looks
nice with the with() syntax support and other more modern Python
practices. Perhaps it might even be better to base things on Felipe's
ctcsound ctypes binding now too. I'll follow up here once I get
somewhere with all of this. :)

On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <dave.seidel@...> wrote:
> Steven, you may want to take a look at my fork. :-) I've added very little
> so far, just been restructuring to make it easier to reuse some of the code.
> My changes may or may not be to your taste (or match you plans), bur may as
> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>
> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <stevenyi@...> wrote:
>>
>> Wow, I forgot about that project, thanks for mentioning it! :) (It
>> actually may be very useful for a project I had in mind for
>> distributed sound generation...)
>>
>> I was about to write that I tend to do live code with Csound these
>> days using UDP and csound's --port=10000 (or whatever port number you
>> want to use) flag. Using that, you can send orchestra code to Csound
>> via the port. The small Vim plugin I have:
>>
>> https://github.com/kunstmusik/csound-repl
>>
>> Shows how it uses python to send code to a running Csound via UDP.
>>
>> Regarding OSCsound, it'd probably be useful to update it to take in
>> and /orc message with orchestra code. Since I need something like this
>> anyways, I'll look at updating that Python script this weekend.
>>
>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <dave.seidel@...>
>> wrote:
>> > Steven Yi wrote a nice Python program a few years ago that runs a CSD
>> > via
>> > the Csound API, and sets up a generic OSC server that allows the user to
>> > send score events, and to set channel values:
>> > https://github.com/kunstmusik/OSCsound
>> >
>> >
>> > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <phasereset@...>
>> > wrote:
>> >>
>> >> I don’t know about OSC but this can be achieved using web sockets so it
>> >> may be helpful to you, for instance, from a web page you can send an
>> >> instrument like in the following example, in this case sending a
>> >> trigger
>> >> flag value and instrument string when a button is clicked in the web
>> >> page:
>> >>
>> >> var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "kvar");
>> >> var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "Sstring");
>> >>
>> >> var trigger = 1;
>> >>
>> >> stringButton.onclick = function() {
>> >>
>> >> stringSocket.send(""instr 3\n a1 oscils p4/2, p5 / 2,
>> >> 0
>> >> \n out a1 \nendin"");
>> >> kvarSocket.send(new Float64Array([trigger]));
>> >> trigger = !trigger;
>> >> }
>> >>
>> >> On the Csound side you can receive like this:
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac
>> >> </CsOptions>
>> >> <CsInstruments>
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >> ksmps = 256
>> >> sr = 44100
>> >>
>> >> instr 1
>> >>
>> >> iport init 8888
>> >> kvarChanged init 0
>> >> ktrigger init 0
>> >>
>> >> kvar, Sstring websocket iport
>> >>
>> >> if kvarChanged != kvar then
>> >> kvarChanged = kvar
>> >> ktrigger = 1
>> >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> >> endif
>> >>
>> >> scoreline Sscore, ktrigger
>> >> ktrigger = 0
>> >>
>> >> endin
>> >>
>> >> instr 2
>> >>
>> >> prints p4
>> >> Sstring = p4
>> >> ires compilestr Sstring
>> >> scoreline_i "i 3 0 3 .2 415"
>> >> turnoff
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >> i1 0 100
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Maybe you can repurpose this example to use OSC instead,
>> >> Cheers,
>> >> Ed
>> >>
>> >> On 17 Feb 2017, at 14:04, free coder <zfreecoder@...> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am experimenting with CSound live coding, running it in a terminal
>> >> with
>> >> the option "-L stdin".
>> >> It is cool, but s there a way to send live code via an OSC port and not
>> >> just type code in the terminal window ?
>> >> From what i understand now it is possible to live code from the
>> >> terminal
>> >> window (it works !), but I would like to 'live code' from other
>> >> environments
>> >> (processing, max, pd ...) sending OSC 'live code' messages.
>> >>
>> >> is this already possible ? how is it possible to listen to 'live
>> >> coding'
>> >> on an OSC port ? (something live "-L oscport 9999" ?)
>> >>
>> >> (note that i am not talking about the existing OSC possibilities in a
>> >> .csd like initOSC etc ... as this is not live coding but parameter
>> >> control
>> >> via OSC)
>> >>
>> >> many thanks if someone has any hints !
>> >>
>> >> Csound mailing list Csound@...
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >>
>> >> Csound mailing list Csound@...
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> >
>> >
>> > --
>> > http://mysterybear.net
>> > https://soundcloud.com/mysterybear
>> > https://mysterybear.bandcamp.com
>> > Csound mailing list Csound@...
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@...
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>> https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list Csound@...
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@...
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

Doctor B
Lovely Live Coding!  Thanks for sharing.
All these suggestions are very inspiring.

-dB

Sent from my iPhone

On Feb 17, 2017, at 9:06 PM, Hlöðver Sigurðsson <[hidden email]> wrote:

Nice, emacs+csound <3


2017-02-18 0:25 GMT+01:00 free coder <[hidden email]>:
great !!
many thanks for your answers, i will have a look at the different suggestions (i think websockets and UDP should work rather well from another environment)


Saturday, 18 February 2017, 00:01 +0100 from Steven Yi <[hidden email]>:

Neat! I'll study the code more carefully but on first glance it looks
nice with the with() syntax support and other more modern Python
practices. Perhaps it might even be better to base things on Felipe's
ctcsound ctypes binding now too. I'll follow up here once I get
somewhere with all of this. :)

On Fri, Feb 17, 2017 at 5:48 PM, Dave Seidel <dave.seidel@...> wrote:
> Steven, you may want to take a look at my fork. :-) I've added very little
> so far, just been restructuring to make it easier to reuse some of the code.
> My changes may or may not be to your taste (or match you plans), bur may as
> well take a look: https://github.com/DaveSeidel/OSCsound/tree/ds-refactor
>
> On Fri, Feb 17, 2017 at 5:42 PM, Steven Yi <stevenyi@...> wrote:
>>
>> Wow, I forgot about that project, thanks for mentioning it! :) (It
>> actually may be very useful for a project I had in mind for
>> distributed sound generation...)
>>
>> I was about to write that I tend to do live code with Csound these
>> days using UDP and csound's --port=10000 (or whatever port number you
>> want to use) flag. Using that, you can send orchestra code to Csound
>> via the port. The small Vim plugin I have:
>>
>> https://github.com/kunstmusik/csound-repl
>>
>> Shows how it uses python to send code to a running Csound via UDP.
>>
>> Regarding OSCsound, it'd probably be useful to update it to take in
>> and /orc message with orchestra code. Since I need something like this
>> anyways, I'll look at updating that Python script this weekend.
>>
>> On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <dave.seidel@...>
>> wrote:
>> > Steven Yi wrote a nice Python program a few years ago that runs a CSD
>> > via
>> > the Csound API, and sets up a generic OSC server that allows the user to
>> > send score events, and to set channel values:
>> > https://github.com/kunstmusik/OSCsound
>> >
>> >
>> > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <phasereset@...>
>> > wrote:
>> >>
>> >> I don’t know about OSC but this can be achieved using web sockets so it
>> >> may be helpful to you, for instance, from a web page you can send an
>> >> instrument like in the following example, in this case sending a
>> >> trigger
>> >> flag value and instrument string when a button is clicked in the web
>> >> page:
>> >>
>> >> var kvarSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "kvar");
>> >> var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> >> "Sstring");
>> >>
>> >> var trigger = 1;
>> >>
>> >> stringButton.onclick = function() {
>> >>
>> >> stringSocket.send(""instr 3\n a1 oscils p4/2, p5 / 2,
>> >> 0
>> >> \n out a1 \nendin"");
>> >> kvarSocket.send(new Float64Array([trigger]));
>> >> trigger = !trigger;
>> >> }
>> >>
>> >> On the Csound side you can receive like this:
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac
>> >> </CsOptions>
>> >> <CsInstruments>
>> >> nchnls = 2
>> >> 0dbfs = 1
>> >> ksmps = 256
>> >> sr = 44100
>> >>
>> >> instr 1
>> >>
>> >> iport init 8888
>> >> kvarChanged init 0
>> >> ktrigger init 0
>> >>
>> >> kvar, Sstring websocket iport
>> >>
>> >> if kvarChanged != kvar then
>> >> kvarChanged = kvar
>> >> ktrigger = 1
>> >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> >> endif
>> >>
>> >> scoreline Sscore, ktrigger
>> >> ktrigger = 0
>> >>
>> >> endin
>> >>
>> >> instr 2
>> >>
>> >> prints p4
>> >> Sstring = p4
>> >> ires compilestr Sstring
>> >> scoreline_i "i 3 0 3 .2 415"
>> >> turnoff
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >> i1 0 100
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Maybe you can repurpose this example to use OSC instead,
>> >> Cheers,
>> >> Ed
>> >>
>> >> On 17 Feb 2017, at 14:04, free coder <zfreecoder@...> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am experimenting with CSound live coding, running it in a terminal
>> >> with
>> >> the option "-L stdin".
>> >> It is cool, but s there a way to send live code via an OSC port and not
>> >> just type code in the terminal window ?
>> >> From what i understand now it is possible to live code from the
>> >> terminal
>> >> window (it works !), but I would like to 'live code' from other
>> >> environments
>> >> (processing, max, pd ...) sending OSC 'live code' messages.
>> >>
>> >> is this already possible ? how is it possible to listen to 'live
>> >> coding'
>> >> on an OSC port ? (something live "-L oscport 9999" ?)
>> >>
>> >> (note that i am not talking about the existing OSC possibilities in a
>> >> .csd like initOSC etc ... as this is not live coding but parameter
>> >> control
>> >> via OSC)
>> >>
>> >> many thanks if someone has any hints !
>> >>
>> >> Csound mailing list Csound@...
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >>
>> >> Csound mailing list Csound@...
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> >
>> >
>> > --
>> > http://mysterybear.net
>> > https://soundcloud.com/mysterybear
>> > https://mysterybear.bandcamp.com
>> > Csound mailing list Csound@...
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>> Csound mailing list
>> Csound@...
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>> https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list Csound@...
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
Csound@...
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

joachim-3
In reply to this post by thorin kerr
very interesting, thanks.

what is this "ornament" in which you put these array() expressions?  a UDO?
can you share the code, or has it gone the way of all live code?

        joachim


On 18/02/17 00:14, thorin kerr wrote:

> Emacs can send UDP to Csound (with --port option) as well.
>
> Here's a short example of live coding Csound in emacs:
> https://vimeo.com/152973336
>
> Thorin
>
> On 18 Feb 2017 8:42 AM, "Steven Yi" <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Wow, I forgot about that project, thanks for mentioning it! :)  (It
>     actually may be very useful for a project I had in mind for
>     distributed sound generation...)
>
>     I was about to write that I tend to do live code with Csound these
>     days using UDP and csound's --port=10000 (or whatever port number you
>     want to use) flag.  Using that, you can send orchestra code to Csound
>     via the port.  The small Vim plugin I have:
>
>     https://github.com/kunstmusik/csound-repl
>     <https://github.com/kunstmusik/csound-repl>
>
>     Shows how it uses python to send code to a running Csound via UDP.
>
>     Regarding OSCsound, it'd probably be useful to update it to take in
>     and /orc message with orchestra code. Since I need something like this
>     anyways, I'll look at updating that Python script this weekend.
>
>     On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     > Steven Yi wrote a nice Python program a few years ago that runs a
>     CSD via
>     > the Csound API, and sets up a generic OSC server that allows the
>     user to
>     > send score events, and to set channel values:
>     > https://github.com/kunstmusik/OSCsound
>     <https://github.com/kunstmusik/OSCsound>
>     >
>     >
>     > On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     >>
>     >> I don’t know about OSC but this can be achieved using web sockets
>     so it
>     >> may be helpful to you, for instance, from a web page you can send an
>     >> instrument like in the following example, in this case sending a
>     trigger
>     >> flag value and instrument string when a button is clicked in the
>     web page:
>     >>
>     >>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888
>     <http://127.0.0.1:8888>", "kvar");
>     >>             var stringSocket = new WebSocket("ws://127.0.0.1:8888
>     <http://127.0.0.1:8888>",
>     >> "Sstring");
>     >>
>     >>             var trigger = 1;
>     >>
>     >>             stringButton.onclick = function() {
>     >>
>     >>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5
>     / 2, 0
>     >> \n out a1 \nendin\"");
>     >>                 kvarSocket.send(new Float64Array([trigger]));
>     >>                 trigger = !trigger;
>     >>             }
>     >>
>     >> On the Csound side you can receive like this:
>     >>
>     >> <CsoundSynthesizer>
>     >> <CsOptions>
>     >> -odac
>     >> </CsOptions>
>     >> <CsInstruments>
>     >> nchnls = 2
>     >> 0dbfs = 1
>     >> ksmps = 256
>     >> sr = 44100
>     >>
>     >> instr 1
>     >>
>     >> iport init 8888
>     >> kvarChanged init 0
>     >> ktrigger init 0
>     >>
>     >> kvar, Sstring websocket iport
>     >>
>     >> if kvarChanged != kvar then
>     >> kvarChanged = kvar
>     >> ktrigger = 1
>     >> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>     >> endif
>     >>
>     >> scoreline Sscore, ktrigger
>     >> ktrigger = 0
>     >>
>     >> endin
>     >>
>     >> instr 2
>     >>
>     >> prints p4
>     >> Sstring = p4
>     >> ires compilestr Sstring
>     >> scoreline_i "i 3 0 3 .2 415"
>     >> turnoff
>     >> endin
>     >>
>     >> </CsInstruments>
>     >> <CsScore>
>     >> i1 0 100
>     >> </CsScore>
>     >> </CsoundSynthesizer>
>     >>
>     >> Maybe you can repurpose this example to use OSC instead,
>     >> Cheers,
>     >> Ed
>     >>
>     >> On 17 Feb 2017, at 14:04, free coder <[hidden email]
>     <mailto:[hidden email]>> wrote:
>     >>
>     >> Hi,
>     >>
>     >> I am experimenting with CSound live coding, running it in a
>     terminal with
>     >> the option  "-L stdin".
>     >> It is cool, but s there a way to send live code via an OSC port
>     and not
>     >> just type code in the terminal window ?
>     >> From what i understand now it is possible to live code from the
>     terminal
>     >> window (it works !), but I would like to 'live code' from other
>     environments
>     >> (processing, max, pd ...) sending OSC 'live code' messages.
>     >>
>     >> is this already possible ? how is it possible to listen to 'live
>     coding'
>     >> on an OSC port ? (something live "-L oscport 9999" ?)
>     >>
>     >> (note that i am not talking about the existing OSC
>     possibilities  in a
>     >> .csd like initOSC etc ... as this is not live coding but
>     parameter control
>     >> via OSC)
>     >>
>     >> many thanks if someone has any hints !
>     >>
>     >> Csound mailing list [hidden email]
>     <mailto:[hidden email]>
>     >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports to
>     >> https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can
>     >> be posted here
>     >>
>     >>
>     >> Csound mailing list [hidden email]
>     <mailto:[hidden email]>
>     >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports to
>     >> https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can
>     >> be posted here
>     >
>     >
>     >
>     >
>     > --
>     > http://mysterybear.net
>     > https://soundcloud.com/mysterybear
>     <https://soundcloud.com/mysterybear>
>     > https://mysterybear.bandcamp.com <https://mysterybear.bandcamp.com>
>     > Csound mailing list [hidden email]
>     <mailto:[hidden email]>
>     > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports to
>     > https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can
>     > be posted here
>
>     Csound mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>     Send bugs reports to
>             https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues>
>     Discussions of bugs and features can be posted here
>
>
> Csound mailing list [hidden email]
> <mailto:[hidden email]>
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features
> can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] CSound "live coding" via open sound control

genell
In reply to this post by thorin kerr
Nice, Thorin!
Do you use Stephane's Csound-x or do you have a custom emacs mode?
If the latter, would you mind sharing your emacs mode files?

Regards,
Anders

18 feb. 2017 kl. 00:14 skrev thorin kerr <[hidden email]>:

Emacs can send UDP to Csound (with --port option) as well.

Here's a short example of live coding Csound in emacs:

Thorin

On 18 Feb 2017 8:42 AM, "Steven Yi" <[hidden email]> wrote:
Wow, I forgot about that project, thanks for mentioning it! :)  (It
actually may be very useful for a project I had in mind for
distributed sound generation...)

I was about to write that I tend to do live code with Csound these
days using UDP and csound's --port=10000 (or whatever port number you
want to use) flag.  Using that, you can send orchestra code to Csound
via the port.  The small Vim plugin I have:

https://github.com/kunstmusik/csound-repl

Shows how it uses python to send code to a running Csound via UDP.

Regarding OSCsound, it'd probably be useful to update it to take in
and /orc message with orchestra code. Since I need something like this
anyways, I'll look at updating that Python script this weekend.

On Fri, Feb 17, 2017 at 5:35 PM, Dave Seidel <[hidden email]> wrote:
> Steven Yi wrote a nice Python program a few years ago that runs a CSD via
> the Csound API, and sets up a generic OSC server that allows the user to
> send score events, and to set channel values:
> https://github.com/kunstmusik/OSCsound
>
>
> On Fri, Feb 17, 2017 at 5:28 PM, Ed Costello <[hidden email]> wrote:
>>
>> I don’t know about OSC but this can be achieved using web sockets so it
>> may be helpful to you, for instance, from a web page you can send an
>> instrument like in the following example, in this case sending a trigger
>> flag value and instrument string when a button is clicked in the web page:
>>
>>             var kvarSocket = new WebSocket("ws://127.0.0.1:8888", "kvar");
>>             var stringSocket = new WebSocket("ws://127.0.0.1:8888",
>> "Sstring");
>>
>>             var trigger = 1;
>>
>>             stringButton.onclick = function() {
>>
>>                 stringSocket.send("\"instr 3\n a1 oscils p4/2, p5 / 2, 0
>> \n out a1 \nendin\"");
>>                 kvarSocket.send(new Float64Array([trigger]));
>>                 trigger = !trigger;
>>             }
>>
>> On the Csound side you can receive like this:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac
>> </CsOptions>
>> <CsInstruments>
>> nchnls = 2
>> 0dbfs = 1
>> ksmps = 256
>> sr = 44100
>>
>> instr 1
>>
>> iport init 8888
>> kvarChanged init 0
>> ktrigger init 0
>>
>> kvar, Sstring websocket iport
>>
>> if kvarChanged != kvar then
>> kvarChanged = kvar
>> ktrigger = 1
>> Sscore sprintfk {{i 2 0 -1 %s}}, Sstring
>> endif
>>
>> scoreline Sscore, ktrigger
>> ktrigger = 0
>>
>> endin
>>
>> instr 2
>>
>> prints p4
>> Sstring = p4
>> ires compilestr Sstring
>> scoreline_i "i 3 0 3 .2 415"
>> turnoff
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 100
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Maybe you can repurpose this example to use OSC instead,
>> Cheers,
>> Ed
>>
>> On 17 Feb 2017, at 14:04, free coder <[hidden email]> wrote:
>>
>> Hi,
>>
>> I am experimenting with CSound live coding, running it in a terminal with
>> the option  "-L stdin".
>> It is cool, but s there a way to send live code via an OSC port and not
>> just type code in the terminal window ?
>> From what i understand now it is possible to live code from the terminal
>> window (it works !), but I would like to 'live code' from other environments
>> (processing, max, pd ...) sending OSC 'live code' messages.
>>
>> is this already possible ? how is it possible to listen to 'live coding'
>> on an OSC port ? (something live "-L oscport 9999" ?)
>>
>> (note that i am not talking about the existing OSC  possibilities  in a
>> .csd like initOSC etc ... as this is not live coding but parameter control
>> via OSC)
>>
>> many thanks if someone has any hints !
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
>
>
> --
> http://mysterybear.net
> https://soundcloud.com/mysterybear
> https://mysterybear.bandcamp.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
12
Loading...