Csound Csound-dev Csound-tekno Search About

[Csnd] Signal flow graph opcodes and instrument instances

Date2011-11-01 02:51
FromForrest Cahoon
Subject[Csnd] Signal flow graph opcodes and instrument instances
What I want to do now is perhaps best illustrated by a simple csd:

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 1

nchnls = 2


connect "Sine1", "out", "Panner1", "in"

connect "Sine2", "out", "Panner2", "in"

alwayson "Panner1", -0.8

alwayson "Panner2", 0.8


giSine ftgen 0, 0, 1024, 10, 1


instr Sine1

kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0

aOut oscil p4, p5, giSine

outleta "out", aOut * kEnv

endin


instr Sine2

kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0

aOut oscil p4, p5, giSine

outleta "out", aOut * kEnv

endin


instr Panner1

aIn inleta "in"

iRight = (p4 + 1)/2

iLeft = 1.0 - iRight

outs iLeft * aIn, iRight * aIn

endin


instr Panner2

aIn inleta "in"

iRight = (p4 + 1)/2

iLeft = 1.0 - iRight

outs iLeft * aIn, iRight * aIn

endin


</CsInstruments>

<CsScore>

i "Sine1" 0 5 32000 400

i "Sine2" 1 5 32000 500

</CsScore>

</CsoundSynthesizer>


Here I have duplicated both instruments so I could give them different names and use them with the signal flow graph opcodes. I want to use different instances of the instruments instead of copying, of course, but I can't figure out how to get that to work with the named instruments the signal flow graph opcodes seem to require.

Am I (as usual) missing something obvious? Is there another way to do what I'm trying to do here?

Forrest

Date2011-11-01 11:31
FromSteven Yi
SubjectRe: [Csnd] Signal flow graph opcodes and instrument instances
Hi Forrest,

That is a limitation of the design of the Signal Flow Graph opcodes,
as it connects definitions of instruments and not instances of them.
That is not to say they can not be useful though.  I wrote an article
for the Csound Journal that demonstrates using the signal flow graph
opcodes together with a mixer instrument:

http://www.csounds.com/journal/issue13/emulatingMidiBasedStudios.html

I use global sigs myself in blue (well, blue generates it, for
efficiency, from its mixer system).  The key part of the article and
the technique though is to use UDO's to define effects processors and
to use a mixer instrument to connect everything up together.  This
allows, say, defining a ping pong delay or panner UDO, then using
multiple instances of those UDO's within the mixer.

Perhaps this might be a technique to consider.

Thanks!
steven

On Tue, Nov 1, 2011 at 2:51 AM, Forrest Cahoon  wrote:
> What I want to do now is perhaps best illustrated by a simple csd:
>
> 
>
> 
>
> 
>
> 
>
> sr = 44100
>
> ksmps = 1
>
> nchnls = 2
>
> connect "Sine1", "out", "Panner1", "in"
>
> connect "Sine2", "out", "Panner2", "in"
>
> alwayson "Panner1", -0.8
>
> alwayson "Panner2", 0.8
>
> giSine ftgen 0, 0, 1024, 10, 1
>
> instr Sine1
>
> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>
> aOut oscil p4, p5, giSine
>
> outleta "out", aOut * kEnv
>
> endin
>
> instr Sine2
>
> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>
> aOut oscil p4, p5, giSine
>
> outleta "out", aOut * kEnv
>
> endin
>
> instr Panner1
>
> aIn inleta "in"
>
> iRight = (p4 + 1)/2
>
> iLeft = 1.0 - iRight
>
> outs iLeft * aIn, iRight * aIn
>
> endin
>
> instr Panner2
>
> aIn inleta "in"
>
> iRight = (p4 + 1)/2
>
> iLeft = 1.0 - iRight
>
> outs iLeft * aIn, iRight * aIn
>
> endin
>
> 
>
> 
>
> i "Sine1" 0 5 32000 400
>
> i "Sine2" 1 5 32000 500
>
> 
>
> 
>
> Here I have duplicated both instruments so I could give them different names
> and use them with the signal flow graph opcodes. I want to use different
> instances of the instruments instead of copying, of course, but I can't
> figure out how to get that to work with the named instruments the signal
> flow graph opcodes seem to require.
>
> Am I (as usual) missing something obvious? Is there another way to do what
> I'm trying to do here?
>
> Forrest
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-11-01 12:20
FromMichael Gogins
SubjectRe: [Csnd] Signal flow graph opcodes and instrument instances
I have added to the signal flow graph opcodes some new opcodes
designed to connect instances, not definitions, of instruments. I have
not tested them yet but they are in GIT. The idea is the score will
pass a name to an instrument instance to identify it, and the
corresponding signal can be retrieved in the signal flow graph sink
using the same name.

