Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported to MS3 #1

Merged
merged 2 commits into from Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README
@@ -1,3 +1,3 @@
More info http://musescore.org/en/project/naffingering
More info https://musescore.org/en/project/naffingering

The plugin requires the _NAFTracks_SixHole.ttf_ font from [Flutopedia](http://www.flutopedia.com/fonts.htm) to be installed on your system.
The plugin requires the _NAFTracks_SixHole.ttf_ font from [Flutopedia](https://www.flutopedia.com/fonts.htm) to be installed on your system.
Binary file added asset/naf-six-hole.xcf
Binary file not shown.
Binary file added naf-six-hole.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 0 additions & 95 deletions naf_six_hole.js

This file was deleted.

76 changes: 76 additions & 0 deletions naf_six_hole.qml
@@ -0,0 +1,76 @@
//=============================================================================
//
// 6-hole Native American Flute fingering plugin
// http://musescore.org/en/project/naffingering
//
// Copyright (C) 2012 lasconic
// additional development by Scott Scheiman
// MS3 and 4 port by jeetee
//
// 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.
//=============================================================================

import QtQuick 2.0
import MuseScore 3.0

MuseScore {
menuPath: "Plugins.NAF Fingering (6 Hole)"
title: "NAF Fingering (6 Hole)"
version: "4.0.0"
description: "6-hole Native American Flute fingering plugin"
thumbnailName: "naf-six-hole.png"
categoryCode: "composing-arranging-tools"
requiresScore: true

onRun: {
// F# G G# A A# B C C# D D# E F
var fingerings = [ '1', '!', '2', '3', '#', '4', '$', '5', '6', '^', '7', '~',
'8', '*', '9', '0', "\u008C"];

var cursor = curScore.newCursor();
cursor.rewind(0); // beginning of score
cursor.staff = 0;
cursor.voice = 0;

curScore.startCmd();
while (cursor.segment) {
if ((cursor.element && (cursor.element.type == Element.CHORD))
&& (cursor.element.notes && (cursor.element.notes.length))
) {

var note = cursor.element.notes[0];
if (!(note.tieBack)) {
var mappingIndex = note.pitch - 66; // F#

var fingering = newElement(Element.FINGERING);
fingering.fontFace = 'NAFTracks Six Hole';
fingering.fontSize = 30;
fingering.align = 2; // HCenter and top
fingering.placement = Placement.BELOW;
fingering.autoplace = true;
if ((mappingIndex >= 0) && (mappingIndex < fingerings.length)) {
fingering.text = fingerings[mappingIndex];
}
else {
fingering.text = '(';
fingering.color = '#FF0000';
}

note.add(fingering);
}
}
cursor.next();
}
curScore.endCmd();
}
}