microscl2

microscaler with on off switch
Author: philoop
License: GPL
Github: phi/harmony/microscl2.axo

Inlets

frac32.bipolar pitch

Outlets

frac32.bipolar out

Parameters

bool32.tgl on

frac32.s.map C

frac32.s.map Cis

frac32.s.map D

frac32.s.map Dis

frac32.s.map E

frac32.s.map F

frac32.s.map Fis

frac32.s.map G

frac32.s.map Gis

frac32.s.map A

frac32.s.map Ais

frac32.s.map B

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