Csound Csound-dev Csound-tekno Search About

Re: Using ties

Date1999-03-04 15:05
FromJean-Michel DARRMONT
SubjectRe: Using ties
David Meckstroth wrote:
> 
> Would someone be kind and send me a short example (sco & orc) (or point me in
> a direction where I could find one) of how to use ties (tival, tigoto,
> fractional i #s).  Thank you in advance.  -David


I've asked this question few weeks ago and David Kirsh sent me these orc&sco:


;----- Ties orchestra with dclic ----------

sr      = 44100
kr      = 44100 ; as usual it sounds much better with kr=sr specially on attacks
ksmps   = 1
nchnls  = 1

instr 5
        inote   = cpspch(p4)  ; This note's pitch
        idur    = abs(p3)
        istied  tival

        tigoto  tieinit

        ibegpitch      = inote
        iprevpitch     = inote
        goto            cont

tieinit:
   
        ibegpitch       = iprevpitch
        iprevpitch      = inote

cont:
 
        kpitchenv       linseg  ibegpitch, .9, inote, abs(p3), inote

        ; If this is a tied note, then declick envelope amplitude
        ; starts out at '1' (i.e., same as ending value of note
        ; we're tying onto).  Otherwise, it starts at '0'.
        ibegdclic = (istied == 1 ? 1 : 0)

        ; If this note is being held (in anticipation of being tied
        ; onto), then declick amplitude ends at '1' (so it
        ; matches the beginning declick amplitude of the tied-on note).
        ; Otherwise, amplitude ends at '0'.
        ienddclic = (p3 < 0 ? 1 : 0)

        kdclic            linseg  ibegdclic, 0.1, 1, abs(p3)-0.2, 1, 0.1, ienddclic
                        
        a1      buzz    10000, kpitchenv, 6, 1, -1
        out     a1 * kdclic
endin 


;----- Ties score ----------
f1 0 32769 10 1
;p1 decimal allows polyphony.
;
i5.1    0.0     -2      7.00
i5.2    0.0     -2      7.04
i5.1    2.0     -2      7.07
i5.2    2.0     -2      7.11
i5.1    4.0     -2      6.07
i5.2    4.0     -2      7.00
i5.1    6.0     2       7.00
i5.2    6.0     2       6.00
i5      8.1             .8              7.00
i5      9.1             .8              7.04
i5     10.1             .8              7.07
i5     11.1             .8              7.00
e

-- 
Jean-Michel DARREMONT