leonardo
Newbie

Posts: 11
|
 |
« il: Febbraio 11, 2012, 17:26:19 » |
|
Salve a tutti, vi chiedo di darmi gentilmente ancora un aiuto. L'orchestra che vi posto utilizza due strumenti banali: il primo genera rumore bianco, il secondo lo filtra. Sono comandati da due FLbutton. Se faccio partire prima il rumore bianco e poi lo filtro funziona tutto, ma se li faccio ripartire non funziona più niente. Mi viene segnalato un problema di reinizializzazione che non sò risolvere. Vi ringrazio anticipatamente per l'aiuto.
<CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments>
sr = 44100 kr = 4410 ksmps = 10 nchnls = 1
FLpanel "rumore e filtro", 350, 70, 0, 0
;SWITCHES ON | OFF | TYPE | WIDTH | HEIGHT | X | Y | OPCODE | INS | STARTTIM | DUR gkOnOff,gihOnOff FLbutton "On/Off", 1, 0, 2, 150, 30, 0, 0, 0, 1, 0, 3600 gkOnOff1,gihOnOff1 FLbutton "On/Offfiltro", 1, 0, 2, 150, 30, 155, 0, 0, 2, 0, 3600
;FLsetVal_i 0, gihOnOff ;FLsetVal_i 0, gihOnOff1 FLpanel_end FLrun
opcode genrum, a,i ; GENERA IL RUMORE BIANCO ifreq xin anois rand ifreq xout anois endop
opcode filtropassabanda, a,akk ; FILTRO PASSABANDA asig, kfc, kbw xin ares areson asig, kfc, kbw xout ares endop instr 1
key = ( gkOnOff = 1 && gkOnOff1 = 0 ? 1 : 0 )
if key ==1 then arand genrum 2000 out arand
elseif key == 0 then garand genrum 2000
endif endin
instr 2
key = ( gkOnOff = 1 && gkOnOff1 = 1 ? 1 : 0)
if key != 1 then turnoff elseif key == 1 then kft = 200 kres = 2 aout filtropassabanda garand,kft,kres a1 balance aout, garand out a1 endif endin
</CsInstruments>
<CsScore> f 3600 e </CsScore>
</CsoundSynthesizer>
|