Regards,
Mike

On Tue, Nov 1, 2011 at 7:31 AM, Steven Yi  wrote:
> Hi Forrest,
>
> That is a limitation of the design of the Signal Flow Graph opcodes,
> as it connects definitions of instruments and not instances of them.
> That is not to say they can not be useful though.  I wrote an article
> for the Csound Journal that demonstrates using the signal flow graph
> opcodes together with a mixer instrument:
>
> http://www.csounds.com/journal/issue13/emulatingMidiBasedStudios.html
>
> I use global sigs myself in blue (well, blue generates it, for
> efficiency, from its mixer system).  The key part of the article and
> the technique though is to use UDO's to define effects processors and
> to use a mixer instrument to connect everything up together.  This
> allows, say, defining a ping pong delay or panner UDO, then using
> multiple instances of those UDO's within the mixer.
>
> Perhaps this might be a technique to consider.
>
> Thanks!
> steven
>
> On Tue, Nov 1, 2011 at 2:51 AM, Forrest Cahoon  wrote:
>> What I want to do now is perhaps best illustrated by a simple csd:
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> sr = 44100
>>
>> ksmps = 1
>>
>> nchnls = 2
>>
>> connect "Sine1", "out", "Panner1", "in"
>>
>> connect "Sine2", "out", "Panner2", "in"
>>
>> alwayson "Panner1", -0.8
>>
>> alwayson "Panner2", 0.8
>>
>> giSine ftgen 0, 0, 1024, 10, 1
>>
>> instr Sine1
>>
>> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>>
>> aOut oscil p4, p5, giSine
>>
>> outleta "out", aOut * kEnv
>>
>> endin
>>
>> instr Sine2
>>
>> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>>
>> aOut oscil p4, p5, giSine
>>
>> outleta "out", aOut * kEnv
>>
>> endin
>>
>> instr Panner1
>>
>> aIn inleta "in"
>>
>> iRight = (p4 + 1)/2
>>
>> iLeft = 1.0 - iRight
>>
>> outs iLeft * aIn, iRight * aIn
>>
>> endin
>>
>> instr Panner2
>>
>> aIn inleta "in"
>>
>> iRight = (p4 + 1)/2
>>
>> iLeft = 1.0 - iRight
>>
>> outs iLeft * aIn, iRight * aIn
>>
>> endin
>>
>> 
>>
>> 
>>
>> i "Sine1" 0 5 32000 400
>>
>> i "Sine2" 1 5 32000 500
>>
>> 
>>
>> 
>>
>> Here I have duplicated both instruments so I could give them different names
>> and use them with the signal flow graph opcodes. I want to use different
>> instances of the instruments instead of copying, of course, but I can't
>> figure out how to get that to work with the named instruments the signal
>> flow graph opcodes seem to require.
>>
>> Am I (as usual) missing something obvious? Is there another way to do what
>> I'm trying to do here?
>>
>> Forrest
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-02 00:49
Fromthorin kerr
SubjectRe: [Csnd] Signal flow graph opcodes and instrument instances
I thought for a moment you could use multiple names for your instruments. i.e.
instr Sine1, Sine2
...

