problem with csound.SetChannel

View: New views
1 Messages — Rating Filter:   Alert me  

problem with csound.SetChannel

by simdax :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, i'm a new user of csound and i have a problem that i can't resolve :

i'm trying to use the bus channel for my work, but something strange happens

if i use the rory walsh code, it works, but if i use the code in C++, Cabbage Style, it does'nt.

 int hold=1;                                                
  /*create a Csound object*/                                
  Csound* csound = new Csound;                              
  /*pre-compile instance of csound*/                        
  csound->PreCompile();
  /*compile instance of csound*/                            
  csound->Compile("test.csd");                              
  /* create a CsoundPerfThread object */                    
  CsoundPerformanceThread* perf =                            
    new CsoundPerformanceThread(csound->GetCsound());          
  /* start csound thread */
  perf->Play();
  /* pause program, it won't stop performing until the user presses 0 */
  while(hold){
    cin >> hold;
    csound->SetChannel("pitch", (MYFLT)hold);
  }
  /* stop thread */
  perf->Stop();
  /*delete instance of csound*/
  delete csound;

if i use printk2, my computer still prints "0.00000"

Thank you for your help and sorry for my english