Csound Csound-dev Csound-tekno Search About

[Csnd] Re: A group of identical instruments

Date2009-04-04 05:34
From"BERMAN L.I."
Subject[Csnd] Re: A group of identical instruments
[Csnd] Re: A group of identical instruments
> The real question I suppose is what are you trying to accomplish
> by creating 20 identical instruments and rotating through them in
> the score that cannot be accomplished with a single instrument?
I'm using the pluck opcode to create a harp-like instrument, in which already-struck strings can keep resonating while another is plucked. If I reuse the same instrument, this cannot be done, to my knowledge. In fact, in a score excerpt like the following, the second attack doesn't always sound:
 
  i 1  0  10 ...
  i 1  3  10 ...
 
So I need a bank of instruments, each representing one string.
 
Well, I guess I could have one instrument with a big if statement and a lot of pluck opcodes. I haven't tried that. Even if it works, it's inelegant. And I'm not convinced it would work.
 
Am I on track here?
 
    Lewis Berman
 

Date2009-04-04 13:05
Fromvictor
Subject[Csnd] Re: Re: A group of identical instruments
[Csnd] Re: A group of identical instruments
Overlapping notes should be no problem (see my earlier example). Perhaps
there is something wrong with your code?
 
Victor
----- Original Message -----
Sent: Saturday, April 04, 2009 5:34 AM
Subject: [Csnd] Re: A group of identical instruments

> The real question I suppose is what are you trying to accomplish
> by creating 20 identical instruments and rotating through them in
> the score that cannot be accomplished with a single instrument?
I'm using the pluck opcode to create a harp-like instrument, in which already-struck strings can keep resonating while another is plucked. If I reuse the same instrument, this cannot be done, to my knowledge. In fact, in a score excerpt like the following, the second attack doesn't always sound:
 
  i 1  0  10 ...
  i 1  3  10 ...
 
So I need a bank of instruments, each representing one string.
 
Well, I guess I could have one instrument with a big if statement and a lot of pluck opcodes. I haven't tried that. Even if it works, it's inelegant. And I'm not convinced it would work.
 
Am I on track here?
 
    Lewis Berman
 

Date2009-04-04 13:18
FromDave Seidel
Subject[Csnd] Re: Re: Re: A group of identical instruments
Yes, I frequently use many simultaneous instances of a single 
instrument, it's never been a problem.

- Dave

victor wrote:
> Overlapping notes should be no problem (see my earlier example). Perhaps
> there is something wrong with your code?
>  
> Victor
> 
>     ----- Original Message -----
>     *From:* BERMAN L.I. 
>     *To:* csound@lists.bath.ac.uk 
>     *Sent:* Saturday, April 04, 2009 5:34 AM
>     *Subject:* [Csnd] Re: A group of identical instruments
> 
>      > The real question I suppose is what are you trying to accomplish
>      > by creating 20 identical instruments and rotating through them in
>      > the score that cannot be accomplished with a single instrument?
>     I'm using the pluck opcode to create a harp-like instrument, in
>     which already-struck strings can keep resonating while another is
>     plucked. If I reuse the same instrument, this cannot be done, to my
>     knowledge. In fact, in a score excerpt like the following, the
>     second attack doesn't always sound:
>      
>       i 1  0  10 ...
>       i 1  3  10 ...
>      
>     So I need a bank of instruments, each representing one string.
>      
>     Well, I guess I could have one instrument with a big if statement
>     and a lot of pluck opcodes. I haven't tried that. Even if it works,
>     it's inelegant. And I'm not convinced it would work.
>      
>     Am I on track here?
>      
>         Lewis Berman
>      

-- 
~DaveSeidel = [
   http://mysterybear.net,
   http://daveseidel.tumblr.com,
   http://twitter.com/DaveSeidel
];


Date2009-04-04 18:23
FromAnthony Kozar
Subject[Csnd] Re: A group of identical instruments
Lewis, 

As everyone has said, overlapping notes from the same instrument are
certainly possible.  Csound creates as many instances of an instrument as
are necessary to play all currently sounding notes.

If, on the other hand, what you want is a note instance for each string that
stays "on" but can receive new attacks (be "replucked"), then you have to do
a little more work.  The tricky part is getting Csound to reuse the same
note instance for the "same string".  You should only need one instrument
for this, but you will probably want to use two features of Csound that are
easy to overlook.

First, you can reuse a specific instrument instance by using fractional p1
values like this

i 1.01  0  10 ...   ; string 1
i 1.02  2  10 ...   ; string 2
i 1.01  3  10 ...   ; string 1 replucked
i 1.02  5  10 ...   ; string 2 replucked

Second, you can specify a negative number for p3 (duration) which causes a
note to stay on until otherwise cancelled.

i 1.01  0  -10 ...   ; string 1 will sound "forever"
i 1.02  2  -10 ...   ; string 2 will sound "forever"
i 1.01  3    4 ...   ; string 1 replucked; will stop in 4 seconds now
i 1.02  5    6 ...   ; string 2 replucked; will stop in 6 seconds

Instruments that allow for multiple reattacks in this way (often called tied
notes in Csound documentation), must be carefully written to avoid
discontinuities in the sound.  For more information, see this discussion in
the manual:  and check out Chapter 7
of The Csound Book.

Anthony Kozar
mailing-lists-1001 AT anthonykozar DOT net
http://anthonykozar.net/

BERMAN L.I. wrote on 4/4/09 12:34 AM:

>> The real question I suppose is what are you trying to accomplish
>> by creating 20 identical instruments and rotating through them in
>> the score that cannot be accomplished with a single instrument?
> 
> I'm using the pluck opcode to create a harp-like instrument, in which
> already-struck strings can keep resonating while another is plucked. If I
> reuse the same instrument, this cannot be done, to my knowledge. In fact, in a
> score excerpt like the following, the second attack doesn't always sound:
> 
> i 1  0  10 ...
> i 1  3  10 ...
> 
> So I need a bank of instruments, each representing one string.
> 
> Well, I guess I could have one instrument with a big if statement and a lot of
> pluck opcodes. I haven't tried that. Even if it works, it's inelegant. And I'm
> not convinced it would work.


Date2009-04-04 18:24
FromAndres Cabrera
Subject[Csnd] Re: Re: A group of identical instruments
Hi,

>From what I understand, what you want is to simulate a harp, where if
a string is plucked, the previous note sounding on that string is
stopped.
The solution is not to have many instruments for each string, but a
mechanism for turning off a string when it is pucked, since intruments
in Csound are aways polyphonic.

Cheers,
Andrés

On Fri, Apr 3, 2009 at 11:34 PM, BERMAN L.I.  wrote:
>> The real question I suppose is what are you trying to accomplish
>> by creating 20 identical instruments and rotating through them in
>> the score that cannot be accomplished with a single instrument?
> I'm using the pluck opcode to create a harp-like instrument, in which
> already-struck strings can keep resonating while another is plucked. If I
> reuse the same instrument, this cannot be done, to my knowledge. In fact, in
> a score excerpt like the following, the second attack doesn't always sound:
>
>   i 1  0  10 ...
>   i 1  3  10 ...
>
> So I need a bank of instruments, each representing one string.
>
> Well, I guess I could have one instrument with a big if statement and a lot
> of pluck opcodes. I haven't tried that. Even if it works, it's inelegant.
> And I'm not convinced it would work.
>
> Am I on track here?
>
>     Lewis Berman
>



-- 


Andrés