Package org.lilypondbeans.jccparser

Examples of org.lilypondbeans.jccparser.ASTDocument


        } 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);
View Full Code Here


        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;
        NoteEditor ed = NoteEditor.create(pitch);
        ASTDocument sc = (ASTDocument) el.getParentContext().getContext(ASTContext.TYPE_DOCUMENT);
        try {
            int vz[] = sc.language.fromNoteName(ed.pitch.notename);
            ed.pitch.notename = sc.language.toNoteName(vz[0], vz[1] + 1);
            pitch.noteSignature++;
            ((PitchLayout) pitch.getlayoutObject()).signatureToPaint = ((PitchLayout) pitch.getlayoutObject()).signatureToPaint + 1;
View Full Code Here

        if (el == null || el.id != ParserTreeConstants.JJTPITCH) {
            return;
        }
        ASTPitch pitch = (ASTPitch) el;
        NoteEditor ed = NoteEditor.create(pitch);
        ASTDocument sc = (ASTDocument) el.getParentContext().getContext(ASTContext.TYPE_DOCUMENT);
        try {
            int vz[] = sc.language.fromNoteName(ed.pitch.notename);
            ed.pitch.notename = sc.language.toNoteName(vz[0], vz[1] - 1);
            pitch.noteSignature--;
            ((PitchLayout) pitch.getlayoutObject()).signatureToPaint = ((PitchLayout) pitch.getlayoutObject()).signatureToPaint - 1;
View Full Code Here

            } else {
                play(ed.insertPitch(note, akkord, el));
            }

        } else {
            ASTDocument doc = (ASTDocument) el.jjtGetParent().getParentContext().getContext(ASTContext.TYPE_DOCUMENT);
            int sign = ASTKey.getPitchSignature(el.keySignature)[note];
            String s = doc.language.toNoteName(note, sign);
            NetbeansTextEditor ne = NetbeansTextEditor.getInstance();
            String space = "";
            String k = ne.getText(ne.getPositionEnd(el.jjtGetLastToken()) - 1, 1);
View Full Code Here

                    //println(file + "\\" + f);
                    try {
                        // convert(file + "\\" + f);
                        compile(sFile);
                        //readMidiLen(sFile);
                        ASTDocument doc = parse(sFile);
                                    ASTScore score = reparse(sFile, doc);
                                    testMidi(sFile, score);
                        // parse(file + "\\" + f);
                        //  new Main().parse(file + "\\" + f);
                    } catch (Exception ex) {
View Full Code Here

    //144 quarter notes => 144/4
    //whole Notes per minute

    private void parseTempoWholesPerMinute() {
        //tempoWholesPerMinute = #(ly:make-moment 144 4)
        ASTDocument doc = (ASTDocument) score.getContext(ASTContext.TYPE_DOCUMENT);
        ASTDeclaration dec = doc.getDeclarations().get("tempoWholesPerMinute");
        double tempo = 0;
        if (dec == null) {
//         parseMidiScore(score)*(double)60;
         //   tempo=100/4;
            if (tempo == 0) {
View Full Code Here

            String text = "{" + doc.getText(pos, len).trim() + "}";//"a" is parsed as declaration
            ret.type = TYPE_NOTE;
            ret.node = pitch;
            ByteArrayInputStream in = new ByteArrayInputStream(text.getBytes());
            Parser p = new Parser(in);
            ASTDocument ll = p.Document();
            ret.pitch = (ASTPitch) ll.jjtGetChild(0).jjtGetChild(0);
            int x = text.length() - 1;
            ret.rest = "";

        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

            pitch.durationDots = 0;
            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) {
View Full Code Here

TOP

Related Classes of org.lilypondbeans.jccparser.ASTDocument

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.