test sco/orc

From: Steven Curtin (sdcurtin@lucent.com)
Date: Thu Jun 04 1998 - 11:54:01 EDT


Hi all-
I've been doing a little SAOL programming and Eric would prefer that I keep
my questions/comments public so that everybody may share, so here they are:

Below is a couple of test instruments. Basically what I'd like to get
going is two things- one of them a looping stepped control function similar
to an analog sequencer, the other one parameter control by passing values
through a global variable. What I've found is this:

For some reason the global value of 'sinefreq' is not changing. I would
think that it would written into inside the freq_control instrument and
then affect the frequency of sine_tone.

I tried doing a repeating step function by filling a table with step values
and then playing it out with oscil. The problem with oscil is that it
expects to interpolate unless the phase accumulator always lands on the
integer values of the table. This is probably the reason for the oscil vs
oscili opcodes in Csound. Maybe this can be an argument in SAOL?

One other way of having a repeating step or control function in csound is
the reinit statement. Is there some equivalent to this so I can make a
repeating function with the aline statement below.

Thanks in advance for any advice- inquiring minds want to know!

test.saol:

global {
  srate 8000;
  krate 200;
  outchannels 2;

  table t(harm,2048,1.0);
  asig sinefreq;

}

instr sine_tone(cfreq,amp) {
  asig vibfreq,a,b,aleft,aright,afreq,seqcv,seqcv2;
  ksig env;
  imports table t;
  imports asig sinefreq;
  table seqloop(step,-1,0,10,1,50,2,20,3,80,4,40,5);
   
  seqcv = oscil(seqloop,0.5) * 10;
  seqcv2 = aline(10,.2,10,0,50,.3,50,0,20,.1,20,0,80,.4,80) * 100;
  afreq = sinefreq + cfreq + seqcv2 + seqcv;
  a = my_osc(t,afreq,amp);
  aleft = a;
  aright = a;
  output(aleft,aright);
  }

instr freq_control(cfreq,amp) {
  imports asig sinefreq;
  
  sinefreq = cfreq;
  }

aopcode my_osc(table t,xsig freq, ivar amp) {
  asig res;
  
  res = oscil(t,freq) * amp;
  return(res);
}

test.sasl:
0.0 sine_tone 1.0 100 0.5
0.0 freq_control 0.1 300 0.5
0.2 freq_control 0.1 400 0.5
0.3 freq_control 0.1 200 0.5
0.5 freq_control 0.1 500 0.5
0.7 freq_control 0.1 200 0.5
1.0 end

Steven Curtin

--------------------------------------------------------------
Steven Curtin
http://www.emf.org/people_curtin.html
Lucent Technologies - Bell Labs Innovations
rm. 3C-208, 200 Laurel Ave S
Middletown, NJ 07748-4801 U S A
ph: (732)957-2996 fax: (732)957-6878
--------------------------------------------------------------



This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 11:46:32 EST