« Return to Thread: [csnd] Windcontroller Portamento with cpsmidib opcode

[csnd] Windcontroller Portamento with cpsmidib opcode

by jinku kim :: Rate this Message:

Reply to Author | View in Thread

Hello! csounder.

It is a question about Portamento and cpsmidib.

This csd file is for woodwind instrument for Akai_Ewi and Wiimote.

This csd use cpsmidib with i-rate as note input and Linseg opcode as a portamento funtion, in this case I can't control pitchbend, when I am blowing Ewi(noteon).

Can you tell me what I miss, some hint or tips for using k-rate_cpsmidib and portamento together, Or another Idea for making portamento.

Thank you in advance.

<CsoundSynthesizer>
<CsOptions>
-odac           -iadc     -d
</CsOptions>
<CsInstruments>

sr       =  44100
ksmps    =  32
nchnls   =  2
0dbfs = 1

giseed = .5
garev init 0
gicps init 440



gitable1 ftgen 1, 0, 4096, 10, 1
gitable2 ftgen 3, 0, 4097, -10, 2661, 87, 33, 18
gitable3 ftgen 4, 0, 4097, -10, 174, 12,
gitable4 ftgen 5, 0, 4097, -10, 314, 13,
gitable5 ftgen 6, 0, 16, -2, 40, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 10240


ctrlinit 1, 2, 0


instr 1 ; This is based on Flute1.csd from Dr. Boulanger's csound library.
             I modified it for Midi_Windcontoroller and Wiimote.

knoise chnget "breathnoise"
kvib chnget "vibrato"
kport chnget "port"
kfilt chnget "filt"
kfilt2 chnget "filt2"
iportim chnget "portamento"

icpsb init gicps

icps cpsmidib

gicps = icps

kport linseg icpsb, iportim, gicps


kbreath midictrl 2, 0, 1
gkbreath = kbreath


kbreath port kbreath, 0.02
kbreath linenr kbreath, 0.02, 0.05, 0.1


kvibdepth = abs(kvib*kport/100.)
kvibdepth randi kvibdepth*.1, 1000,giseed
giseed  =       frac(giseed*105.947)
kport    = kport + kvibdepth

iphase  = giseed

knfrq   = kport

kampr1  randi   .02*kbreath, 10, giseed                 
giseed  =       frac(giseed*105.947)
kamp1   =       kbreath + kampr1
kampr2  randi   .02*kbreath, 10, giseed                 
giseed  =       frac(giseed*105.947)
kamp2   =       kbreath + kampr2
kampr3  randi   .02*kbreath, 10, giseed              
giseed  =       frac(giseed*105.947)
kamp3   =       kbreath + kampr3

awt1    oscili  kamp1, kport, gitable3, iphase             
awt2    oscili  kamp2, kport, gitable4, iphase
awt3    oscili  kamp3, kport, gitable5, iphase


awnoise rand  20000, giseed
afiltn  butbp awnoise, knfrq,100

kbreath  = (knoise = 1 ? kbreath : 0)

asig    =       awt1 + awt2 + awt3+(afiltn*kbreath*.4)
asig    =       asig/3/4000
    

afilt   tone    asig, kfilt2
asig    balance afilt, asig

outs    asig, asig

garev   =       garev + asig
       


endin

instr 100
  
;printk 1, gkbreath                                                           

;krevenv linseg  2, p3, 2, 1.0, 0.1
arev   reverb  garev, 2.0;krevenv
;arev clip arev, 5              
                outs    arev*0.1, arev*0.1               
garev =         0                                               

endin




</CsInstruments>
<CsScore>
f 0 36000

i 100 0 3600



</CsScore>
</CsoundSynthesizer>

 « Return to Thread: [csnd] Windcontroller Portamento with cpsmidib opcode