Porting instruments from Csound

From: Eric Scheirer (eds@media.mit.edu)
Date: Tue Feb 10 1998 - 12:12:30 EST


Porting instruments from Csound to SAOL is easy, especially
if there's not a lot of csound-y things like harmonizers
in it. Here's an example, an 'acid synth' analog-like
sound by Marc Resibois (used without permission -- I have
to steal other people's instruments because mine suck).

A tool to do this automatically, or to help automate
it, would be a great addition to the SAOL world, and
a great way to learn about SAOL quickly. Anyone want
to give it a shot?

You can find the original at
 
http://music.dartmouth.edu/~dupras/wCsound/orc+sco/AnalogAcidBleeps.orc+sco

----------------

global {
  srate 32000;
  krate 320;
}

// acid.saol:
//
// ported by Eric Scheirer from Marc Resibois's 'AAB' csound instrument

instr AAB(mpch,acid) {
  ivar acidfactor,cps,st,sp,pi;
  ksig env, fastpch;
  asig basic, fast, tri, ph;

  // i-time
  acidfactor = (exp(acid) - 1) / exp(1);
  st = 4+100*acidfactor;
  sp = 100*acidfactor;
  cps = cpsmidi(mpch);
  pi = 3.1415926;

  // k-time
  env = kline(0,0.02,1,dur-0.06,1,0.04,0) * 0.15;
  fastpch = kline(st,1,st-sp,dur-1,st-sp);

  // a-time

  ph = aphasor(cps);
  tri = 1 - ph;

  basic = sin(pi / 2 * (3 * ph + 1));
  fast = sin(2 * pi * fastpch * ph + pi / 2);

  output(env * (2 * fast * tri - tri - basic));
}

------------------

Here's a little score to test it with:

0 AAB 0.18 41 0
0.1 AAB 0.18 40 0
0.2 AAB 0.18 41 0.05
0.3 AAB 0.18 40 0.05
0.4 AAB 0.18 44 0.1
0.5 AAB 0.18 43 0.0
0.6 AAB 0.18 43 0.15
0.7 AAB 0.18 42 0.15
0.8 AAB 0.18 41 0.2
0.9 AAB 0.18 40 0.2
1.0 AAB 0.18 41 0.25
1.1 AAB 0.18 40 0
1.2 AAB 0.18 44 0.3
1.3 AAB 0.18 43 0.3
1.4 AAB 0.18 43 0.35
1.5 AAB 0.18 42 0.35
1.6 AAB 0.18 41 0.4
1.7 AAB 0.18 40 0.1
1.8 AAB 0.18 41 0.45
1.9 AAB 0.18 40 0.5
2.0 AAB 0.18 44 0.6
2.1 AAB 0.18 43 0.6
2.2 AAB 0.18 43 0.7
2.3 AAB 0.18 42 0.1
2.4 AAB 0.18 41 0.8
2.5 AAB 0.18 40 0.8
2.6 AAB 0.18 41 0.9
2.7 AAB 0.18 40 0.9
2.8 AAB 0.18 44 1.0
2.9 AAB 0.18 43 0.1
3.0 AAB 0.18 43 0.5

-- 
+-----------------+
|  Eric Scheirer  |A-7b5 D7b9|G-7 C7|Cb   C-7b5 F7#9|Bb  |B-7 E7|
|eds@media.mit.edu|      < http://sound.media.mit.edu/~eds >
|  617 253 0112   |A A/G# F#-7 F#-/E|Eb-7b5 D7b5|Db|C7b5 B7b5|Bb|
+-----------------+



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