Csound Csound-dev Csound-tekno Search About

Re: Using ties

Date1999-03-04 15:10
FromJean-Michel DARRMONT
SubjectRe: Using ties
Sergey Batov wrote:
> 
> Hope this is the thing you are looking for (sorry, I can't tell who sent
> this example.
> Is it possible to know who is the author ?)
> 

This is from David Kirsh but this one produces clics between the notes.
He sent me later another one wich I put in the previous message and it works fine.

> ; ============== tied notes.orc ========
> sr      = 44100
> kr      = 882
> ksmps   = 50
> nchnls  = 1
> 
> ; Demonstration of portamento between tied notes
> ; This technique could be applied to other parameters and to
> ; non-tied notes with straightforward changes.
> instr 5
>         inote   = cpspch(p4)  ; This note's pitch
> 
>         ; If this is not a tied note, then there's no previous
>         ; pitch to glide from, so set beginning pitch of
>         ; portamento to this note's pitch.  Then save this same
>         ; pitch in 'iprevpitch' so we can remember what pitch we
>         ; are coming from when we have a tied note.  We have to
>         ; save it both here and in the tied note case because if
>         ; we do it in a common place below, Csound complains about
>         ; iprevpitch being used before set.
>         tigoto  tieinit
> 
>         ; At this point we know we're not in a tied note.
>         ; Set beginning and previous pitches to the same thing.
>         ibegpitch       = inote
>         iprevpitch      = inote
>         goto            cont
> 
> tieinit:
>         ; We're in a tied note.
>         ; Set up beginning pitch for portamento to new pitch.
>         ; Beginning pitch is pitch of previous note that this one is
>         ; tied onto the end of.  Save current pitch in case another
>         ; note ties onto this one; then we'll be able to portamento
>         ; again to that new pitch.
>         ibegpitch       = iprevpitch
>         iprevpitch      = inote
> 
> cont:
>         ; Now set up a pitch envelope that moves from the beginning
>         ; pitch (as determined above) to this note's nominal pitch.
>         kpitchenv       linseg  ibegpitch, .9, inote, abs(p3), inote
> 
>         ; Generate a sound using the pitch envelope.  Notice the
>         ; last 'buzz' argument (-1), which causes phase
>         ; initialization to be skipped.  This is important to avoid
>         ; clicks on tied notes.  (This simple example clicks on
>         ; untied notes, though, because there's no amplitude
>         ; envelope.)
>         a1      buzz    10000, kpitchenv, 6, 1, -1
>         out     a1
> endin
> 
> ;=========== tied notes.sco ====================
> 
> ; A Little Test Music
> f1 0 1025 10 1
> ;
> 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
> e

-- 
Jean-Michel DARREMONT