| Hi all,
DirectCsound 2.801 is available. You can get the executable at the
following url:
http://web.tiscalinet.it/G-Maldonado/download.htm
This (minor upudate) version has implemented the new opcode 'cpuprc'
controlling realtime polyphony to avoid underruns:
cpuprc
cpuprc instrnum, ipercent
DESCRIPTION
Set the cpu processing-time percent usage of an instrument in order to
avoid buffer underrun in realtime
performances.
INITIALIZATION
instrnum - instrument number
ipercent - percent of cpu processing-time to assign
cpuprc is an opcode that enables a sort of polyphony theshold. The user
must set ipercent value for each
instrument he want to activate in realtime. Assumnig that the total
theorical processing time of the cpu of the
computer is 100%, this percent value can only be defined empirically,
because there are too many factors that
contribute to limit realtime polyphony in different computers. For
example if ipercent is set to 5% for instrument 1,
the maximum number of voices that can be allocated in realtime, can be
20 (as 5% X 20 = 100%). If the user
attempts to play a further note while the 20 previous notes are still
playing, Csound inhibits the allocation of that
note and will display the following warning message:
can't allocate last note because it exceeds 100% of cpu time
ipercent can be expressed also as a fractional value.
In order to avoid audio buffer underruns, it is suggested to set the
maximum number of voices a bit below the real
processing power of the computer, because sometimes an instrument can
require more processing time than
normal (for example, if the instrument contains an oscillator which
reads a table that doesn't fit in cache memory, it
will be slower than normal; also, any concurrent program which run in
multitasking, can subtract more processing
power in some cases, less power in other cases etc.)
At start, all instruments are set to a default value of ipercent = 0.0%
(i.e. zero processing time or rather infinite
cpu processing-speed). This setting is OK for deferred-time sessions.
All instances of cpuprc must be defined in the header section, not in
the instrument body.
example:
sr=44100
kr=441
ksmps=100
nchnls=2
cpuprc 1, 2.5 ;** set instr 1 to 2.5% of processor power,
i.e. maximum 40 voices (2.5% X 40 = 100%)
cpuprc 2, 33.333 ;** set instr 2 to 33.333% of processor power,
i.e. maximum 3 voices (33.333% X 3 = 100%)
instr 1
...body...
endin
instr 2
....body...
endin
--
Gabriel Maldonado
http://web.tiscalinet.it/G-Maldonado/home2.htm |