net.cscott.sdr.calls.transform
Class RemoveIn
java.lang.Object
net.cscott.sdr.calls.transform.TransformVisitor<Fraction>
net.cscott.sdr.calls.transform.RemoveIn
public class RemoveIn
- extends TransformVisitor<Fraction>
Remove In
s from a call tree by pushing them down and adjusting
Prim
timing. We use the "inherent" times given by a
BeatCounter
to proportionally allocate the available beats from
the top down.
- Tests:
Eliminate In from 1/2 DOSADO:
js> importPackage(net.cscott.sdr.calls.ast)
js> a = Apply.makeApply("_fractional", Apply.makeApply("1/2"), Apply.makeApply("dosado"))
(Apply _fractional (Apply 1/2) (Apply dosado))
js> def = a.expand()
(In 3 (Opt (From [FACING DANCERS] (Seq (Prim -1, 1, none, 1) (Prim 1, 1, none, 1)))))
js> RemoveIn.removeIn(def)
(Opt (From [FACING DANCERS] (Seq (Prim -1, 1, none, 1 1/2) (Prim 1, 1, none, 1 1/2))))
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
removeIn
public static Comp removeIn(Comp c)
- Main method: pass in a
Comp
, and get out a Comp
without In
nodes.
visit
public Seq visit(Seq s,
Fraction f)
- Overrides:
visit
in class TransformVisitor<Fraction>
visit
public Prim visit(Prim p,
Fraction scale)
- Overrides:
visit
in class TransformVisitor<Fraction>
visit
public Apply visit(Apply a,
Fraction scale)
- Overrides:
visit
in class TransformVisitor<Fraction>
visit
public Part visit(Part part,
Fraction scale)
- Overrides:
visit
in class TransformVisitor<Fraction>
visit
public Par visit(Par p,
Fraction f)
- Overrides:
visit
in class TransformVisitor<Fraction>
visit
public Comp visit(In in,
Fraction f)
- Overrides:
visit
in class TransformVisitor<Fraction>
Copyright © 2006-2009 C. Scott Ananian