Package org.lilypondbeans.jccparser

Examples of org.lilypondbeans.jccparser.ASTScore


        };
    }

    private void checkMidi() {
        try {
            ASTScore root = ASTScore.createFromFile(lyFileName, true);
            MidiPositions mid = new MidiPositions(root);
            mid.calc();

            SimpleMidiPlayer midi = view.pdfPanel.getMidiPlayer();
View Full Code Here


            pitch.durationInteger = 0;
        }
        NoteEditor neu = new NoteEditor();

        ASTDocument doc = (ASTDocument) node.getParentContext().getContext(ASTContext.TYPE_DOCUMENT);
        ASTScore score = (ASTScore) node.getParentContext().getContext(ASTContext.TYPE_SCORE);
        ASTKey toSearch = new ASTKey(0);
        toSearch.setBeattime(node.getBeattime());
        ASTKey k = score.getAllKeys().get(node.getParentContext().staff.number - 1).floor(toSearch);
        if (noteHeight == -9999) {
            pitch.setBreakType(ASTPitch.BREAK_TYPE_VISIBLE);
            pitch.notename = "r";
        } else {
            int globalvz = k == null ? 0 : (k.getPitchSignature(k.signature)[noteHeight]);
View Full Code Here

        } else {
            pdfDecoder.openPdfFile(currentFile);
        }
        gotoPage(1);
      
        ASTScore ast = ASTScore.createFromFile(lyFile, false);
        midPos = new MidiPositions(ast);
        midPos.calc();

    }
View Full Code Here

    public static boolean testLayout(LayoutEnv env, SimpleNode node) {
        if (node.id != ParserTreeConstants.JJTSCORE) {
            return false;
        }

        ASTScore score = (ASTScore) node;
        ScoreLayout layout = new ScoreLayout();
        score.setLayoutObject(layout);
        Iterator<ASTTime> times = score.getAllTime().iterator();
        while (times.hasNext()) {
            ASTTime t = times.next();
            if (t.generated) {
                score.layoutCalculator.calcLayout(env, t);
            }
        }
        //clef is printed in each line
        for (int s = 0; s < score.getAllClef().size(); s++) {
            Iterator<ASTClef> clefs = score.getAllClef().get(s).iterator();
            while (clefs.hasNext()) {
                ASTClef t = clefs.next();
                if (t.generated) {
                    score.layoutCalculator.calcLayout(env, t);
                }
            }
        }
        //key is printed in each line
        for (int s = 0; s < score.getAllKeys().size(); s++) {
            Iterator<ASTKey> keys = score.getAllKeys().get(s).iterator();
            while (keys.hasNext()) {
                ASTKey t = keys.next();
                if (t.generated) {
                    score.layoutCalculator.calcLayout(env, t);
                }
View Full Code Here

        return true;

    }

    public void draw(int xpos, int ypos, Graphics gr) {
        ASTScore node = (ASTScore) parent;
        if (node.id == ParserTreeConstants.JJTSCORE) {
            ASTScore score =  node;

        }
    }
View Full Code Here

        ASTContext staff = voice.getContext(ASTContext.TYPE_STAFF);

        int v = staff.childContexts.indexOf(voice);
        int s = staff.number - 1;
        ASTContext toSearch = null;
        ASTScore score = (ASTScore) el.getParentContext().getContext(ASTContext.TYPE_SCORE);
        LayoutCalculator calc = score.layoutCalculator;
        int line = calc.getLine(el);
        if (v > 0) {
            toSearch = staff.childContexts.get(v - 1);
        } else if (s > 0) {
View Full Code Here

    selectNext(parent,x,-1);
    }*/
    private void selectNext(ASTContext parent, int x, int line, boolean onlyPitches) {
        int best = Integer.MAX_VALUE;
        SimpleNode found = null;
        ASTScore score = ((ASTScore) parent.getContext(ASTContext.TYPE_SCORE));
        Iterator<SimpleNode> it = score.layoutCalculator.getAllLayoutObjects().iterator();
        while (it.hasNext()) {
            SimpleNode nd = it.next();
            if (nd.getParentContext() == parent
                    && nd.getlayoutObject() != null
View Full Code Here

            if (line >= calc.getLinePosition().length) {
                return;
            } else {
                line++;
                ASTScore score = (ASTScore) el.getParentContext().getContext(ASTContext.TYPE_SCORE);

                //  int nx = calc.getLinePosition()[line][0].x - calc.getLinePosition()[line - 1][0].x;
                //  nx = UpdateNodeTask.getInstance().getLastCurrent().getlayoutObject().x + nx;
                int nx = (int) UpdateNodeTask.getInstance().getLastCurrent().getlayoutObject().centre.getX();
                ASTContext con = score.childContexts.get(0).childContexts.get(0);
View Full Code Here

        if (pitch.isBreake()) {
            MidiPlayer.defaultPlayer.stop();
        } else {
            ASTKey toSearch = new ASTKey(0);
            toSearch.setBeattime(pitch.getBeattime());
            ASTScore score = (ASTScore) pitch.getParentContext().getContext(ASTContext.TYPE_SCORE);
            ASTKey k = score.getAllKeys().get(pitch.getParentContext().staff.number - 1).floor(toSearch);
            ASTDocument doc = (ASTDocument) pitch.getParentContext().getContext(ASTContext.TYPE_DOCUMENT);

            int globalvz = k == null ? 0 : (k.getPitchSignature(k.signature)[pitch.noteHeight]);
            int tons[] = new int[]{0, 2, 4, 5, 7, 9, 11};
            int okt = (pitch.absoluteHeight - pitch.noteHeight) / 7;
View Full Code Here

            debugContext(con, prefix + " ");
        }
    }

    public void parse(String file) throws Exception {
        ASTScore root =ASTScore.createFromFile(file, true);// dialog.setFile(file);
        dialog.start();
        System.out.println("\nProgram parsed successfully.\n");
        if (dump) {
            root.dump("");
        }
    }
View Full Code Here

TOP

Related Classes of org.lilypondbeans.jccparser.ASTScore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.