Csound Csound-dev Csound-tekno Search About

Re: request for new opcode: rgoto

Date1998-11-07 17:02
FromGabriel Maldonado
SubjectRe: request for new opcode: rgoto
It doesn't replace linenr: it is possible to include it together with release/xtratim
pair. The total length of the note will be the most large among the extension related
opcodes. However I suggest you to use release/xtratim opcodes only in the cases you have
to do some strange things during the release phase. If you only need a simple exponential
release to 0, I suggest to use linenr & company.

Gab


Yair Kass wrote:
> 
> If  i could step in the thread for a moment:
> Does the use of these opcodes "replace" linenr and other release-related opcodes ?
> Is this THE proper (efficient) way to do that sort of thing ?
> 
> Thnx,
>       yair
> 
> Gabriel Maldonado wrote:
> 
> > Look at release/xtratim opcodes already implemented in public version (in particular the
> > example):
> >
> >         xtratim  iextradur
> > kflag   release
> >
> > DESCRIPTION
> > Extend the duration of realtime generated events and handle their extra life.
> >
> > INITIALIZATION
> >
> > iextradur - additional duration of current instrument instance
> >
> > PERFORMANCE
> >
> > xtratim exetends current MIDI-activated note duration of iextradur seconds
> > after the corresponding note-off message has deactivated current note itself.
> > This opcode has no output arguments.
> > release outputs current note state. If current note is in the release stage
> > (i.e. if its duration has been exetended with xtratim opcode and if it has
> > only just deactivated), kflag output argument is set to 1, else (in sustain
> > stage of current note) is set to 0.
> >
> > These two opcodes are useful for implementing complex release-oriented envelopes.
> >
> > Example:
> >         instr   1       ;allows complex ADSR envelope with MIDI events
> > inum    notnum
> > icps    cpsmidi
> > iamp    ampmidi 4000
> > ;
> > ;############## complex envelope section ##############
> >         xtratim 1       ;extra-time, i.e. release dur
> > krel    init    0
> > krel    release         ;outputs release-stage flag (0 or 1 values)
> > if      (krel > .5) kgoto  rel  ;if in relase-stage goto relase section
> > ;
> > ;************ attack and sustain section ***********
> > kmp1    linseg  0,.03,1,.05,1,.07,0,.08,.5,4,1,50,1
> > kmp     =       kmp1*iamp
> >         kgoto   done
> > ;
> > ;************ release section **********************
> > rel:
> > kmp2    linseg  1,.3,.2,.7,0
> > kmp     = kmp1*kmp2*iamp
> > done:
> > ;###################################################
> > ;
> > a1      oscili  kmp, icps, 1
> >         out     a1
> >         endin
> >
> > Aaron Isaksen wrote:
> > >
> > > I have asked Prof. Vercoe to add an opcode to extended csound that would
> > > perform a conditional goto only at the release of a note.  I'm planning on
> > > using this for realtime with midi, where the length of a note is not known
> > > (no p3).
> > >
> > > I don't think there is a way to do this using an if statement.
> > >
> > > If the community thinks this is a useful opcode, could someone add it to
> > > the public csound distribution?
> > >
> > > Thank you,
> > >
> > > -Aaron Isaksen
> >
> > --
> > Gabriel Maldonado
> >
> > http://www.agora.stm.it/G.Maldonado/home2.htm

-- 
Gabriel Maldonado