Package com.music.tools.SongDBAnalyzer

Examples of com.music.tools.SongDBAnalyzer.NoteContentHandler


    public static void main(String[] args) throws Exception {
        File file = new File("C:\\workspace\\music\\analysis\\db\\" + "21.xml");

        XMLReader xr = XMLReaderFactory.createXMLReader();
        NoteContentHandler handler = new NoteContentHandler();
        xr.setContentHandler(handler);
        try (Reader reader = new FileReader(file)) {
            try {
                xr.parse(new InputSource(reader));
            } catch (Exception ex) {
                System.out.println(file.getName());
                throw ex;
            }
        }
        List<NoteElement> noteList = handler.getNotes();
        List<Integer> pitches = new ArrayList<Integer>();
        for (NoteElement element : noteList) {
            if (element != null && !element.isRest()) {
                pitches.add(60 + element.getScaleDegree() + element.getOctave() * 7);
            }
View Full Code Here

TOP

Related Classes of com.music.tools.SongDBAnalyzer.NoteContentHandler

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.