Skip to content

Instantly share code, notes, and snippets.

@lasconic
lasconic / gist:975969
Created May 17, 2011 04:47
Applying a function to each note in a selection
// Apply the given function to all notes in selection
function applyToNotesInSelection(func)
{
var cursor = new Cursor(curScore);
var selectionEnd = new Cursor(curScore);
cursor.goToSelectionStart();
selectionEnd.goToSelectionEnd();
var startStaff = cursor.staff;
var endStaff = selectionEnd.staff;
@lasconic
lasconic / processLilypond.js
Created May 17, 2011 05:17
Call an external command line tool - Example with lilypond
//---------------------------------------------------------
// init
// this function will be called on startup of mscore
//---------------------------------------------------------
function init()
{
}
//-------------------------------------------------------------------
@lasconic
lasconic / youtube-resolver.js
Created June 25, 2011 21:48
Youtube resolver for tomahawk
function getSettings()
{
var settings = new Object();
settings.name = "Youtube Resolver";
settings.weight = 50;
settings.timeout = 5;
settings.maxResults = 5;
return settings;
}
@lasconic
lasconic / readui.js
Created March 10, 2012 17:45
Creating a GUI in QtScript using .ui file
//read the UI file and create a form out of it
var loader = new QUiLoader(null);
var file = new QFile(pluginPath + "/my.ui");
file.open(QIODevice.OpenMode(QIODevice.ReadOnly, QIODevice.Text));
form = loader.load(file, null);
//initialize some widget value if necessary
form.verticalLayoutWidget.myLabel.text = curScore.title;
form.verticalLayoutWidget.myLabel2.text = curScore.composer;
@lasconic
lasconic / diatonic_accordion_25_key.js
Created April 19, 2012 22:44
Diatonic Accordion Tablature
//=============================================================================
// MuseScore
// Linux Music Score Editor
// $Id:$
//
// G/C Diatonic accordion plugin
// This version is for the 25 keys Hohner Galaad diatonic accordion.
//
// Copyright (C)2012 Pierre Thomas, Rich Helms, Werner Schweer and others
// This is a variation of Werner Schweer very famous recorder_fingering plugin.
@lasconic
lasconic / trumpetfingeringfr.js
Created May 8, 2012 15:58
Trumpet fingering plugin for MuseScore with french note names
//=============================================================================
// MuseScore
//
// Note names and fingerings for Trumpet Bb
// changable for other Brass
//
// Contribution Artur Vilá Canal
// Copyright (c) 2011 Karl Gerhards, (C)2008 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
import QtQuick 1.0
import MuseScore 1.0
import FileIO 1.0
MuseScore {
menuPath: "Plugins.ABC Import"
width: 640
height: 480
onRun: {}
import QtQuick 1.0
import MuseScore 1.0
import QtWebKit 1.0
import FileIO 1.0
MuseScore {
menuPath: "Plugins.ABC Web"
onRun: {
}
@lasconic
lasconic / gist:4148636
Created November 26, 2012 14:59
Lyrics
import QtQuick 1.0
import MuseScore 1.0
MuseScore {
menuPath: "Plugins.pluginName"
onRun: {
var cursor = curScore.newCursor();
for (var track = 0; track < curScore.ntracks; ++track) {
cursor.track = track;
cursor.rewind(0); // set cursor to first chord/rest
@lasconic
lasconic / gist:4234030
Created December 7, 2012 15:39
Extract lyrics from score - MuseScore 2.0
import QtQuick 1.0
import MuseScore 1.0
MuseScore {
menuPath: "Plugins.pluginName"
onRun: {
var cursor = curScore.newCursor();
var sArray= new Array();
for (var track = 0; track < curScore.ntracks; ++track) {
cursor.track = track;