lib/instruments/tonewheel.js
function toState (preset) {
  if (preset) {
    const norm = (preset.replace(/[^012345678]/g, "") + "000000000").slice(0, 9)
    const gains = norm.split("").map((n) => Math.abs(+n / 8))
    return {
      bank: { gains }
    }
  }
}
function toState (preset) {
  if (preset) {
    const norm = (preset.replace(/[^012345678]/g, "") + "000000000").slice(0, 9)
    const gains = norm.split("").map((n) => Math.abs(+n / 8))
    return {
      bank: { gains }
    }
  }
}
function toState ( preset ) { if ( preset ) { const norm = ( preset . replace ( / [^012345678] / g , "" ) + "000000000" ) . slice ( 0 , 9 ) const gains = norm . split ( "" ) . map ( ( n ) => Math . abs ( + n / 8 ) ) return { bank : { gains } } } }
Given a preset, return a state fragment
Given a preset return a state fragment