|
sdr 0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.cscott.sdr.calls.transform.TransformVisitor<Fraction>
net.cscott.sdr.calls.transform.RemoveIn
public class RemoveIn
Push Ins down a call tree and adjust
Prim timing where possible. Only push the In down one level,
so we don't end up doing more work than we need to on the untaken side of an
Opt. If we end up at a Seq of Prims, use the
"inherent" times given by a BeatCounter to proportionally allocate
the available beats from the top down.
js> importPackage(net.cscott.sdr.calls) js> importPackage(net.cscott.sdr.calls.ast) js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> a = new Apply(new Expr("_fractional", Expr.literal("1/2"), Expr.literal("dosado"))) (Apply (Expr _fractional '1/2 'dosado)) js> def = a.evaluator(ds).simpleExpansion() (In (Expr _multiply num '1/2 '6) (Opt (From 'ANY (Seq (Part 'INDIVISIBLE '1 (Seq (Apply '_mixed touch))) (Part 'DIVISIBLE '3 (In (Expr _multiply num '1/3 '6) (Opt (From 'RH MINIWAVE (Seq (Prim 1, 1, none, 1, SASHAY_FINISH)))))))))) js> def = RemoveIn.removeIn(ds, def) (Opt (From 'ANY (In '3 (Seq (Part 'INDIVISIBLE '1 (Seq (Apply '_mixed touch))) (Part 'DIVISIBLE '3 (In (Expr _multiply num '1/3 '6) (Opt (From 'RH MINIWAVE (Seq (Prim 1, 1, none, 1, SASHAY_FINISH)))))))))) js> def = RemoveIn.removeIn(ds, def.children.get(0).child) (Seq (Part 'INDIVISIBLE '1 (Seq (Apply (Expr _in '3/4 '_mixed touch)))) (Part 'DIVISIBLE '3 (Opt (From 'RH MINIWAVE (In '2 1/4 (Seq (Prim 1, 1, none, 1, SASHAY_FINISH)))))))
js> importPackage(net.cscott.sdr.calls) js> importPackage(net.cscott.sdr.calls.ast) js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined; js> a = AstNode.valueOf('(In \'1 (Seq (Part \'INDIVISIBLE \'1 (Seq (Prim 0, 1, none, 1) (Prim 0, 1, in 1/4, 1)))))') (In '1 (Seq (Part 'INDIVISIBLE '1 (Seq (Prim 0, 1, none, 1) (Prim 0, 1, in 1/4, 1))))) js> RemoveIn.removeIn(ds, a) (Seq (Part 'INDIVISIBLE '1 (Seq (Prim 0, 1, none, 1/2) (Prim 0, 1, in 1/4, 1/2))))
| Method Summary | |
|---|---|
static Comp |
removeIn(DanceState ds,
In in)
Main method: pass in a Comp, and get out a Comp
without In nodes. |
Apply |
visit(Apply a,
Fraction f)
|
Comp |
visit(In in,
Fraction f)
|
Opt |
visit(Opt o,
Fraction f)
|
Par |
visit(Par p,
Fraction f)
|
Prim |
visit(Prim p,
Fraction f)
|
Seq |
visit(Seq s,
Fraction f)
|
| Methods inherited from class net.cscott.sdr.calls.transform.TransformVisitor |
|---|
visit, visit, visit, visit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Comp removeIn(DanceState ds,
In in)
Comp, and get out a Comp
without In nodes.
public Seq visit(Seq s,
Fraction f)
visit in class TransformVisitor<Fraction>
public Prim visit(Prim p,
Fraction f)
visit in class TransformVisitor<Fraction>
public Apply visit(Apply a,
Fraction f)
visit in class TransformVisitor<Fraction>
public Par visit(Par p,
Fraction f)
visit in class TransformVisitor<Fraction>
public Opt visit(Opt o,
Fraction f)
visit in class TransformVisitor<Fraction>
public Comp visit(In in,
Fraction f)
visit in class TransformVisitor<Fraction>
|
sdr 0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||