Here's an example, remember to change the CsOptions to reflect your
own settings.
Rory.
<CsoundSynthesizer>
<CsOptions>
-odevaudio -b10 -idevaudio
</CsOptions>
<CsInstruments>
sr = 44100
kr = 44100
ksmps = 1
nchnls = 1
opcode SigRec, a,akkiii
setksmps 1
ap init 0
kp init 0
/* sig, pitch, trigger, ftable, dur, crossfd */
ain,kpit,ktr,ifn,ilen,ic xin
icft = ic*sr /* crossfade samples */
iend = ilen*sr /* end point */
icft1 = icft+iend /* plus end */
kt trigger ktr, 1, 0 /* trigger */
if kt > 0 then
ktrig = 1 /* rec ON */
kp = 0
endif
if ktrig > 0 then /* recording block */
ap = kp
if kp < iend then /* fill in the duration */
tablew ain, ap, ifn
endif
if kp >= iend then /* crossfade block */
if kp < icft1 then
kfd = (kp-iend)/icft
aout table ap-iend, ifn
aout = aout*kfd
tablew ain*(1-kfd)+aout, ap-iend, ifn
else /* rec OFF */
ktrig = 0
endif
endif
kp = kp + 1
endif /* end recording block */
if ktrig == 0 then /* playback block */
aout table kp, ifn
kp = kp + kpit
if kp > iend then /* modulus */
kp = kp - iend
elseif kp < 0 then
kp = iend - 1
endif
endif /* end playback block */
xout aout
endop
instr 1
k1 line 2, 2, 0
a1 inch 1
a2 SigRec a1, 1, k1, 1, 5, 0.5
out a2+a1
endin
</CsInstruments>
<CsScore>
f1 0 524288 7 0 524288 0
i1 0 100
</CsScore>
</CsoundSynthesizer>
2009/7/9 Charles Gran <
sonance@...>:
> Hi,
>
> I want pointed to this UDO for study, but I can't get the included
> example to work.
>
>
http://www.csounds.com/udo/displayOpcode.php?opcode_id=55>
> Attached my copy of the example included with the UDO and the log of
> the performance.
>
> Thanks,
> Charles
>
>
> <CsoundSynthesizer>
> <CsOptions>
> -odac4 -iadc4 -b64 -B512
> </CsOptions>
>
> <CsInstruments>
> sr = 44100
> ksmps = 8
> nchnls = 1
>
> #include "SigRec.udo"
>
> instr 1
>
> asig in
> ktr line 0,0.1,1.1
> as SigRec asig,1,ktr,1,5,0.025
>
> out as+asig
> endin
> </CsInstruments>
>
> <CsScore>
> f1 0 524288 7 0 524288 0
> il 2 60
> </CsScore>
>
> </CsoundSynthesizer>
>
>
>
> PortMIDI real time MIDI plugin for Csound
> PortMIDI real time MIDI plugin for Csound
> PortAudio real-time audio module for Csound
> PortAudio real-time audio module for Csound
> virtual_keyboard real time MIDI plugin for Csound
> virtual_keyboard real time MIDI plugin for Csound
> 0dBFS level = 32768.0
> 0dBFS level = 32768.0
> Csound version 5.10 (double samples) Jan 9 2009
> Csound version 5.10 (double samples) Jan 9 2009
> libsndfile-1.0.18pre24
> libsndfile-1.0.18pre24
> Reading options from $CSOUNDRC: C:\Csound\.csoundrc
> Reading options from $CSOUNDRC: C:\Csound\.csoundrc
> UnifiedCSD: SigRec-test.csd
> UnifiedCSD: SigRec-test.csd
> STARTING FILE
> STARTING FILE
> Creating options
> Creating options
> Creating orchestra
> Creating orchestra
> Creating score
> Creating score
> orchname: c:\temp\cs657.orc
> orchname: c:\temp\cs657.orc
> scorename: c:\temp\cs664.sco
> scorename: c:\temp\cs664.sco
> rtaudio: PortAudio module enabled ... rtaudio: PortAudio module
> enabled ... using callback interface
> using callback interface
> rtmidi: PortMIDI module enabled
> rtmidi: PortMIDI module enabled
> orch compiler:
> orch compiler:
> 68 lines read
> 68 lines read
> opcode opcode SigRec SigRec a a akkiii akkiii
>
> instr instr 1 1
>
> LABELS list is full...extending to 10
> LABELS list is full...extending to 10
> LABELS list is full...extending to 15
> LABELS list is full...extending to 15
> Elapsed time at end of orchestra compile: real: 0.077s, CPU: 0.078s
> Elapsed time at end of orchestra compile: real: 0.077s, CPU: 0.078s
> sorting score ...
> sorting score ...
> sread: sread: unexpected char lunexpected char l
>
> section 1: at position 1
> section 1: at position 1
> in line 33 of file input SigRec-test.csd
> in line 33 of file input SigRec-test.csd
> remainder of line flushed
> remainder of line flushed
> ... done
> ... done
> Elapsed time at end of score sort: real: 0.083s, CPU: 0.093s
> Elapsed time at end of score sort: real: 0.083s, CPU: 0.093s
> Csound version 5.10 (double samples) Jan 9 2009
> Csound version 5.10 (double samples) Jan 9 2009
> displays suppressed
> displays suppressed
> 0dBFS level = 32768.0
> 0dBFS level = 32768.0
> orch now loaded
> orch now loaded
> audio buffered in 128 sample-frame blocks
> audio buffered in 128 sample-frame blocks
> PortAudio V19-devel (built Jan 6 2009 21:14:14)
> PortAudio V19-devel (built Jan 6 2009 21:14:14)
> PortAudio: available output devices:
> PortAudio: available output devices:
> 0: Microsoft Sound Mapper - Output
> 0: Microsoft Sound Mapper - Output
> 1: E-DSP Wave [EC00]
> 1: E-DSP Wave [EC00]
> 2: Primary Sound Driver
> 2: Primary Sound Driver
> 3: E-DSP Wave [EC00]
> 3: E-DSP Wave [EC00]
> 4: E-MU ASIO
> 4: E-MU ASIO
> PortAudio: selected output device 'E-DSP Wave [EC00]'
> PortAudio: selected output device 'E-DSP Wave [EC00]'
> writing 256-byte blks of shorts to dacwriting 256-byte blks of shorts to dac
>
> SECTION 1:
> SECTION 1:
> ftable 1:
> ftable 1:
> new alloc for instr 1:
> new alloc for instr 1:
> WARNING: instr 1 uses 3 p-fields but is given 0
> WARNING: table.a: table index type inconsistent with output
> ERROR: illegal character
>
>
> Send bugs reports to this list.
> To unsubscribe, send email
sympa@... with body "unsubscribe csound"
>
Send bugs reports to this list.
To unsubscribe, send email
sympa@... with body "unsubscribe csound"