Package org.lilypondbeans.jccparser

Examples of org.lilypondbeans.jccparser.ASTKey


        }
        //key
        for (int s = 0; s < score.getAllKeys().size(); s++) {
            Iterator<ASTKey> keys = score.getAllKeys().get(s).iterator();
            while (keys.hasNext()) {
                ASTKey cl = keys.next();
                Point pt = getPos(cl, s + 1);
                cl.getlayoutObject().draw(pt.x, pt.y, gr);
            }
        }
        //lineBegin
        for (int s = 0; s < allLineBegins.size(); s++) {

            ASTLineBegin cl = allLineBegins.get(s);
            Point pt = getPos(cl);//, cl.getParentContext().getContext(ASTContext.TYPE_STAFF)s + 1);
            cl.getlayoutObject().draw(pt.x, pt.y, gr);
        }
    }
View Full Code Here


                clef.setParentContext(score.getAllStaff().get(s));
                score.registerClef(clef, score.getAllStaff().get(s));
                calcLayout(new LayoutEnv(), clef);
            }
            //key for each line
            ASTKey key = new ASTKey(ParserTreeConstants.JJTKEY);//violin
            key.setBeattime(beatTime);
            if (score.getAllKeys().get(s).size() > 0) {
                ASTKey cur2 = score.getAllKeys().get(s).floor(key);
                key.signature = cur2.signature;
                key.generated = true;
                key.clef = clef.clef;
                if (!onlyLineBegin) {
                    key.setParentContext(score.getAllStaff().get(s));
View Full Code Here

        }
        //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

    public void play(ASTPitch pitch) {
        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;
            MidiPlayer.defaultPlayer.play(okt * 12 + tons[pitch.noteHeight] + globalvz + 60 + pitch.noteSignature);
            // MidiPlayer.defaultPlayer.play(pitch.absoluteHeight + 60);
        }
View Full Code Here

    public static boolean testLayout(LayoutEnv env, SimpleNode node) {
        if (node.id != ParserTreeConstants.JJTKEY) {
            return false;
        }
        ASTKey con = (ASTKey) node;
        KeyLayout layout = new KeyLayout();
        con.setLayoutObject(layout);
        layout.priority = 40;
        layout.distanceRight = 10 + BigInteger.valueOf(con.signature).abs().intValue() * 8;
        return true;

    }
View Full Code Here

        }
        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]);
            pitch.notename = doc.language.toNoteName(noteHeight, globalvz);
        }
        String s = pitch.notename;//st;//asString();
        if (!chordMode && node.jjtGetParent().id == ParserTreeConstants.JJTCHORD)//leave Chord
        {
View Full Code Here

TOP

Related Classes of org.lilypondbeans.jccparser.ASTKey

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.