Package nu.xom

Examples of nu.xom.Element.appendChild()


    root = new Element("score-partwise");
   
      Element elID = new Element("identification");
      Element elCreator = new Element("creator");
      elCreator.addAttribute(new Attribute("type", "software"));
      elCreator.appendChild("JFugue MusicXMLRenderer");
      elID.appendChild(elCreator);
      root.appendChild(elID);
   
      //  add an empty score-part list here (before any parts are added)
      //  score-parts are added to this as they are generated
View Full Code Here


        //  assemble attributes element
        Element elAttributes = new Element("attributes");
        if (bAddDefaults)
        {  //  divisions - 4 per beat
          Element elDivisions = new Element("divisions");
          elDivisions.appendChild(Integer.toString(MUSICXMLDIVISIONS));
          elAttributes.appendChild(elDivisions);
          //  beats - 1 beat per measure
          Element elTime = new Element("time");
          Element elBeats = new Element("beats");
          elBeats.appendChild(Integer.toString(4));
View Full Code Here

          elDivisions.appendChild(Integer.toString(MUSICXMLDIVISIONS));
          elAttributes.appendChild(elDivisions);
          //  beats - 1 beat per measure
          Element elTime = new Element("time");
          Element elBeats = new Element("beats");
          elBeats.appendChild(Integer.toString(4));
          elTime.appendChild(elBeats);
          Element elBeatType = new Element("beat-type");
          elBeatType.appendChild(Integer.toString(4));
          elTime.appendChild(elBeatType);
          elAttributes.appendChild(elTime);
View Full Code Here

          Element elTime = new Element("time");
          Element elBeats = new Element("beats");
          elBeats.appendChild(Integer.toString(4));
          elTime.appendChild(elBeats);
          Element elBeatType = new Element("beat-type");
          elBeatType.appendChild(Integer.toString(4));
          elTime.appendChild(elBeatType);
          elAttributes.appendChild(elTime);
        }
        if (bAddDefaults)
        {  //  Clef - assumed to be treble clef
View Full Code Here

        }
        if (bAddDefaults)
        {  //  Clef - assumed to be treble clef
          Element elClef = new Element("clef");
          Element elSign = new Element("sign");
          elSign.appendChild("G");
          Element elLine = new Element("line");
          elLine.appendChild("2");
          elClef.appendChild(elSign);
          elClef.appendChild(elLine);
          elAttributes.appendChild(elClef);
View Full Code Here

        //  Clef - assumed to be treble clef
          Element elClef = new Element("clef");
          Element elSign = new Element("sign");
          elSign.appendChild("G");
          Element elLine = new Element("line");
          elLine.appendChild("2");
          elClef.appendChild(elSign);
          elClef.appendChild(elLine);
          elAttributes.appendChild(elClef);
        }
        //  add the attributes to the measure
View Full Code Here

      Attribute atPart = new Attribute("id", voice.getMusicString());
      elCurScorePart.addAttribute(atPart);
      //  empty part name - Finale ignores it and Sibelius gets it wrong
      elCurScorePart.appendChild(new Element("part-name"));
      Element elPL = root.getFirstChildElement("part-list");
      elPL.appendChild(elCurScorePart);
     
      //  start a new part - note that the score-part and the part have the
      //  same id attribute
      elCurPart = new Element("part");
      Attribute atPart2 = new Attribute(atPart);
View Full Code Here

    //  newVoice
   
    public void instrumentEvent(Instrument instrument)
    {
      Element elInstrName = new Element("instrument-name");
      elInstrName.appendChild(instrument.getInstrumentName());

      Element elInstrument = new Element("score-instrument");
      elInstrument.addAttribute(new Attribute("id", Byte.toString(instrument.getInstrument())));
      elInstrument.appendChild(elInstrName);
    }
View Full Code Here

      Element elInstrName = new Element("instrument-name");
      elInstrName.appendChild(instrument.getInstrumentName());

      Element elInstrument = new Element("score-instrument");
      elInstrument.addAttribute(new Attribute("id", Byte.toString(instrument.getInstrument())));
      elInstrument.appendChild(elInstrName);
    }
   
    public void tempoEvent(Tempo tempo)
    {  doTempo(tempo);
    }
View Full Code Here

    elDirection.addAttribute(new Attribute("placement", "above"));
    Element elDirectionType = new Element("direction-type");
    Element elMetronome = new Element("metronome");
    Element elBeatUnit = new Element("beat-unit");
    //  assume quarter note beat unit
    elBeatUnit.appendChild("quarter");
    Element elPerMinute = new Element("per-minute");
    Integer iBPM = new Float(PPMtoBPM(tempo.getTempo())).intValue();
    elPerMinute.appendChild(iBPM.toString());
    //  assemble all the pieces
    elMetronome.appendChild(elBeatUnit);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.