positive integer control Johannes Taelman Edited by Jaffasplaffa BSD ctrl.axh note to a scale Mark Harris BSD note scale.axh PExch[PARAM_INDEX_attr_legal_name_b12],attr_table.array[0+PRESET],0xFFFD); } prev=PRESET; attr_table.array[0+PRESET]=param_b12; _latch = inlet_latch; if (_scaleVal != param_b12) { // calculate new scale parameters as they changed // optimize for evaluation int x=0; for(int i=0;i<12;i++) { if(param_b12 & (1 << i)) { _scale[x++] = i; } } _nscale = x; } if (_note != inlet_note || _offset != inlet_offset || _scaleVal != param_b12 || _tonic != inlet_tonic) { _note = inlet_note; _tonic = inlet_tonic; _offset = inlet_offset; _scaleVal = param_b12; int mn = (inlet_note >> 21) + 64 - _offset; int8_t oct = mn / _nscale; int8_t n = mn % _nscale; _out = ((oct * 12 + _scale[n] + _tonic ) - 64 ) << 21; } outlet_note = _out;]]> PExch[PARAM_INDEX_attr_legal_name_b12],nval,0xFFFD); } ]]> no 227 109 1034 637