100% found this document useful (1 vote)
918 views3 pages

Audiveris

This plugin runs the Audiveris optical music recognition software on a supplied PDF file to generate a MusicXML file. It uses the Audiveris Java application, so Java needs to be installed. The plugin displays a progress dialog and logs during conversion. On success, it loads the generated MusicXML into MuseScore.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
918 views3 pages

Audiveris

This plugin runs the Audiveris optical music recognition software on a supplied PDF file to generate a MusicXML file. It uses the Audiveris Java application, so Java needs to be installed. The plugin displays a progress dialog and logs during conversion. On success, it loads the generated MusicXML into MuseScore.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

//============================================================================= // Audiveris plugin // // This plugin asks for a PDF and run audiveris on the command line // java

needs to be in the path. And you need to modify audiverisHome below. // // Copyright (C)2008 Werner Schweer and others // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //============================================================================= /*********** MODIFY THIS VALUE *****************/ var audiverisHome = "D:/Audiveris4.1beta"; /*********** MODIFY THIS VALUE *****************/ var xmlFile; var form; var audiveris; //------------------------------------------------------------------// init //------------------------------------------------------------------function init() { } //------------------------------------------------------------------// run //------------------------------------------------------------------function run() { var settings = new QSettings("MuseScore", "AudiverisPlugin"); var defaultOpenDir = settings.value("defaultOpenDir", QDir.homePath()); var filename = QFileDialog.getOpenFileName(this, qsTr("MuseScore: Load PDF Fil e"), defaultOpenDir , "All supported files (*.pdf *.png *.jpg *.jpeg *tif *.tiff *.bmp);;PDF f iles (*.pdf);;PNG images (*.png);;JPG images (*.jpg *.jpeg);;TIF images (*.tif * .tiff);;BMP images (*.bmp)"); if(filename){ var file = new QFileInfo(filename); var logFile = file.canonicalPath() + "/" + file.baseName() + ".log"; xmlFile = file.canonicalPath() + "/" + file.baseName() + ".xml"; //save path settings.setValue("defaultOpenDir", file.canonicalPath()); settings.sync(); //See http://doc.qt.nokia.com/latest/qprocess.html var args = [

"-Xms512M", "-Xmx512M", //"-Dstdouterr="+logFile, "-jar", audiverisHome + "/dist/audiveris-4.1beta.jar", "-batch", "-option", "omr.log.Logger.printStackOnWarning=TRUE", "-input", filename, "-export", xmlFile ]; audiveris = new QProcess(); audiveris.error.connect(processingError); audiveris['finished(int)'].connect(processingFinished); audiveris.readyReadStandardOutput.connect(logOutput); audiveris.readyReadStandardError.connect(logError); //open dialog openProgressDialog(); audiveris.start("java", args ); } } function openProgressDialog() { var loader = new QUiLoader(null); var file = new QFile(pluginPath + "/audiverisProgress.ui"); file.open(QIODevice.OpenMode(QIODevice.ReadOnly, QIODevice.Text)); form = loader.load(file, null); form.setWindowFlags(Qt.CustomizeWindowHint); form.cancelButton.clicked.connect(closeProgressDialog); form.show(); } function closeProgressDialog() { if(audiveris.state().toString() == "Running") audiveris.close(); form.close(); } function logOutput() { var log = audiveris.readAllStandardOutput(); form.logTextEdit.appendPlainText(log); } function logError() { var newValue = form.progressBar.value + 10; form.progressBar.value = (newValue > 100 ? 0 : newValue); var log = audiveris.readAllStandardError(); form.logTextEdit.appendPlainText(log); } function processingError(error) { form.cancelButton.text = qsTr("Close"); form.label.text = "<font color='red'>" + qsTr("Conversion failed!")+ "</font>" ; form.windowTitle = qsTr("Conversion failed");

form.progressBar.value = 0; } function processingFinished(error) { form.cancelButton.text = qsTr("Close"); var fixml = new QFileInfo(xmlFile); if(fixml.exists()) { form.label.text = qsTr("Conversion successful"); form.windowTitle = qsTr("Conversion successful"); form.progressBar.value = 100; var score = new Score(); score.load(xmlFile); } else { form.label.text = "<font color='red'>" + qsTr("Conversion failed: No Music XML file generated") + "</font>"; form.windowTitle = qsTr("Conversion failed"); form.progressBar.value = 0; } } var mscorePlugin = { menu: 'Plugins.Audiveris', init: init, run: run }; mscorePlugin;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy