vallste
Jr. Member
 
Posts: 55
|
 |
« Risposta #7 il: Marzo 22, 2010, 13:55:17 » |
|
Ho sotto mano questo che funziona sia sulla versione 5.09 (Windows) che sulla 5.12 compilata da cvs qualche settimana fa (Linux). Non usa diskin et similia ma l'opcode tab per leggere un file aif caricato con la GEN 01, è un pò caotico (ci sto lavorando) ma per testare il tuo problema potrebbe essere utile (se non hai errori e non senti nulla premi il tasto P1 mette in mute la traccia):
<CsoundSynthesizer> <CsOptions> ;Linux ;-iadc:system:capture_ ;-odac:system:playback_ -+rtaudio=jack -+rtmidi=null -b 80 -B 1024 ;Windows -+rtaudio=PortAudio </CsOptions> <CsInstruments> sr = 44100 ksmps = 1 nchnls = 2 zakinit 2, 1
#define ONOFFKEY(ASCII'NUM) #if (kascii == $ASCII && keyactivation == 1) then if gkOnOff$NUM == 0 then FLsetVal 1, 1, giOnOff$NUM else FLsetVal 1, 0, giOnOff$NUM endif endif#
#define CHANNEL(NUM) #a$NUM tab andx , $NUM if gkOnOff$NUM == 1 then zawm a$NUM, 0 endif#
FLpanel "Player", 550, 100, 1, 1, 1, 1, 0 gkPlay,gihPlay FLbutton "@>", 1, 0, 2, 50, 30, 0, 0, 0, 10, 0, -1 gkPause,gihPause FLbutton "@||", 1, 0, 2, 50, 30, 50, 0, -1
gkOnOff01, giOnOff01 FLbutton "P1", 1, 0, 2, 45, 30, 100, 0, -1
gkLoopBeg, gihLoopBeg FLslider " ", 0, 1, 0, 3, -1, 550, 15, 0, 70 gkLoopEnd, gihLoopEnd FLslider "Loop Points", 0, 1, 0, 3, -1, 550, 15, 0, 85 FLsetVal_i 0, gihLoopBeg FLsetVal_i 1, gihLoopEnd
FLpanel_end FLrun
gitablelen init 1048576 girecdur init 0
instr 1 gkSpeed init 1 gkandx init 0 kascii FLkeyIn keyactivation changed kascii ;Activate audio channel $ONOFFKEY(49'01) ;Speed set if (kascii == 122 && keyactivation == 1) then ;z key normal speed gkSpeed = 1 elseif (kascii == 120 && keyactivation == 1) then ;x key normal speed gkSpeed = .75 elseif (kascii == 99 && keyactivation == 1) then ;c key normal speed gkSpeed = .5 elseif (kascii == 118 && keyactivation == 1) then ;v key normal speed gkSpeed = .25 endif ;markers if (kascii == 113 && keyactivation == 1) then ;q key set beginning loop point at beginning FLsetVal 1,0, gihLoopBeg elseif (kascii == 119 && keyactivation == 1) then ;q key set beginning loop point at actual position FLsetVal 1,gkandx, gihLoopBeg elseif (kascii == 101 && keyactivation == 1) then ;e key set end loop point at end FLsetVal 1,1, gihLoopEnd elseif (kascii == 114 && keyactivation == 1) then ;r key set end loop point at actual position FLsetVal 1,gkandx, gihLoopEnd endif endin
instr 10 if gkPlay=0 then turnoff endif PAUSE: if gkPause=1 then kgoto PAUSE endif gkrecdur init nsamp(1) iporttime = 0.02 kporttime linseg 0,0.001,iporttime,1,iporttime kLoopBeg portk gkLoopBeg, kporttime kLoopEnd portk gkLoopEnd, kporttime kLoopBeg = kLoopBeg * gkrecdur kLoopEnd = kLoopEnd * gkrecdur kLoopLen = kLoopEnd - kLoopBeg
kPhasFrq divz gkSpeed, (kLoopLen/sr), .00001 andx phasor kPhasFrq kLoopBeg = (kLoopBeg < kLoopEnd ? kLoopBeg : kLoopEnd) andx = (andx*abs(kLoopLen)) + kLoopBeg gkan downsamp andx gkandx = (gkan - kLoopBeg) / abs(kLoopLen)
$CHANNEL(01)
aout zar 0 fsig pvsanal aout, 1024, 256, 1034, 1 ; analyse it ftps pvscale fsig, 1/gkSpeed, 1, 2 atransp pvsynth ftps zacl 0, 1 outs atransp * 5000, atransp * 5000 endin
</CsInstruments> <CsScore> f 1 0 0 1 "drums_loop.aif" 0 6 1 i 1 0 3600 e </CsScore> </CsoundSynthesizer>
Ciao
|