and

instr Panner1, Panner2
...


but.... actually trying this out using the connect opcodes, and it doesn't seem to work. No error message... and there is sound... but the example doesn't pan as expected. (interestingly, swapping the names - instr Sine2, Sine1, produces no sound at all)

Thorin






On Tue, Nov 1, 2011 at 10:20 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
I have added to the signal flow graph opcodes some new opcodes
designed to connect instances, not definitions, of instruments. I have
not tested them yet but they are in GIT. The idea is the score will
pass a name to an instrument instance to identify it, and the
corresponding signal can be retrieved in the signal flow graph sink
using the same name.

Regards,
Mike

On Tue, Nov 1, 2011 at 7:31 AM, Steven Yi <stevenyi@gmail.com> wrote:
> Hi Forrest,
>
> That is a limitation of the design of the Signal Flow Graph opcodes,
> as it connects definitions of instruments and not instances of them.
> That is not to say they can not be useful though.  I wrote an article
> for the Csound Journal that demonstrates using the signal flow graph
> opcodes together with a mixer instrument:
>
> http://www.csounds.com/journal/issue13/emulatingMidiBasedStudios.html
>
> I use global sigs myself in blue (well, blue generates it, for
> efficiency, from its mixer system).  The key part of the article and
> the technique though is to use UDO's to define effects processors and
> to use a mixer instrument to connect everything up together.  This
> allows, say, defining a ping pong delay or panner UDO, then using
> multiple instances of those UDO's within the mixer.
>
> Perhaps this might be a technique to consider.
>
> Thanks!
> steven
>
> On Tue, Nov 1, 2011 at 2:51 AM, Forrest Cahoon <forrest.cahoon@gmail.com> wrote:
>> What I want to do now is perhaps best illustrated by a simple csd:
>>
>> <CsoundSynthesizer>
>>
>> <CsOptions>
>>
>> </CsOptions>
>>
>> <CsInstruments>
>>
>> sr = 44100
>>
>> ksmps = 1
>>
>> nchnls = 2
>>
>> connect "Sine1", "out", "Panner1", "in"
>>
>> connect "Sine2", "out", "Panner2", "in"
>>
>> alwayson "Panner1", -0.8
>>
>> alwayson "Panner2", 0.8
>>
>> giSine ftgen 0, 0, 1024, 10, 1
>>
>> instr Sine1
>>
>> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>>
>> aOut oscil p4, p5, giSine
>>
>> outleta "out", aOut * kEnv
>>
>> endin
>>
>> instr Sine2
>>
>> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>>
>> aOut oscil p4, p5, giSine
>>
>> outleta "out", aOut * kEnv
>>
>> endin
>>
>> instr Panner1
>>
>> aIn inleta "in"
>>
>> iRight = (p4 + 1)/2
>>
>> iLeft = 1.0 - iRight
>>
>> outs iLeft * aIn, iRight * aIn
>>
>> endin
>>
>> instr Panner2
>>
>> aIn inleta "in"
>>
>> iRight = (p4 + 1)/2
>>
>> iLeft = 1.0 - iRight
>>
>> outs iLeft * aIn, iRight * aIn
>>
>> endin
>>
>> </CsInstruments>
>>
>> <CsScore>
>>
>> i "Sine1" 0 5 32000 400
>>
>> i "Sine2" 1 5 32000 500
>>
>> </CsScore>
>>
>> </CsoundSynthesizer>
>>
>> Here I have duplicated both instruments so I could give them different names
>> and use them with the signal flow graph opcodes. I want to use different
>> instances of the instruments instead of copying, of course, but I can't
>> figure out how to get that to work with the named instruments the signal
>> flow graph opcodes seem to require.
>>
>> Am I (as usual) missing something obvious? Is there another way to do what
>> I'm trying to do here?
>>
>> Forrest
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2011-11-02 03:29
FromForrest Cahoon
SubjectRe: [Csnd] Signal flow graph opcodes and instrument instances
I just managed to build from GIT; I'd love to see a sample csd file showing how to use this new functionality. Maybe you can modify my original one? I'll test it for you :-)

