| Unless I misunderstand you, all of these can be implemented as
instruments. For crescendo-diminuendo, all you need to do is create a
phrase envelope in an instrument that runs for the length of the phrase
to which you'd like to apply the cresc./dim, and output that envelope
into a global variable, zak, or some other method of inter-instrument
communication. Then the sound-producing instrument just reads the value
and multiplies by it to get the final value. It's almost like a reverb
in reverse. Instead of lots of notes being combined into one
long-running instrument, a single long-running instrument creates input
that's used to generate lots of notes.
Rubato could be handled in a similar fashion, by having a small delay
before the onset of a note. The delay value could be controlled by a
long-running envelope as above. In principle it could work, although I
think it would depend on exactly what you're doing. I think it would be
easier to use schedwhen or schedkwhen to trigger notes, though.
One standard way to create portamento is outlined at
http://www.thumbuki.com/csound/articles/east/portamento.html, although
that may be more work in the score than what you're looking for. You
can also use something like this instrument, by Russell Pinkston (from
http://ems.music.utexas.edu/dwnld/orc/portrfp.orc)
instr 1
iamp = p4
ioct = octpch(p5)
irate = p6
if (p7 == 0) igoto continue
iprev = octpch(p7) ;optionally, specify previous pitch
continue:
idur = abs(ioct-iprev)/irate ;compute duration of portamento
koct init iprev ;koct starts on previous note
if (ioct == iprev) goto audio ;if no change, skip over...
koct linseg iprev,idur,ioct,1,ioct
audio:
asig oscili iamp,cpsoct(koct),1 ;function 1 has the waveshape
asig linen asig,.05,p3,.1
out asig
iprev = ioct ;remember previous pitch
endin
Here p7 specifies the previous pitch, but if it's omitted (yielding a
value of 0), it will remember the previous value to create a smooth
portamento. I've never seen this documented, but it appears to be (or
at least used to be) a well-known feature.
Using this instrument requires some care since all notes to be played
portamento must use the same instance. If you want to have multiple
lines, partial instrument numbers (i.e. 1.1, 1.2, etc.) are necessary.
Also, the notes of a single line cannot overlap. Finally, the first
note for each instance must specify a value in p7, and then the next
must specify a 0 before you can omit p7 (because score values carry).
John Lato
Robert or Gretchen Foose wrote:
> Speaking of limits, one of the things I'd like to see added to csound is
> some way of adding 'rubato' instruments, 'crescendo-decrescendo'
> instruments, 'portamento' instruments, etc. to the available ugens. I
> know that these effects can be created within the note-for-note scores,
> but it would be much nicer if they could be applied to orcs like reverb
> or delay or panning are. That may require a separate pass during the
> compilation, I guess. I have noted that several works submitted to the
> website have included remarks about taking the csound output soundfile
> and tweaking it in other programs, like audacity, for instance. It just
> seems like it would be nice to do it all in csound. So, if it can be
> done, that'd be nice. It would, I think, help put csound on solider
> ground as a composer's tool for any type of music.
> Bob Foose
|