microscl fpb

microscaler with on off switch Fader version
Author: philoop
License: GPL
Github: phi/harmony/microscl fpb.axo

Inlets

frac32.bipolar pitch

Outlets

frac32.bipolar out

Parameters

frac32.s.mapvsl C

frac32.s.mapvsl Cis

frac32.s.mapvsl D

frac32.s.mapvsl Dis

frac32.s.mapvsl E

frac32.s.mapvsl F

frac32.s.mapvsl Fis

frac32.s.mapvsl G

frac32.s.mapvsl Gis

frac32.s.mapvsl A

frac32.s.mapvsl Ais

frac32.s.mapvsl B

bool32.tgl on

Declaration
int o;
int ntrig;
int latch;
int8_t octave;
int8_t semitone;
Init
o = 0;
Control Rate
int32_t pitch = (inlet_pitch >> 21) + 48;
octave = pitch / 12;
semitone = pitch - octave * 12;

switch (semitone > 0 ? semitone : 0) {
case 0:
  o = (param_C >> 7);
  break;
case 1:
  o = (param_Cis >> 7);
  break;
case 2:
  o = (param_D >> 7);
  break;
case 3:
  o = (param_Dis >> 7);
  break;
case 4:
  o = (param_E >> 7);
  break;
case 5:
  o = (param_F >> 7);
  break;
case 6:
  o = (param_Fis >> 7);
  break;
case 7:
  o = (param_G >> 7);
  break;
case 8:
  o = (param_Gis >> 7);
  break;
case 9:
  o = (param_A >> 7);
  break;
case 10:
  o = (param_Ais >> 7);
  break;
case 11:
  o = (param_B >> 7);
  break;
default:
  o = (param_C >> 7);
  break;
}

o = (param_on) ? (inlet_pitch + o) - 4 : inlet_pitch;
outlet_out = o;

Privacy

© 2024 Zrna Research