| As far as I'm aware you can do it by including a file with the UDO
too, as Charles did. He had a syntax error, from looking at the code I
wonder if it was caused by an L instead of a 1 in the score section,
as in il instead of i1? Either way the UDO was recognised so the
problem wasn't with that.
Rory.
2009/7/9 ilterzouomo :
> Ciao,
>
> if i'm not wrong You must write the code of udo (as Mr. Walsh said) like
> this:
>
>
>
> -odac -iadc ;;;RT audio I/O
>
>
> sr = 44100
> kr = 4410
> ksmps = 10
> 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
>
> asig in
> ktr line 0, 0.1, 1.1 /* send in a trigger */
> as SigRec asig,1,ktr,1,5, 0.025
>
> out as+asig
> endin
>
>
>
> ; Play Instrument #1 for one second.
> f1 0 524288 7 0 524288 0 /*enough space for 11 secs*/
> i1 2 60
>
> e
>
>
>
> Here work. Good work,
>
> ciao,
> fran
>
>
>
>
>
> ----- Original Message ----- From: "Charles Gran"
> To:
> Sent: Thursday, July 09, 2009 5:22 PM
> Subject: [Csnd] SndRec UDO, issue with example?
>
>
>> 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
>>
>>
>>
>>
>> -odac4 -iadc4 -b64 -B512
>>
>>
>>
>> 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
>>
>>
>>
>> f1 0 524288 7 0 524288 0
>> il 2 60
>>
>>
>>
>>
>>
>>
>> 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@lists.bath.ac.uk with body "unsubscribe
>> csound"
>
>
> --------------------------------------------------------------------------------
>
>
>
> Nessun virus nel messaggio in arrivo.
> Controllato da AVG - www.avg.com
> Versione: 8.5.375 / Database dei virus: 270.13.8/2224 - Data di rilascio:
> 07/08/09 05:53:00
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
|