| guto wrote:
>
> irate nsamp iftab
> but the correct should be:
> nsamp(iftab)
Ah, thanks. Got it.
re
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20300;
2 Aug 99 0:18 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
id 11B4s0-0005tB-00
for jpff@maths.bath.ac.uk; Mon, 2 Aug 1999 00:18:20 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (AAA12535); Mon, 2 Aug 1999 00:15:55 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 2 Aug 1999 00:15:45 +0100
Received: from eos.arc.nasa.gov [128.102.118.20] by hermes via ESMTP (AAA01719); Mon, 2 Aug 1999 00:15:44 +0100 (BST)
Received: (from jims@localhost)
by eos.arc.nasa.gov (8.8.4/8.8.4)
id QAA08497; Sun, 1 Aug 1999 16:15:40 -0700
Date: Sun, 1 Aug 1999 16:15:40 -0700
From: Jim Stevenson
Message-Id: <199908012315.QAA08497@eos.arc.nasa.gov>
To: craig-routt@usa.net, csound@maths.ex.ac.uk
Subject: Re: [Re: pluck wierdness]
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Did anyone explain the looping postings?
If you quote me, please put your comments first.
I have already listened to mine.
Thanks.
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa21771;
2 Aug 99 14:36 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
id 11BIG2-0006Ca-00
for jpff@maths.bath.ac.uk; Mon, 2 Aug 1999 14:36:02 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (OAA17223); Mon, 2 Aug 1999 14:32:16 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 2 Aug 1999 14:32:06 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (OAA08355); Mon, 2 Aug 1999 14:32:05 +0100 (BST)
Received: from [138.38.97.36] (helo=maths.Bath.AC.UK ident=mmdf)
by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
id 11BHDH-0008SX-00
for csound@maths.ex.ac.uk; Mon, 2 Aug 1999 13:29:07 +0100
From: jpff@maths.bath.ac.uk
To: csound@maths.ex.ac.uk
Subject: [mpoirier@virtu.sar.usf.edu: Extending pools]
Date: Mon, 2 Aug 99 14:31:58 BST
Source-Info: From (or Sender) name not authenticated.
Message-Id:
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
------- Start of forwarded message -------
Date: Mon, 02 Aug 1999 08:55:55 -0400
From: Marc 3 Poirier
Subject: Extending pools
Whenever I render this particular instrument of mine in Csound, I get this
message to start with:
orchname: OrcSco\pvflip_pas.orc
scorename: OrcSco\pvflip_pas.sco
sorting score ...
... done
orch compiler:
9334 lines read
instr 1
Extending Local pool to 800
Extending Local pool to 1200
Extending Local pool to 1600
Extending Local pool to 2000
Extending Local pool to 2400
Extending Local pool to 2800
Extending Local pool to 3200
Extending Local pool to 3600
Extending Local pool to 4000
Extending Local pool to 4400
Extending Local pool to 4800
Extending Local pool to 5200
Extending Local pool to 5600
Extending Local pool to 6000
Extending Local pool to 6400
Extending Local pool to 6800
extending Floating pool to 800
Extending Local pool to 7200
Extending Local pool to 7600
Extending Local pool to 8000
Extending Local pool to 8400
Extending Local pool to 8800
Extending Local pool to 9200
Extending Local pool to 9600
Extending Local pool to 10000
Extending Local pool to 10400
Extending Local pool to 10800
Extending Local pool to 11200
Extending Local pool to 11600
Extending Local pool to 12000
Extending Local pool to 12400
Extending Local pool to 12800
Extending Local pool to 13200
Extending Local pool to 13600
Extending Local pool to 14000
Extending Local pool to 14400
Extending Local pool to 14800
Extending Local pool to 15200
Extending Local pool to 15600
Extending Local pool to 16000
Extending Local pool to 16400
Extending Local pool to 16800
Extending Local pool to 17200
Extending Local pool to 17600
Extending Local pool to 18000
Extending Local pool to 18400
Extending Local pool to 18800
Does anyone know what all those "extending pool" messages means? It
sounds bad, plus it also takes about a minute for all of the pools to get
extended, so it's rather a waste of time. Does anyone know what I can do
about this? In case it is relevant, I'm running the console version of
Csound under Windows 98 with a PII 266 MHz processor, 64 MB of RAM, & an
ultra-wide SCSI hard drive.
Thanks for your help,
Marc Poirier
------- End of forwarded message -------
Received: from xenakis.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa21997;
2 Aug 99 15:43 BST
From: jpff@maths.bath.ac.uk
To: gelida@intercom.es
CC: csound@maths.ex.ac.uk
In-reply-to: <37A3431B.D95CF4EC@intercom.es> (message from Josep M
Comajuncosas on Sat, 31 Jul 1999 20:40:27 +0200)
Subject: Re: MACRO example ?
BCC: jpff@maths.bath.ac.uk
References: <37A3431B.D95CF4EC@intercom.es>
Date: Mon, 2 Aug 99 15:43:33 BST
Sender: jpff@maths.bath.ac.uk
Source-Info: From (or Sender) name not authenticated.
Not mine, but....
sr = 44100
kr = 44100
ksmps = 1
;kr = 4410
;ksmps = 10
nchnls = 2
#define ComputeTimeWarp(Time#Beats) #
if $Time.<=0 goto zxTWarpExit
if $Beats.<=0 goto zxTWarpExit
giTimeWarp=($Time./$Beats.) ;pass timewarp factor to global variable
zxTWarpExit:
#
#define RvbR1 #gaRvbInR1#
#define RvbL1 #gaRvbInL1#
#define RvbR2 #gaRvbInR2#
#define RvbL2 #gaRvbInL2#
#define SineWvTbl # 190 #
gkEnv1 init 0; output from global envelope generator 1
gkEnv2 init 0; output from global envelope generator 2
gkEnv3 init 0; output from global envelope generator 3
gkEnv4 init 0; output from global envelope generator 4
gkEnv5 init 0; output from global envelope generator 5
gkEnv6 init 0; output from global envelope generator 6
gkLfo1 init 0; output from global lfo 1
gkLfo2 init 0; output from global lfo 2
gkLfo3 init 0; output from global lfo 3
gkLfo4 init 0; output from global lfo 4
gkLfo5 init 0; output from global lfo 5
gkLfo6 init 0; output from global lfo 6
gaFltIn1 init 0; input to global filter
gaFltIn2 init 0; input to global filter
gaFltIn3 init 0; input to global filter
gaFltIn4 init 0; input to global filter
gaFltIn5 init 0; input to global filter
gaFltIn6 init 0; input to global filter
gaFltIn7 init 0; input to global filter
gaFltIn8 init 0; input to global filter
gkFltCtf1 init 0; cutoff freq for global filter
gkFltCtf2 init 0; cutoff freq for global filter
gkFltCtf3 init 0; cutoff freq for global filter
gkFltCtf4 init 0; cutoff freq for global filter
gkFltCtf5 init 0; cutoff freq for global filter
gkFltCtf6 init 0; cutoff freq for global filter
gkFltCtf7 init 0; cutoff freq for global filter
gkFltCtf8 init 0; cutoff freq for global filter
gaRvbInR1 init 0; input to global reverb/output for all instruments
gaRvbInL1 init 0;
gaRvbInR2 init 0; input to global reverb/output for all instruments
gaRvbInL2 init 0;
gaOutR init 0; ;general output for all instruments
gaOutL init 0; ;general output for all instruments
giTimeWarp init 0; current timewarp factor
giNonRev42 init 1 ;pct of this instrument's output which is NOT designated for reverb
gaI42Out init 0 ;output frequency of this instrument, used as input for this instrument's unit filter
gkI42Freq init 0; Pitch in cycles per second, passed into the unit filter
gaI42GlFlt init 0; Output from unit filter, passed into global reverb
gkAmpEnv142 init 1 ;input for global amplitude for instr 142
gaI142Out init 0 ;output frequency of this instrument, used as input for this instrument's global filter
gkI142Freq init 0; Pitch in cycles per second, passed into the global filter
gaI142GlFlt init 0; Output from global filter, passed into global reverb
giI142Tie init 0;Pass legato-flag from instrument to global filter
gkAmpEnv152 init 1 ;input for global amplitude for instr 152
gaI152Out init 0 ;output signal from this instrument, used as input for this instrument's global filter
gkI152Freq init 0; Pitch in cycles per second, passed into the global filter
gaI152GlFlt init 0; Output from global filter, passed into global reverb
giI152Tie init 0;Pass legato-flag from instrument to global filter
gkAmpEnv162 init 1 ;input for global amplitude for instr 162
gaI162Out init 0 ;output signal from this instrument, used as input for this instrument's global filter
gkI162Freq init 0; Pitch in cycles per second, passed into the global filter
gaI162GlFlt init 0; Output from global filter, passed into global reverb
giI162Tie init 0;Pass legato-flag from instrument to global filter
gkAmpEnv172 init 1 ;input for global amplitude for instr 162
gaI172Out init 0 ;output signal from this instrument, used as input for this instrument's global filter
gkI172Freq init 0; Pitch in cycles per second, passed into the global filter
gaI172GlFlt init 0; Output from global filter, passed into global reverb
giI172Tie init 0;Pass legato-flag from instrument to global filter
;************************************
;************************************
#define GetLfo(LfoNbr#outvar#lbl) # ;Retrieve current value from global Lfo
;The "lbl" parameter is provided so that an instrument can call this macro more than once.
; The calling macro can leave leave it blank on the first call(pound-sign followed immediately
; by the closing parentheses), but must supply a unique value for each subsequent call.
; The calling program should initialize "outvar" prior to sending it here. If this macro
; is called with any invalid "LfoNbr" (such as zero) then outvar will be returned unchanged.
if $LfoNbr.=1 goto zxLfo1$lbl.
if $LfoNbr.=2 goto zxLfo2$lbl.
if $LfoNbr.=3 goto zxLfo3$lbl.
if $LfoNbr.=4 goto zxLfo4$lbl.
if $LfoNbr.=5 goto zxLfo5$lbl.
if $LfoNbr.=6 goto zxLfo6$lbl.
goto zxLfoExit$lbl.
zxLfo1$lbl.:
$outvar.=gkLfo1
goto zxLfoExit$lbl.
zxLfo2$lbl.:
$outvar.=gkLfo2
goto zxLfoExit$lbl.
zxLfo3$lbl.:
$outvar.=gkLfo3
goto zxLfoExit$lbl.
zxLfo4$lbl.:
$outvar.=gkLfo4
goto zxLfoExit$lbl.
zxLfo5$lbl.:
$outvar.=gkLfo5
goto zxLfoExit$lbl.
zxLfo6$lbl.:
$outvar.=gkLfo6
goto zxLfoExit$lbl.
zxLfoExit$lbl.:
#
;*************************************
#define GetEnv(EnvNbr#outvar#lbl) # ;Retrieve current value from global envelope
;The "lbl" parameter is provided so that an instrument can call this macro more than once.
; The calling macro can leave leave it blank on the first call(pound-sign followed immediately
; by the closing parentheses), but must supply a unique value for each subsequent call.
; The calling program should initialize "outvar" prior to sending it here. If this macro
; is called with any invalid "EnvNbr" (such as zero) then outvar will be returned unchanged.
if $EnvNbr.=1 goto zxEnv1$lbl.
if $EnvNbr.=2 goto zxEnv2$lbl.
if $EnvNbr.=3 goto zxEnv3$lbl.
if $EnvNbr.=4 goto zxEnv4$lbl.
if $EnvNbr.=5 goto zxEnv5$lbl.
if $EnvNbr.=6 goto zxEnv6$lbl.
goto zxEnvExit$lbl.
zxEnv1$lbl.:
$outvar.=gkEnv1
goto zxEnvExit$lbl.
zxEnv2$lbl.:
$outvar.=gkEnv2
goto zxEnvExit$lbl.
zxEnv3$lbl.:
$outvar.=gkEnv3
goto zxEnvExit$lbl.
zxEnv4$lbl.:
$outvar.=gkEnv4
goto zxEnvExit$lbl.
zxEnv5$lbl.:
$outvar.=gkEnv5
goto zxEnvExit$lbl.
zxEnv6$lbl.:
$outvar.=gkEnv6
goto zxEnvExit$lbl.
zxEnvExit$lbl.:
#
;***********************************************8
#define SetFltrGlInputs(FltNbr#aSigIn#aCtf#lbl) #
if $FltNbr.=1 goto Flt1$lbl.
if $FltNbr.=1 goto Flt2$lbl.
if $FltNbr.=1 goto Flt3$lbl.
if $FltNbr.=1 goto Flt4$lbl.
if $FltNbr.=1 goto Flt5$lbl.
if $FltNbr.=1 goto Flt6$lbl.
if $FltNbr.=1 goto Flt7$lbl.
if $FltNbr.=1 goto Flt8$lbl.
goto zxFltExit$lbl.
Flt1$lbl.:
gaFltIn1=$aSigIn.
gkFltCtf1=$aCtf.
goto zxFltExit$lbl.
Flt2$lbl.:
gaFltIn2=$aSigIn.
gkFltCtf2=$aCtf.
goto zxFltExit$lbl.
Flt3$lbl.:
gaFltIn3=$aSigIn.
gkFltCtf3=$aCtf.
goto zxFltExit$lbl.
Flt4$lbl.:
gaFltIn4=$aSigIn.
gkFltCtf4=$aCtf.
goto zxFltExit$lbl.
Flt5$lbl.:
gaFltIn5=$aSigIn.
gkFltCtf5=$aCtf.
goto zxFltExit$lbl.
Flt6$lbl.:
gaFltIn6=$aSigIn.
gkFltCtf6=$aCtf.
goto zxFltExit$lbl.
Flt7$lbl.:
gaFltIn7=$aSigIn.
gkFltCtf7=$aCtf.
goto zxFltExit$lbl.
Flt8$lbl.:
gaFltIn8=$aSigIn.
gkFltCtf8=$aCtf.
goto zxFltExit$lbl.
zxFltExit$lbl.:
#
;***********************************************8
#define GlEnvPart1(gkEnv) #
;p4=duration
;p5=env type(1=straight time-line, 2=exponential)
;p6->20 envelope values (expects 0->1 values interspersed with durations)
; (POSITIVE VALUE in p4 indicates straight lines; NEGATIVE VALUE indicates exponential curves)
if p7<0 goto NoTimeWarp ;positive value means that durations are given in beats
iDur1=p7*giTimeWarp ;convert beats to seconds
iDur2=p9*giTimeWarp
iDur3=p11*giTimeWarp
iDur4=p13*giTimeWarp
iDur5=p15*giTimeWarp
iDur6=p17*giTimeWarp
iDur7=p19*giTimeWarp
goto TimeWarpExit
NoTimeWarp: ;negative value means that durations are given in seconds
iDur1=abs(p7)
iDur2=abs(p9)
iDur3=abs(p11)
iDur4=abs(p13)
iDur5=abs(p15)
iDur6=abs(p17)
iDur7=abs(p19)
goto TimeWarpExit
TimeWarpExit:
if p5=1 goto LinsegLbl
if p5=2 goto ExpsegLbl
LinsegLbl: ;straight time-lines
$gkEnv. linseg p6, iDur1, p8, iDur2, p10, iDur3, p12, iDur4, p14, iDur5, p16, iDur6, p18, iDur7, p20
goto EnvExit
ExpsegLbl: ;exponential time-lines
$gkEnv. expseg p6, iDur1, p8, iDur2, p10, iDur3, p12, iDur4, p14, iDur5, p16, iDur6, p18, iDur7, p20
EnvExit:
#
instr 11 ;global envelope
$ComputeTimeWarp(p3#p4)
$GlEnvPart1(gkEnv1)
endin
instr 12 ;global envelope
$ComputeTimeWarp(p3#p4)
$GlEnvPart1(gkEnv2)
endin
instr 13 ;global envelope
$ComputeTimeWarp(p3#p4)
$GlEnvPart1(gkEnv3)
endin
instr 14 ;global envelope
$ComputeTimeWarp(p3#p4)
$GlEnvPart1(gkEnv4)
endin
;************************************
;************************************
#define GlLfoPart1(gkLfo) #
;p4=duration in seconds
;p5=frequency
;p6=depth
;p7=controlling lfo
;p8=controlling env
;p9=wave
;p10=phase
$gkLfo. oscil p6*kCtlLfo*kCtlEnv, p5, p9,p10
#
instr 21 ;global lfo
$ComputeTimeWarp(p3#p4)
kCtlLfo=1;initialize
kCtlEnv=1
$GetLfo(p7#kCtlLfo#1) ;retrieve value for controlling lfo
$GetEnv(p8#kCtlEnv#1) ;retrieve value for controlling env
$GlLfoPart1(gkLfo1)
endin
instr 22 ;global lfo
$ComputeTimeWarp(p3#p4)
kCtlLfo=1;initialize
kCtlEnv=1
$GetLfo(p7#kCtlLfo#1) ;retrieve value for controlling lfo
$GetEnv(p8#kCtlEnv#1) ;retrieve value for controlling env
$GlLfoPart1(gkLfo2)
endin
instr 23 ;global lfo
$ComputeTimeWarp(p3#p4)
kCtlLfo=1;initialize
kCtlEnv=1
$GetLfo(p7#kCtlLfo#1) ;retrieve value for controlling lfo
$GetEnv(p8#kCtlEnv#1) ;retrieve value for controlling env
$GlLfoPart1(gkLfo3)
endin
instr 24 ;global lfo
$ComputeTimeWarp(p3#p4)
kCtlLfo=1;initialize
kCtlEnv=1
$GetLfo(p7#kCtlLfo#1) ;retrieve value for controlling lfo
$GetEnv(p8#kCtlEnv#1) ;retrieve value for controlling env
$GlLfoPart1(gkLfo4)
endin
instr 25 ;global lfo
$ComputeTimeWarp(p3#p4)
kCtlLfo=1;initialize
kCtlEnv=1
$GetLfo(p7#kCtlLfo#1) ;retrieve value for controlling lfo
$GetEnv(p8#kCtlEnv#1) ;retrieve value for controlling env
$GlLfoPart1(gkLfo5)
endin
instr 26 ;global lfo
$ComputeTimeWarp(p3#p4)
kCtlLfo=1;initialize
kCtlEnv=1
$GetLfo(p7#kCtlLfo#1) ;retrieve value for controlling lfo
$GetEnv(p8#kCtlEnv#1) ;retrieve value for controlling env
$GlLfoPart1(gkLfo6)
endin
;*************************************
;*************************************
#define InstrFltrPart1(aSigIn#kCtfVar)#
;p4=stack level
;p5=iStor(zero/non-zero)
;p6=pct NON-reverb(pct of signal NOT sent to reverb)
;p7=stereo panning function table (neg value: no pan, use abs value as the stereo mix-amount). 0=right, .5=equal mix, 1=left
;p8=GlobalCutoff(if non-zero then use global input variable to get the cutoff freq)
;p9=cutoff (if p8=0 then use this value for the cutoff freq, expressed in octave.pitch)
aFlt=$aSigIn. ;initialize
if p4=0 goto FltExit
kCtf=cpspch(p9) ;initialize
if p8=0 goto CutoffExit
kCtf=$kCtfVar. ;get cutoff from global variable
CutoffExit:
aFlt tonex $aSigIn.,kCtf,p4,p5
FltExit:
kRight=abs(p7);initialize (if note is held indefinitely then take stereo balance from first cell)
if p7<0 goto NoPan
kRight oscil 1, 1/p3, p7
NoPan:
kLeft=1-abs(kRight)
;send non-reverb output to global output
gaOutR=gaOutR+(aFlt*kRight)
gaOutL=gaOutL+(aFlt*kLeft)
#
instr 981 ;global filter
$InstrFltrPart1(gaFltIn1#gkFltCtf1)
endin
instr 982 ;global filter
$InstrFltrPart1(gaFltIn2#gkFltCtf2)
endin
instr 983 ;global filter
$InstrFltrPart1(gaFltIn3#gkFltCtf3)
endin
instr 984 ;global filter
$InstrFltrPart1(gaFltIn4#gkFltCtf4)
endin
instr 985 ;global filter
$InstrFltrPart1(gaFltIn5#gkFltCtf5)
endin
instr 986 ;global filter
$InstrFltrPart1(gaFltIn6#gkFltCtf6)
endin
instr 987 ;global filter
$InstrFltrPart1(gaFltIn7#gkFltCtf7)
endin
instr 988 ;global filter
$InstrFltrPart1(gaFltIn8#gkFltCtf8)
endin
;*************************************
;*************************************
#define InstrRvbPart1(RvbInR#RvbInL)#
;p4=reverb time
;p5=high freq diffusion amount (0->1)
;p6=istor
;p7=stereo pan function table
kPan=abs(p7) ;if negative use this as a static pan-value
if p3<0 goto PanExit ;do not try to pan on held notes
if p7<0 goto PanExit
kPan oscil 1,1/p3, p7, 0
PanExit:
aRvbR reverb2 $RvbInR.,p4,p5,p6
aRvbL reverb2 $RvbInL.,p4,p5,p6
;add reverb to global output pots
gaOutR=gaOutR+(kPan*aRvbR)
gaOutL=gaOutL+((1-kPan)*aRvbL)
#
instr 995 ;global pan and reverb
$InstrRvbPart1(gaRvbInR1#gaRvbInL1)
endin
instr 996 ;global pan and reverb
$InstrRvbPart1(gaRvbInR2#gaRvbInL2)
endin
;*************************************
;*************************************
instr 999 ;general output for all in struments
outs gaOutR, gaOutL
gaOutR=0
gaOutL=0
gaRvbInR1=0
gaRvbInL1=0
gaRvbInR2=0
gaRvbInL2=0
endin
instr 142
;This instrument(INST1XX) is a scaled-down version of INSTXX. This version has simpler
; envelopes and no lfo's.
;p4=duration (in beats)
;p5=decibels
;p6=octave.pitch
;p7=wavetable
;p8=chorus nbr of voices
;p9=chorus spacing(in pct of this note's cps...should be between 0 and 1)
;p10->p13=local amplitude envelope values (adsr envelope: durations in seconds, depth 0->1)
;p13=(unused)
;p14=global amp envelope nbr
;p15=filter cuttoff (expressed in nbr of octaves above/below note's pitch)
;p16=filter stack(bypass filter if stack=0)
;p17=filter register adjustment table-number (table data is expressed in nbr of octaves above/below note's pitch)(similar to keyboard-slope)
;p18->p21=local filter envelope values (adsr envelope: durations in seconds, depth expressed as pct of cuttoff frequency)
;p22=(unused)
;p23=global filter envelope nbr
;p24=swoop time in seconds(gliss at end of note from current pitch to next)
;p25=next pitch
;p26=phase(0 to reset oscillators, -1 to preserve as they were)
;p27=lfo
;p28=lfo amp depth
;p29=lfo pitch depth
;p30=lfo filter depth
;p31=pct NON-reverb(pct of signal NOT sent to reverb)
;p32=stereo panning function table (neg value: no pan, use abs value as the stereo mix-amount). 0=right, .5=equal mix, 1=left
;p33=reverb instrument nbr
$ComputeTimeWarp(p3#p4)
;itie tival
iPhase=p26
iAmp = ampdb(p5) ;convert decibels to linear amp
iNote = cpspch(p6) ;convert octave.pitch to cps
kCurrentCps=iNote ;initialize
if p24=0 goto SwoopExit
iNextNote=cpspch(p25)
kCurrentCps linseg iNote, p3-p24, iNote, p24, iNextNote
SwoopExit:
;select "darker" waveforms for higher notes to avoid exceeding Nyquist
itable=p7
if p6<8.0 goto SelectTableExit
itable=itable+1
if p6<10.0 goto SelectTableExit
itable=itable+1
if p6<11.0 goto SelectTableExit
itable=itable+1
if p6<12.0 goto SelectTableExit
itable=itable+1
SelectTableExit:
;Amplitude envelope (returns values from 0->1)
kLocalAmpEnv=1
if p10<0 goto LclAmpEnvExit
kLocalAmpEnv adsr p10, p11, p12, p13,p14
LclAmpEnvExit:
kGlAmpEnv=1 ;initialize
$GetEnv(p14#kGlAmpEnv#1)
kAmpEnv=kGlAmpEnv*kLocalAmpEnv ;factor amplitude by both local and global envelopes
kAmpLfo=1; initialize lfo value(shared for amplituted and pitch)
kFreqLfo=0;
kFltrLfo=1
if p27<1 goto LfoExit
$GetLfo(p27#kLfo#2)
kAmpLfo=(kLfo*p28)+1 ;scale based on amp-lfo-depth parameter
kFreqLfo=kLfo*p29 ;scale based on freq-lfo-depth parameter
kFltrLfo=(kLfo*p30)+1 ;scale based on filter-lfo-depth parameter
LfoExit:
;Generate Pitch
kAmplitude=iAmp*kAmpEnv*kAmpLfo
a6=0
a5=0
a4=0
a3=0
a2=0
aTot=0 ;initialize during each pass
kChorusSpc=p9*kCurrentCps
kAmpScaled=kAmplitude*(1/p8)
if p8=1 goto OneOscillator
if p8=2 goto TwoOscillators
if p8=3 goto ThreeOscillators
if p8=4 goto FourOscillators
if p8=5 goto FiveOscillators
if p8>=6 goto SixOscillators
SixOscillators:
;a6 oscili (kAmplitude*p8), (kCurrentCps*.9958)-.65+kFreqLfo, itable, iPhase
a6 oscili kAmpScaled, (kCurrentCps+(kChorusSpc*3))+kFreqLfo, itable, iPhase
FiveOscillators:
;a5 oscili (kAmplitude*p8), (kCurrentCps*1.0042)+.65+kFreqLfo, itable, iPhase
a5 oscili kAmpScaled, (kCurrentCps-(kChorusSpc*2))+kFreqLfo, itable, iPhase
FourOscillators:
;a4 oscili (kAmplitude*p8), (kCurrentCps*1.0022)+.4+kFreqLfo, itable, iPhase
a4 oscili kAmpScaled, (kCurrentCps+(kChorusSpc*2))+kFreqLfo, itable, iPhase
ThreeOscillators:
;a3 oscili (kAmplitude*p8), (kCurrentCps*.9988)-.3+kFreqLfo, itable, iPhase
a3 oscili kAmpScaled, (kCurrentCps-kChorusSpc)-kFreqLfo, itable, iPhase
TwoOscillators:
;a2 oscili (kAmplitude*p8), (kCurrentCps*1.0012)+.2+kFreqLfo, itable, iPhase
a2 oscili kAmpScaled, (kCurrentCps+kChorusSpc)+kFreqLfo, itable, iPhase
aChorus=a2+a3+a4+a5+a6
OneOscillator:
a1 oscili kAmpScaled, kCurrentCps+kFreqLfo, itable, iPhase
aTot=a1+aChorus
;********BYPASS FILTER IF STACK-LEVEL IS SET TO ZERO
aBal1=aTot ;initialize
if p16=0 goto BypassFilter
;kFreq=kCurrentNote;current pitch (frequency) that the instrument is playing, not counting any LFO modulation
kOct=octcps(kCurrentCps) ;convert frequency into Oct/Pct
;Lookup filter's register adjustment factor. This value is expressed as the number of
; octaves (neg or pos) by which the filter cutoff is to be adjusted depending of the
; register of the current note (similar to the keyboard-slope value in commercial
; synthesizers)
kRegAdj tablei kOct, p17
kCutoffOct=p15+kRegAdj ;sum register adjustment and FltrEnv(both are expressed in octaves)
kOctaveFactor pow 2, abs(kCutoffOct) ;compute a power of two for use in converting freq to another octave(to rise 1 octave multiply freq by 2; 2 octaves mult by 4; etc)
;If cutoff is positive then multiply current note by OctaveFactor to get the filter's cutoff
; frequency.if cutoff is negative(i.e. below the frequency of the current note) then divide
; by the octave-factor to get the cutoff frequency.
if kCutoffOct<0 goto NegativeCutoff
kCutFreq = kCurrentCps*kOctaveFactor
goto CutoffExit
NegativeCutoff:
kCutFreq = kCurrentCps/kOctaveFactor
CutoffExit:
if kCutFreq>=0 goto CutFreqExit ;this probably will never happen but am putting it here just in case
kCutFreq=0
CutFreqExit:
;Local filter envelope (adsr shifted to 1-based scale for use as multiplier OVER cuttoff frequency)
kFltrEnv=1 ;initialize
if p18<1 goto LocalFltEnvExit
kFltrEnv adsr p18, p19, p20, p21, p22
kFltrEnv=kFltrEnv+1 ;shift to 1-based scale
LocalFltEnvExit:
kGlFltEnv=1 ;initialize global filter envelope
$GetEnv(p23#kGlFltEnv#2)
kCutFreq=kCutFreq*kFltrEnv*kGlFltEnv*kFltrLfo
iStack=p16
iStack2=0
if p16<11 goto StackExit
iStack=10
iStack2=p16-10
StackExit:
;Filter: asig khp inumlaye istor
;aFlt rezzy aTot,kCutFreq, 10
;aFlt rezzy aFlt,kCutFreq, 10
aFlt tonex aTot, kCutFreq, iStack, iPhase; abs(iPhase)
if iStack2<1 goto FltrExit
aFlt tonex aFlt, kCutFreq, iStack2, iPhase; abs(iPhase)
FltrExit:
;aBal1 balance aFlt, aTot ; , 10, iTie
aBal1=aFlt
BypassFilter:
kRight=abs(p32);initialize (if note is held indefinitely then take stereo balance from first cell)
if p32<0 goto NoPan
kRight oscil 1, 1/p3, p32
NoPan:
;kLeft linseg p15,p12*giTimeWarp,p13,p14*giTimeWarp,p15,p16*giTimeWarp,p17,p18*giTimeWarp,p19,20*giTimeWarp,p21,p22*giTimeWarp,p23,p24*giTimeWarp,p25,p26*giTimeWarp,p27 ;multiply durations by timewarp factor to translate from beats into seconds
kLeft=1-abs(kRight)
;send non-reverb output to global output
gaOutR=gaOutR+(aBal1*kRight*p31)
gaOutL=gaOutL+(aBal1*kLeft*p31)
;send reverb to selected reverb instrument
if p33=2 goto Rvb2
$RvbR1.=$RvbR1.+(aBal1*kRight*(1-p31))
$RvbL1.=$RvbL1.+(aBal1*kLeft*(1-p31))
goto RvbExit
Rvb2:
$RvbR2.=$RvbR2.+(aBal1*kRight*(1-p31))
$RvbL2.=$RvbL2.+(aBal1*kLeft*(1-p31))
RvbExit:
;gaOutR=gaOutR+(aBal1*kRight*p31)
;gaOutL=gaOutL+(aBal1*kLeft*p31)
;gaRvbInR=gaRvbInR+(aBal1*kRight*(1-p31))
;gaRvbInL=gaRvbInL+(aBal1*kLeft*(1-p31))
endlbl:
endin
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa22011;
2 Aug 99 15:47 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
id 11BIOW-00005Z-00
for jpff@maths.bath.ac.uk; Mon, 2 Aug 1999 14:44:48 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (PAA08974); Mon, 2 Aug 1999 15:45:03 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 2 Aug 1999 15:44:52 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (PAA01207); Mon, 2 Aug 1999 15:44:52 +0100 (BST)
Received: from [138.38.97.36] (helo=maths.Bath.AC.UK ident=mmdf)
by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
id 11BILh-00005H-00
for csound@maths.ex.ac.uk; Mon, 2 Aug 1999 14:41:53 +0100
From: jpff@maths.bath.ac.uk
To: csound@maths.ex.ac.uk
In-reply-to: <37A3431B.D95CF4EC@intercom.es> (message from Josep M
Comajuncosas on Sat, 31 Jul 1999 20:40:27 +0200)
Subject: Re: MACRO example ?
References: <37A3431B.D95CF4EC@intercom.es>
Date: Mon, 2 Aug 99 15:44:53 BST
Source-Info: From (or Sender) name not authenticated.
Message-Id:
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Sorry, did not mean to send that long orc to everyone. I wish I could
remember whose it was.....
==John
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa22020;
2 Aug 99 15:51 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
id 11BJQh-0006FG-00
for jpff@maths.bath.ac.uk; Mon, 2 Aug 1999 15:51:07 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (PAA16994); Mon, 2 Aug 1999 15:48:35 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 2 Aug 1999 15:48:25 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (PAA08911); Mon, 2 Aug 1999 15:48:24 +0100 (BST)
Received: from [138.38.97.36] (helo=maths.Bath.AC.UK ident=mmdf)
by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
id 11BIP4-00005b-00; Mon, 2 Aug 1999 14:45:22 +0100
From: jpff@maths.bath.ac.uk
To: mrhoades@innerlightpub.com
CC: csound@maths.ex.ac.uk
In-reply-to: <000601bedbb7$c844c200$4e9f2599@default> (message from Michael
Rhoades on Sat, 31 Jul 1999 19:49:54 -0500)
Subject: Re: Warning
References: <000501bedb74$bc0cd740$fe9f2599@default> <37A35103.8FB018CE@rcsreg.com> <001401bedbb4$0d29ec00$ab4ffcd0@default> <000601bedbb7$c844c200$4e9f2599@default>
Date: Mon, 2 Aug 99 15:48:15 BST
Source-Info: From (or Sender) name not authenticated.
Message-Id:
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Your orchestr produces a sensible error message for me
xenakis 218% ./csound /tmp/xx.orc
Using csound.txt
Csound Version 3.57 (Aug 2 1999)
orchname: /tmp/xx.orc
using previous score.srt
... done
orch compiler:
36 lines read
instr 1
error: illegal character :, line 29:
asig1 = a1 + (a2 + a4 + a6), :here is the unneeded comma
^
error: expression syntax, line 29:
asig1 = a1 + (a2 + a4 + a6), :here is the unneeded comma
insufficient terms: :hereistheunneededcomma
error: too many input args, line 29:
asig1 = a1 + (a2 + a4 + a6), :here is the unneeded comma
3 syntax errors in orchestra. compilation invalid
This is also the case on v3.35 which I also have lieing around.
Is that what you got?
==John ff
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa24005;
3 Aug 99 11:54 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
id 11BbE4-0000Yj-00
for jpff@maths.bath.ac.uk; Tue, 3 Aug 1999 10:51:16 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (LAA09731); Tue, 3 Aug 1999 11:49:14 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 3 Aug 1999 11:49:00 +0100
Received: from agora.stm.it [195.62.32.1] by hermes via ESMTP (LAA10698); Tue, 3 Aug 1999 11:48:59 +0100 (BST)
Received: from agora.stm.it (rm2-640.tiscalinet.it [212.123.84.132]) by agora.stm.it (8.9.2/8.8.5) with ESMTP id MAA10571 for ; Tue, 3 Aug 1999 12:48:56 +0200 (ITADST)
Message-ID: <37A6ADF0.E90268DA@agora.stm.it>
Date: Tue, 03 Aug 1999 10:53:04 +0200
From: Gabriel Maldonado
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Csound Mailing List
Subject: DirectCsound 2.801 available
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
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
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa24528;
3 Aug 99 12:47 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
id 11Bd2I-0006dB-00
for jpff@maths.bath.ac.uk; Tue, 3 Aug 1999 12:47:14 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (MAA04662); Tue, 3 Aug 1999 12:44:35 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 3 Aug 1999 12:44:25 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (MAA00536); Tue, 3 Aug 1999 12:44:24 +0100 (BST)
Received: from [138.38.99.25] (helo=maths.Bath.AC.UK ident=mmdf)
by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
id 11Bc0M-0000bH-00
for csound@maths.ex.ac.uk; Tue, 3 Aug 1999 11:41:10 +0100
Date: Tue, 3 Aug 99 12:44:20 BST
From: jpff@maths.bath.ac.uk
Subject: Version 3.57
To: csound@maths.ex.ac.uk
Message-Id:
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Message written at 3 Aug 1999 09:10:05 +0100
I realise that it is only two weeks since 3.56 but there are a number
of changes which I wanted to get out to ensure that they work. There
are a number bug fixes to clock, divz, wgbrass and marimba, as well as
new opcodes.
The new opcodes are varied. From matt ingalls we have a set of
opcodes to interrogate sound files from within the orchestra (filelen,
filesr, filechnls and filepeak). From Gabriel Maldonado there are
expsega (and more accurate expseg), logbtwo and powoftwo for fast
arithmetic. In addition, from a collaboration between Gabriel,
Richard Boulanger and myself there are active, cpuprc, prealloc and
maxalloc which control and investigate the number of active
instruments, mainly for realtime activity
In addition Gen23 has been extended to allow deferred length (from
Paris Smaragdis)
By teh time this message is sent the system for Windows, PC-console
mode, Linux and SGI shoudl be available; and sources of course.
Solaris and Mac68k systems to follow. Others at some time I guess
==John ffitch
========================================================================
Release Notes for 3.57
======================
These are the release notes for version 3.57
Bug Fixes
---------
clock opcodes all mapped to clock 0 -- fixed
divz was decoded incorrectly in parsing
The triple strike in marimba never happened due to programming error.
The percentage of doubles and singles are variable as two optional
arguments, both defaulting to 20%.
Some error and warning strings were wrong. Extensively reviewed and
fixed
Language Changes
----------------
In GEN23 (read ASCII file of numbers it is now possible to have a
length of 0 and have the generator calculated from the number of
numbers in the file.
Opcode Fixes
------------
in buzz and gbuzz at least 1 harmonic is always used, and the absolute
value of the number is used rather than giving a warning
bug in wgbrass fixed which could lead to crashes
New Opcodes
-----------
active -- tell how many active instances there are of an instrument
cpuprc -- limit number of allocations of an instrument by load
maxalloc -- limit number of allocations of an instrument count
prealloc -- create a pool of unactive instances
expsega -- a-rate exponential segments
logbtwo
powoftwo -- fast versions of pow and log in both i and k position
ilen filelen ifilcod ; returns length of "ifilcod" in seconds
isr filesr ifilcod ; returns the sample rate of "ifilcod"
inchnls filenchnls ifilcod ; returns the number of chnls of "ifilcod"
ipeak filepeak ifilcod, [ichnl] ; returns peak absolute value of
; "ifilcod"
; if ichnl=0, returns peak out of all channels
; if ichnl>0, returns the peak of ichnl
; if ichnl is not specified, returns peak of
; the entire file.
; currently only supports AIFF_C float files
Other Changes:
-------------
The pvtool utility has been included in utils2, and as a -U option
Windows GUI Changes
-------------------
New dialog for pvlook utility
------------------------------------------------------------------------
==John ff
1999 August 3
========================================================================
active
inum active ins
DESCRIPTION
Returns the number of active instances of instrument number ins
------------------------------------------------------------------------
expsega
asig expsega ia, idur1, ib[, idur2, ic[...]]
DESCRIPTION
An exponential segment generator operating at a-rate. This unit is
almost identical to expseg, but very more precise when defining
segments with very short duration (i.e. in percussive attack phase) at
audio-rate.
Note that expseg opcode does not operate correctly at audio rate when
segments are shorter than a k-period.
INITIALISATION
ia - starting value. Zero is illegal.
ib, ic, etc. - value after idur1 seconds, etc. must be non-zero and
must agree in sign with ia.
idur1 - duration in seconds of first segment.
A zero or negative value will cause all initialization to be skipped.
idur2, idur3, etc. - duration in seconds of subsequent segments.
A zero or negative value will terminate the initialization process
with the preceding point, permitting the last-defined line or curve to
be continued indefinitely in performance. The default is zero.
PERFORMANCE
These units generate control or audio signals whose values can pass
through 2 or more specified points. The sum of dur values may or may
not equal the instrument's performance time: a shorter performance
will truncate the specified pattern, while a longer one will cause the
last-defined segment to continue on in the same direction.
------------------------------------------------------------------------
powoftwo(x)
logbtwo(x)
powoftwo() function returns 2 ^ x and allows positive and negatives
numbers as argument.
logbtwo() returns the logarithm base two of x.
If the argument is in the range [-5,+5] for powoftwo() or [0.25,4]
for logbatwo() then an internal table is used, allowing a precision
more fine than one cent in a range of ten octaves. Outside those
ranges the value is calculated afresh and will be as slow as use of
pow or log.
logbtwo() returns the logarithm base two of x.
Also they are very useful when working with tuning ratios. They work
at i and k-rate.
------------------------------------------------------------------------
cpuprc
maxalloc
cpuprc instrnum, ipercent
maxalloc instrnum, icount
prealloc instrnum, icount
DESCRIPTION
cpuprc sets the cpu processing-time percent usage of an instrument in
order to avoid buffer underrun in realtime performances
maxalloc limits the number of allocations of an instrument.
prealloc creates space for instruments but does not run them
INITIALIZATION
instrnum - instrument number
ipercent - percent of cpu processing-time to assign
icount -- number of instruments instances that can be allocated
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. It is assumed that the total theorical processing time
of the cpu of the computer is 100%, but note that this percent value
can only be defined empirically.
For example if ipercent is set to 5% for instrument 1, the maximum
number of voices that can be allocated at any time will 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 a warning message,
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.)
Initially all instruments are set to a default value of ipercent =
0.0% (i.e. zero processing time or rather infinite cpu
processing-speed). Note that this opcode can be used either at
instrument 0 time or dynamically, when it only affects later
instruments. Any active instuenmt whose load is changed may lead to
incorrect or anomolous results.
In maxalloc setting the number of maximum allocation to 0 means
unlimited allocations are allowed. A negative allocation disallows
any allocation.
example:
sr=44100
kr=441
ksmps=100
nchnls=2
cpuprc 1, 2.5 ;** set instr 1 to 2.5% of cpu, max 40 voices
cpuprc 2, 33.333 ;** set instr 2 to 33.333% of cpu, max 3 voices
instr 1
...body...
endin
instr 2
....body...
endin
------------------------------------------------------------------------ |