| Better still, use Michael Goggins midi flags. They let you send midi
messages to p-fields so you don't even have to use midi opcodes. They
basically make most Csound instruments midi-able(??)... Here's an
example, pay attention to the CsOptions. I haven't checked this as my
keyboard is tucked under a whole load of assignments that I'm afraid
to go near..
-odevaudio1 -b10 --midi-key-cps=4 --midi-velocity-amp=p5 -M1 -m0d
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2
instr 1
kamp expsegr p5, 7, 0.001, 1, 0.0001
a1 oscil kamp, p4, 1
outs a1, a1
endin
instr 3
;dummy instrument..
endin
f1 0 1024 10 1 0 .25 0 .17
i3 0 600 ;let dummy instrument run so performance doesn't end
2009/3/31 Stefan Thomas :
> Dear Vivtor,
> thanks for Your answer. I think I understood it now. It helped me,
> that I used varibles. Maybee this can help other greenhorns too:
>
> instr 1
> icps cpsmidi
> iamp ampmidi 10000
>
> itransient= 0.1
> idecay = 1
>
> ;kenv expsegr 0.1, itransient, 1, 0.1, 0.1 ; sounds like a flute
> kenv expsegr 0.1, itransient*0.01, 1, ideacy*20, 0.001, 0.1, 0.1 ;
> sounds like a piano
> ; wie laut ist es, wenn die Note beendet wird
> ;kenv expsegr 0.1, itrans*10, 1, idecay* 0.001, 0.1, 0.1 ; opposite of a piano
> a1 oscil kenv*iamp, icps, 1
> out a1
> endin
>
> 2009/3/31 victor :
>> Don't use p3 with MIDI. That's where you are going wrong.
>>
>> use something like this
>>
>> kenv expsegr 0.01,0.1, 1, 2,1, 0.1,0.01
>>
>> Victor
>>
>> ----- Original Message ----- From: "Stefan Thomas"
>>
>> To:
>> Sent: Tuesday, March 31, 2009 10:16 PM
>> Subject: [Csnd] Re: Re: don't understand expsegr
>>
>>
>> Dear Rory,
>> thanks for Your help, I think I understand it better now.
>> I now tried to make a simple instrument, that I could play live with
>> midi, with an expsegr envelope, but unfortunately I can't hear
>> anything, also I can see the midi messages on the terminal window. I
>> don't know, what could be wrong with this snippet:
>>
>>
>> -odevaudio -M1 -b400
>> ;-odac -iadc -d ;;;RT audio I/O
>>
>>
>>
>> sr = 44100
>> kr = 4410
>> ksmps = 10
>> nchnls = 1
>> massign 0, 1 ; assign all midi events to instr 1,
>> pgmassign 0, 1 ; also all program changes
>> instr 1
>> icps cpsmidi
>> iamp ampmidi 1000
>>
>>
>> kenv expsegr 0.01, p3/2, 1, p3/2, 0.01, 1, 1
>>
>> kamp = kenv * 30000
>> a1 oscil kamp, icps, 1
>> out a1
>> endin
>>
>>
>>
>> ; Table #1, a sine wave.
>> f 1 0 16384 10 1
>> i 1 0 3600
>>
>>
>>
>>
>>
>>
>> 2009/3/31 Rory Walsh :
>>>
>>> You only need to use expsegr if you want an extra release segment to
>>> continue after the instrument has stopped. Generally the 'r' family of
>>> opcodes are used for midi driven instrument. The first values is the
>>> starting point of the envelope. The next one is a time value.
>>> Specifically the time it will take to get to 1 in your case. Then you
>>> have another time value, i.e., the length of time it will take to get
>>> to 0.01. The last two number specify the duration of the release and
>>> the value it will eventually get to at the end of the release. If
>>> you're not using a midi keyboard or something like that to trigger
>>> your instrument I suggest using plain old expseg instead which doesn't
>>> need those last two values.
>>>
>>> Rory.
>>>
>>>
>>>
>>>
>>>
>>> 2009/3/31 Stefan Thomas :
>>>>
>>>> Dear community,
>>>> I have question concerning the expesgr.
>>>> I understood, that it makes exponential curves that I can maybee use
>>>> for envelopes or something like that.
>>>> But I don't understand what the numbers exactly do in this example:
>>>> ; Use an amplitude envelope with second-long release.
>>>> kenv expsegr 0.01, p3/2, 1, p3/2, 0.01, 1, 1
>>>> Is 0.001 the attack-time?
>>>> what are the other numbers for, especially the last two number ones.
>>>> I tried to understand, but it is too complicated for me, alt least at
>>>> the moment.
>>>> I would like to use the expsgr for partials, rising and falling at
>>>> different times.
>>>>
>>>>
>>>> Send bugs reports to this list.
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>>> csound"
>>>>
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"=
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
|