Class MusicXmlParser
java.lang.Object
org.jfugue.parser.Parser
org.jfugue.integration.MusicXmlParser
Parses a MusicXML file, and fires events for
ParserListener
interfaces when tokens are interpreted. The ParserListener does
intelligent things with the resulting events, such as create music, draw
sheet music, or transform the data.
MusicXmlParser.parse can be called with a file name, File, InputStream, or
Reader- Author:
- E.Philip Sobolik, David Koelle (updates for JFugue 5), Richard Lavoie (Major rewriting)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intBPMtoPPM(float bpm) converts beats per minute (BPM) to pulses per minute (PPM) assuming 240 pulses per second In MusicXML, BPM can be fractional, soBPMtoPPMtakes a float argumentvoidparse()Parses a MusicXML file and fires events to subscribedParserListenerinterfaces.voidvoidparse(FileInputStream inputStream) voidvoidMethods inherited from class Parser
addParserListener, clearParserListeners, fireAfterParsingFinished, fireBarLineParsed, fireBeforeParsingStarts, fireChannelPressureParsed, fireChordParsed, fireControllerEventParsed, fireFunctionParsed, fireInstrumentParsed, fireKeySignatureParsed, fireLayerChanged, fireLyricParsed, fireMarkerParsed, fireNoteParsed, fireNotePressed, fireNoteReleased, firePitchWheelParsed, firePolyphonicPressureParsed, fireSystemExclusiveParsed, fireTempoChanged, fireTimeSignatureParsed, fireTrackBeatTimeBookmarked, fireTrackBeatTimeBookmarkRequested, fireTrackBeatTimeRequested, fireTrackChanged, getParserListeners, removeParserListener
-
Field Details
-
XMLtoJFchordMap
-
-
Constructor Details
-
MusicXmlParser
- Throws:
ParserConfigurationException
-
-
Method Details
-
parse
public void parse(String musicXmlString) throws nu.xom.ValidityException, nu.xom.ParsingException, IOException - Throws:
nu.xom.ValidityExceptionnu.xom.ParsingExceptionIOException
-
parse
public void parse(File inputFile) throws nu.xom.ValidityException, nu.xom.ParsingException, IOException - Throws:
nu.xom.ValidityExceptionnu.xom.ParsingExceptionIOException
-
parse
public void parse(FileInputStream inputStream) throws nu.xom.ValidityException, nu.xom.ParsingException, IOException - Throws:
nu.xom.ValidityExceptionnu.xom.ParsingExceptionIOException
-
parse
public void parse(Reader reader) throws nu.xom.ValidityException, nu.xom.ParsingException, IOException - Throws:
nu.xom.ValidityExceptionnu.xom.ParsingExceptionIOException
-
parse
public void parse()Parses a MusicXML file and fires events to subscribedParserListenerinterfaces. As the file is parsed, events are sent toParserListenerinterfaces, which are responsible for doing something interesting with the music data. the input is a XOM Document, which has been built previously- Throws:
Exception- if there is an error parsing the pattern
-
BPMtoPPM
public static int BPMtoPPM(float bpm) converts beats per minute (BPM) to pulses per minute (PPM) assuming 240 pulses per second In MusicXML, BPM can be fractional, soBPMtoPPMtakes a float argument- Parameters:
bpm-- Returns:
- ppm
-