def qmf.ev

emerging-ezaudio@0.4.0.0 · src/mp3_syn.bend:1492

import emerging-ezaudio@0.4.0.0/src/mp3_syn.bend as Mp3Syn
import Base

1492# one even delay sample and the odd slot kept from the carried tail.
1493# hop is the pairs still to come after this one. The sample was read at ii.
1494def qmf.ev(hop: Nat, old: List<&2, F32>, got: La, +ii: U32, acc: List<&2, F32>) -> List<&2, F32>:
1495  match hop old got:
1496    case 0n +_e <> +odd <> _tl La{lin, +cur}:
1497      match lin:
1498        case _lin:
1499          List.reverse(&2, F32, odd <> (cur <> acc))
1500    case 1n+p +_e <> +odd <> tl La{lin, +cur}:
1501      qmf.ev(p, tl, ln.at(lin, u.add(ii, 2)), u.add(ii, 2), odd <> (cur <> acc))
1502    case _ _ La{lin, _v}:
1503      match lin:
1504        case _lin:
1505          List.reverse(&2, F32, acc)

Uses (8)

Used by (1)