Forrest

On Tue, Nov 1, 2011 at 7:20 AM, Michael Gogins <michael.gogins@gmail.com> wrote:
I have added to the signal flow graph opcodes some new opcodes
designed to connect instances, not definitions, of instruments. I have
not tested them yet but they are in GIT. The idea is the score will
pass a name to an instrument instance to identify it, and the
corresponding signal can be retrieved in the signal flow graph sink
using the same name.

Regards,
Mike

On Tue, Nov 1, 2011 at 7:31 AM, Steven Yi <stevenyi@gmail.com> wrote:
> Hi Forrest,
>
> That is a limitation of the design of the Signal Flow Graph opcodes,
> as it connects definitions of instruments and not instances of them.
> That is not to say they can not be useful though.  I wrote an article
> for the Csound Journal that demonstrates using the signal flow graph
> opcodes together with a mixer instrument:
>
> http://www.csounds.com/journal/issue13/emulatingMidiBasedStudios.html
>
> I use global sigs myself in blue (well, blue generates it, for
> efficiency, from its mixer system).  The key part of the article and
> the technique though is to use UDO's to define effects processors and
> to use a mixer instrument to connect everything up together.  This
> allows, say, defining a ping pong delay or panner UDO, then using
> multiple instances of those UDO's within the mixer.
>
> Perhaps this might be a technique to consider.
>
> Thanks!
> steven
>
> On Tue, Nov 1, 2011 at 2:51 AM, Forrest Cahoon <forrest.cahoon@gmail.com> wrote:
>> What I want to do now is perhaps best illustrated by a simple csd:
>>
>> <CsoundSynthesizer>
>>
>> <CsOptions>
>>
>> </CsOptions>
>>
>> <CsInstruments>
>>
>> sr = 44100
>>
>> ksmps = 1
>>
>> nchnls = 2
>>
>> connect "Sine1", "out", "Panner1", "in"
>>
>> connect "Sine2", "out", "Panner2", "in"
>>
>> alwayson "Panner1", -0.8
>>
>> alwayson "Panner2", 0.8
>>
>> giSine ftgen 0, 0, 1024, 10, 1
>>
>> instr Sine1
>>
>> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>>
>> aOut oscil p4, p5, giSine
>>
>> outleta "out", aOut * kEnv
>>
>> endin
>>
>> instr Sine2
>>
>> kEnv linseg 0, p3/2, 1, p3/2, 0, 0.1, 0
>>
>> aOut oscil p4, p5, giSine
>>
>> outleta "out", aOut * kEnv
>>
>> endin
>>
>> instr Panner1
>>
>> aIn inleta "in"
>>
>> iRight = (p4 + 1)/2
>>
>> iLeft = 1.0 - iRight
>>
>> outs iLeft * aIn, iRight * aIn
>>
>> endin
>>
>> instr Panner2
>>
>> aIn inleta "in"
>>
>> iRight = (p4 + 1)/2
>>
>> iLeft = 1.0 - iRight
>>
>> outs iLeft * aIn, iRight * aIn
>>
>> endin
>>
>> </CsInstruments>
>>
>> <CsScore>
>>
>> i "Sine1" 0 5 32000 400
>>
>> i "Sine2" 1 5 32000 500
>>
>> </CsScore>
>>
>> </CsoundSynthesizer>
>>
>> Here I have duplicated both instruments so I could give them different names
>> and use them with the signal flow graph opcodes. I want to use different
>> instances of the instruments instead of copying, of course, but I can't
>> figure out how to get that to work with the named instruments the signal
>> flow graph opcodes seem to require.
>>
>> Am I (as usual) missing something obvious? Is there another way to do what
>> I'm trying to do here?
>>
>> Forrest
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"