Cabbage Logo
Back to Cabbage Site

Chnget and chnset

I am trying to use chnget and chnset to mix diffirent instruments but I get only silence of the lamps

instr 1
...
  kSG1EnvAmp madsr iSG1EnvAmpAttack, iSG1EnvAmpDecay, iSG1EnvAmpSustain, iSG1EnvAmpRelease
  kSG1EnvFilter madsr iSG1EnvFilterAttack, iSG1EnvFilterDecay, iSG1EnvFilterSustain, iSG1EnvFilterRelease
  aSG1 vco2 p5*kSG1EnvAmp, p4, iSG1wav, kSG1PWM, kSG1Phase
  aSG1FLp moogladder aSG1,kSG1FilterLpF * kSG1EnvFilter,kSG1FilterLpR
  aSG1FHp bqrez aSG1FLp, kSG1FilterHpF * kSG1EnvFilter, kSG1FilterHpR, 1
  ; outs aSG1FHp, gaSG1FHp
  chnset aSG1FHp, "Layer 1 Output" 
endin
instr 3
  ; General
  kSG1Amp chnget "SG1 Amp"
  kSG2Amp chnget "SG2 Amp" 

  ; Get input from Layer 1 
  aSG1Out chnget "Layer 1 Output"
  aSG2Out chnget "Layer 2 Output"
  ; display kSG1Amp, .1, 3
  ; outs (aSG1 * kSG1Amp) + (aSG2 * kSG2Amp) ,(aSG1 * kSG1Amp) + (aSG2 * kSG2Amp)

  outs aSG1Out, aSG1Out
endin

if i comment out the aout in instr1 i get sound , but if I dont I get silence, what am I doing wrong here ?

PS: complete code can be viewed here

I start to think this may be a Cabbage bug

if I put the chnget in the instr that are chnset the aout works fine and I hear sound , but the moment I move chget outside it stops working which is weird because according to CSound it should work , unless I am doing something really stupid

so basically this works

instr 1
...
aSG1 vco2 p5*kSG1EnvAmp, p4, iSG1wav, kSG1PWM, kSG1Phase
  aSG1FLp moogladder aSG1,kSG1FilterLpF * kSG1EnvFilter,kSG1FilterLpR
  aSG1FHp bqrez aSG1FLp, kSG1FilterHpF * kSG1EnvFilter, kSG1FilterHpR, 1
  ;outs aSG1FHp * 0.1, aSG1FHp * 0.1
  gaSG1Output = aSG1FHp
  chnset gaSG1Output, "SG1Output"
  aSG1Out chnget "SG1Output"
  outs aSG1Out, aSG1Out 
  
endin

but this one does not

instr 1
...
aSG1 vco2 p5*kSG1EnvAmp, p4, iSG1wav, kSG1PWM, kSG1Phase
  aSG1FLp moogladder aSG1,kSG1FilterLpF * kSG1EnvFilter,kSG1FilterLpR
  aSG1FHp bqrez aSG1FLp, kSG1FilterHpF * kSG1EnvFilter, kSG1FilterHpR, 1
  ;outs aSG1FHp * 0.1, aSG1FHp * 0.1
  gaSG1Output = aSG1FHp
  chnset gaSG1Output, "SG1Output"
 
endin
instr 2
  aSG1Out chnget "SG1Output"
  outs aSG1Out, aSG1Out 
endin

PS: I installed the latest beta version, the newer ones failed to build, still same problem :frowning:

You’re not starting the other instruments. Only instrument 1 is being triggered to play. Take a look at the following simple example. Note that you should clear the channel too, just to be on the safe side.
chnsetGet.csd (735 Bytes)

p.s. I couldn’t run your instrument because the GUI is too large :hear_no_evil: On my laptop, the plugin windows takes up more space that I have available…

do you call my synth fat ?
HOW DAR… Oh wait this is a compliment for a synthesizer :smiley:

yeap that did the trick. Thanks looks like I need to study how orchestra files work too.

Wait a sec , your laptop monitor is less that 800x800 that is less than a modern smartphone , what kind of laptop is this ?

Actually, its 1920 x 1080, DPI. I think the DPI thing is the problem but I need to look into it. Better to think of your synth a phat :wink:

1 Like