//=========================================================================================\\
// Harmonia v0.121ms3 \\
// \\
// Copyright (C)2018 Rogério Tavares Constante \\
// Collaborators: João Teixeira Araújo e Flávio Schiavoni. \\
// \\
// This program is free software: you can redistribute and / or modify \\
// it under the terms of the GNU General Public License as published by \\
// Free Software Foundation, either in version 3 of the license, or any other later. \\
// \\
// This program is distributed with the intention that it will be useful, \\
// but WITHOUT ANY WARRANTY; See GNU for more details. \\
// \\
// A copy of the GNU General Public License can be found at \\
// . \\
// \\
//=========================================================================================\\
import QtQuick 2.3
import QtQuick.Controls 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Window 2.1
import MuseScore 3.0
MuseScore {
menuPath: "Plugins.Harmony"
description: "Harmony.\nPlugin aid in the correction of harmonic threads."
version: "0.121ms3-en"
pluginType: "dialog"
// ----------------------------- janela de configuração -----------------------
ApplicationWindow {
id: window
visible: true
title: "Harmony"
width: 667; height: 580
color: "#000022"
// ------------------------------ barra superior --------------------------
Rectangle {
id: menu
width: 664; height: 30
color: "#091a23"
border.color: "#383d47"
border.width: 1
x: 1
Row {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left; anchors.leftMargin: 3
spacing: 5
Rectangle { // voice guidance
id: botao1
property string text: "Driving voices"
signal clicked
width: bLabel1.width + 20; height: bLabel1.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea1.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
onClicked: { condução.visible = true; bLabel1.color = "#002e77";
dissonancia.visible = false; bLabel2.color = "#000000";
melodia.visible = false; bLabel23.color = "#000000";
textura.visible = false; bLabel24.color = "#000000";
acordes.visible = false; bLabel25.color = "#000000";}
MouseArea {
id: mArea1
anchors.fill: parent
onClicked: botao1.clicked();
}
Text {
id: bLabel1
anchors.centerIn: botao1
color: "#000000"
text: botao1.text
}
}
Rectangle { // dissonance treatment
id: botao2
property string text: "Handling of dissonances"
signal clicked
width: bLabel2.width + 20; height: bLabel2.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea2.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
onClicked: { dissonancia.visible = true; bLabel2.color = "#002e77";
condução.visible = false; bLabel1.color = "#000000";
melodia.visible = false; bLabel23.color = "#000000";
textura.visible = false; bLabel24.color = "#000000";
acordes.visible = false; bLabel25.color = "#000000";}
MouseArea {
id: mArea2
anchors.fill: parent
onClicked: botao2.clicked();
}
Text {
id: bLabel2
anchors.centerIn: botao2
color: "#000000"
text: botao2.text
}
}
Rectangle { // melody
id: botao23
property string text: "Melody"
signal clicked
width: bLabel23.width + 20; height: bLabel23.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea23.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
onClicked: { melodia.visible = true; bLabel23.color = "#002e77";
acordes.visible = false; bLabel25.color = "#000000";
dissonancia.visible = false; bLabel2.color = "#000000";
condução.visible = false; bLabel1.color = "#000000";
textura.visible = false; bLabel24.color = "#000000";}
MouseArea {
id: mArea23
anchors.fill: parent
onClicked: botao23.clicked();
}
Text {
id: bLabel23
anchors.centerIn: botao23
color: "#000000"
text: botao23.text
}
}
Rectangle { // Texture
id: botao24
property string text: "Texture"
signal clicked
width: bLabel24.width + 20; height: bLabel24.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea24.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
onClicked: { textura.visible = true; bLabel24.color = "#002e77";
acordes.visible = false; bLabel25.color = "#000000";
melodia.visible = false; bLabel23.color = "#000000";
dissonancia.visible = false; bLabel2.color = "#000000";
condução.visible = false; bLabel1.color = "#000000"; }
MouseArea {
id: mArea24
anchors.fill: parent
onClicked: botao24.clicked();
}
Text {
id: bLabel24
anchors.centerIn: botao24
color: "#000000"
text: botao24.text
}
}
Rectangle { // Chords
id: botao25
property string text: "Chords"
signal clicked
width: bLabel25.width + 20; height: bLabel25.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea25.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
onClicked: { acordes.visible = true; bLabel25.color = "#002e77";
textura.visible = false; bLabel24.color = "#000000";
melodia.visible = false; bLabel23.color = "#000000";
dissonancia.visible = false; bLabel2.color = "#000000";
condução.visible = false; bLabel1.color = "#000000"; }
MouseArea {
id: mArea25
anchors.fill: parent
onClicked: botao25.clicked();
}
Text {
id: bLabel25
anchors.centerIn: botao25
color: "#000000"
text: botao25.text
}
}
}
}
// ------------------------------ barra inferior --------------------------
Rectangle {
id: barraInferior
y: 550
width: 664; height: 30
color: "#091a23"
border.color: "#383d47"
border.width: 1
x: 1
Text { x: 6; y: 4; font.pointSize: 7; color: "#aaa31e"; text: "created by" }
Text { x: 5; y: 13; font.pointSize: 9; color: "#aaa31e"; text: "Rogério Tavares Constante" }
Text { x: 633; y: 10; font.pointSize: 9; color: "#aaa31e"; text: "2018" }
Rectangle {
id: btVerifica
property string text: "Verify"
signal clicked
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.horizontalCenter //; anchors.leftMargin: 3
width: bLabel3.width + 20; height: bLabel3.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea3.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
MouseArea {
id: mArea3
anchors.fill: parent
onClicked: { msgResult.close(); window.lower(); verificar(); }
}
Text {
id: bLabel3
anchors.centerIn: btVerifica
color: "#000000"
text: btVerifica.text
}
}
Rectangle {
id: btFechar
property string text: "Close"
signal clicked
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.horizontalCenter; anchors.leftMargin: 3
width: bLabel4.width + 20; height: bLabel4.height + 7
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea4.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#334455" }
}
MouseArea {
id: mArea4
anchors.fill: parent
onClicked: { Qt.quit(); window.close(); msgResult.close(); }
}
Text {
id: bLabel4
anchors.centerIn: btFechar
color: "#000000"
text: btFechar.text
}
}
}
// ------------------------------ Presentation ---------------------------
Item { id: apresenta; visible: true
Text { x: 195; y: 250; font.pointSize: 24; color: "#aaa31e"; text: "Harmony" }
Text { x: 196; y: 282; font.pointSize: 9; color: "#aaa31e"; text: "Extension for MuseScore" }
}
// ------------------------------ general settings --------------------------
Item { id: configura; visible: true;
Rectangle { x: 513; y: 35; width: 150; height: 512; color: "#3d0909"; radius: 2
Text { x: 3; y: 5; color: "#d1d10a"; text: "General Settings" }
Rectangle { id: tonalidade;
x: 5; y: 40; width: 140; height: 125; color: "#260000"; radius: 2
Text { x: 5; y: 5; color: "#f9ff8c"; font.pixelSize: 15; text: "Hue:" }
Button {
id: btTonica
text: "C"
width: 60
menu: menuTonica
x: 5; y: 30
Text { x: 65; color: "#fcffbc"; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13; text: "Tonic" }
}
Button {
id: btAcid
text: ""
width: 50
menu: menuAcid
x: 5; y: 60
Text { x: 55; color: "#fcffbc"; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13; text: "Accidental" }
}
Button {
id: btModo
text: "Major"
width: 90
menu: menuModo
x: 5; y: 90
Text { x: 95; color: "#fcffbc"; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13; text: "Mode" }
}
Menu {
id: menuTonica
property int value: 1
MenuItem { text: "C"; onTriggered: { menuTonica.value = 1; btTonica.text = "C" } }
MenuItem { text: "D"; onTriggered: { menuTonica.value = 2; btTonica.text = "D" } }
MenuItem { text: "E"; onTriggered: { menuTonica.value = 3; btTonica.text = "E" } }
MenuItem { text: "F"; onTriggered: { menuTonica.value = 4; btTonica.text = "F" } }
MenuItem { text: "G"; onTriggered: { menuTonica.value = 5; btTonica.text = "G" } }
MenuItem { text: "A"; onTriggered: { menuTonica.value = 6; btTonica.text = "A" } }
MenuItem { text: "B"; onTriggered: { menuTonica.value = 7; btTonica.text = "B" } }
}
Menu {
id: menuAcid
property string value: ""
MenuItem { text: "Natural"; onTriggered: { menuAcid.value = 1; btAcid.text = "" } }
MenuItem { text: "#"; onTriggered: { menuAcid.value = 2; btAcid.text = "#" } }
MenuItem { text: "b"; onTriggered: { menuAcid.value = 3; btAcid.text = "b" } }
}
Menu {
id: menuModo
property string value: "Major"
MenuItem { text: "Major"; onTriggered: { menuModo.value = 1; btModo.text = "Major" } }
MenuItem { text: "Minor"; onTriggered: { menuModo.value = 2; btModo.text = "Minor" } }
}
}
/*Rectangle { id: polifonico;
x: 5; y: 80; width: 265; height: 50; color: "#755a5a"; radius: 2
Text { x: 5; y: 15; color: "#d1d10a"; text: "Modo de escrita:" }
RadioButton { id: poli; checked: true; x: 140; y: 5;
onClicked: { if (homo.checked) {homo.checked = false}}
Text { anchors.left: parent.right; anchors.verticalCenter: parent.verticalCenter; color: "#cece7b"; text: "Polyphonic" }
}
RadioButton { id: homo; checked: false; x: 140; y: 25;
onClicked: { if (poli.checked) {poli.checked = false}}
Text { anchors.left: parent.right; anchors.verticalCenter: parent.verticalCenter; color: "#cece7b"; text: "Homophonic" }
}
}*/
Rectangle { id: preConfigurações; x: 5; y: 200; width: 140; height: 170; color: "#260000"; radius: 2
Text { x: 5; y: 5; color: "#f9ff8c"; font.pixelSize: 15; text: "Presets:" }
Rectangle { x: 4; y: 30; width: 132; height: 22; color: "#9c9c9c"; radius: 2
Rectangle { x: 1; y: 1; width: 130; height: 20; color: "#0c0000"; radius: 2
Text { id: nomePre; x: 5; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; color: "#d1d10a"; text: "no name" }
}
}
Rectangle {
id: salvarCnfiguração
property string text: "Save"
signal clicked
x: 5; y: 70; width: 130; height: 40
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea41.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#5b2b2b" }
}
MouseArea {
id: mArea41
anchors.fill: parent
onClicked: { saveFileDialog.open(); }
}
Text {
id: bLabel41
anchors.centerIn: salvarCnfiguração
color: "#101010"
font.pointSize: 13
text: salvarCnfiguração.text
}
}
Rectangle {
id: carregarCnfiguração
property string text: "Upload"
signal clicked
x: 5; y: 120; width: 130; height: 40
border { width: 1; color: "#555555" }
smooth: true
radius: 2
gradient: Gradient {
GradientStop {
position: 0.0
color: {
if (mArea42.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#5b2b2b" }
}
MouseArea {
id: mArea42
anchors.fill: parent
onClicked: { openFileDialog.open(); }
}
Text {
id: bLabel42
anchors.centerIn: carregarCnfiguração
color: "#101010"
font.pointSize: 13
text: carregarCnfiguração.text
}
}
}
}
}
// ------------------------------ verification -----------------------------------
Item { id: condução; visible: false;
Rectangle { x: 5; y: 35; width: 500; height: 512; color: "#2b313a"; radius: 2
// all voices in the same direction
Rectangle { id: item; x: 5; y: 3; width: 490; height: 25; color: "#627fad"; radius: 2
CheckBox { id: mesmaDir; checked: true; x: 5; y: 3;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter ; font.pixelSize: 14; text: "All voices in the same direction" }
CheckBox { id: mDirAcor; checked: true; x: 265; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless you don't change chords" } }
}
}
// paralelas
Rectangle { id: item1; x: 5; y: 31; width: 490; height: 160; color: "#627fad"; radius: 2
CheckBox { id: paralela8; checked: true; x: 5; y: 5;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "8th parallel" }
Text { id: par8RepTxt; x: 5; y: 20; font.pixelSize: 12; text: "- if parallel sequence is greater than" }
TextInput { id: par8Rep; anchors.left: par8RepTxt.right; anchors.leftMargin: 5; y: par8RepTxt.y; font.underline: true; text: "0"; font.pixelSize: 12; color: "white"; validator: IntValidator{bottom: 0; top: 99;} }
CheckBox { id: paral8Ext; checked: false; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter ; font.pixelSize: 12; text: "Only if in external voices" }
}
CheckBox { id: paralela5; checked: true; x: 5; y: 42;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "5th parallel" }
Text { id: par5RepTxt; x: 5; y: 20; font.pixelSize: 12; text: "- if parallel sequence is greater than" }
TextInput { id: par5Rep; anchors.left: par5RepTxt.right; anchors.leftMargin: 5; y: par5RepTxt.y; font.underline: true; text: "0"; font.pixelSize: 12; color: "white"; validator: IntValidator{bottom: 0; top: 99;} }
CheckBox { id: paral5Ext; checked: false; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter ; font.pixelSize: 12; text: "Only if in external voices" } }
}
CheckBox { id: paralela4; checked: false; x: 5; y: 84;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "4th parallel J" }
Text { id: par4RepTxt; x: 5; y: 20; font.pixelSize: 12; text: "- if parallel sequence is greater than" }
TextInput { id: par4Rep; anchors.left: par4RepTxt.right; anchors.leftMargin: 5; y: par4RepTxt.y; font.underline: true; text: "0"; font.pixelSize: 12; color: "white"; validator: IntValidator{bottom: 0; top: 99;} }
CheckBox { id: paral4Ext; checked: false; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if in external voices" }
}
}
CheckBox { id: paralela36; checked: false; x: 5; y: 122;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "3rd and 6th parallel" }
Text { id: par36RepTxt; x: 5; y: 20;font.pixelSize: 12; text: "- if parallel sequence is greater than" }
TextInput { id: par36Rep; anchors.left: par36RepTxt.right; anchors.leftMargin: 5; y: par36RepTxt.y; font.underline: true; text: "0"; font.pixelSize: 12; color: "white"; validator: IntValidator{bottom: 0; top: 99;} }
CheckBox { id: paral36Ext; checked: false; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter ; font.pixelSize: 12; text: "Only if in external voices" }
}
}
}
// ocultas
Rectangle { id: item2; x: 5; y: 194; width: 490; height: 60; color: "#627fad"; radius: 2
CheckBox { id: oculta8; checked: true; x: 5; y: 8;
onClicked: {if (!oculta8.checked && !oculta5.checked) { ocultAsc.checked = false; ocultExt.checked = false; ocultSalto.checked = false;}}
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "8th hidden or direct" }
}
CheckBox { id: oculta5; checked: true; x: 5; y: 34;
onClicked: {if (!oculta8.checked && !oculta5.checked) { ocultAsc.checked = false; ocultExt.checked = false; ocultSalto.checked = false;}}
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "5th hidden or direct" }
}
CheckBox { id: ocultAsc; checked: false; x: 190; y: 3;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if upward movement" }
}
CheckBox { id: ocultExt; checked: true; x: 190; y: 21;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if external voices" }
}
CheckBox { id: ocultSalto; checked: true; x: 190; y: 39;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if I jump in the upper voice" }
}
}
// consecutive by opposite and oblique movement
Rectangle { id: item3; x: 5; y: 257; width: 490; height: 49; color: "#627fad"; radius: 2
CheckBox { id: consecObli; checked: false; x: 5; y: 3;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "5th and 8th consecutive oblique" }
}
CheckBox { id: consecCont; checked: false; x: 5; y: 26;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "5th and 8th consecutive contrary" }
}
CheckBox { id: consecExt; checked: false; x: 260; y: 15;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if in external voices" }
}
}
// voicing crossing && overlapping && unison
Rectangle { id: item4; x: 5; y: 309; width: 490; height: 82; color: "#627fad"; radius: 2
CheckBox { id: cruzaVozes; checked: true; x: 5; y: 2
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Crossing voices" }
CheckBox { id: cruzaExt; checked: false; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only cross over to external voices" } }
}
CheckBox { id: overlap; checked: true; x: 5; y: 22
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Overlapping" }
}
CheckBox { id: uniss; checked: true; x: 5; y: 42
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Unison" }
}
CheckBox { id: falsaR; checked: true; x: 5; y: 62
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "False relationship" }
}
}
// resolution of sensitive
Rectangle { id: item5; x: 5; y: 394; width: 490; height: 114; color: "#627fad"; radius: 2
CheckBox { id: resolvSens; checked: true; x: 5; y: 19
onClicked: { if (!resolvSens.checked) { sensivelExt.checked = false; sensivelVI.checked = false; sensivelVvi.checked = false; }
else { sensivelExt.checked = true; sensivelVI.checked = true;} }
Text { id:rSens; anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14;text: "Resolution" }
Text { id:res7; anchors.left: rSens.right; anchors.leftMargin: 5; y: rSens.y; font.pixelSize: 14; text: "7 - " }
Text { anchors.bottom: res7.top; anchors.bottomMargin: -8; x: res7.x; text: "^" }
Text { id:res1; anchors.left: res7.right; y: rSens.y; font.pixelSize: 14; text: "1" }
Text { anchors.bottom: res1.top; anchors.bottomMargin: -8; x: res1.x; text: "^" }
CheckBox { id: sensivelExt; checked: true; x: 185; y: -17;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only in the upper voice" }
}
CheckBox { id: sensivelVI; checked: true; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if V-I or viii°-I" }
}
CheckBox { id: sensivelVvi; checked: true; x: 185; y: 17;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if V-vi or viii°-vi" }
}
}
CheckBox { id: res43; checked: false; x: 5; y: 77
onClicked: { if (!res43.checked) { res43Ext.checked = false; res43VI.checked = false; res43Vvi.checked = false; }
else { res43Ext.checked = true; res43VI.checked = true; } }
Text { id:resTxt; anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Resolution" }
Text { id:res4; anchors.left: resTxt.right; anchors.leftMargin: 5; y: resTxt.y; font.pixelSize: 14; text: "4 - " }
Text { anchors.bottom: res4.top; anchors.bottomMargin: -8; x: res4.x; text: "^" }
Text { id:res3; anchors.left: res4.right; y: resTxt.y; font.pixelSize: 14; text: "3" }
Text { anchors.bottom: res3.top; anchors.bottomMargin: -8; x: res3.x; text: "^" }
CheckBox { id: res43Ext; checked: false; x: 185; y: -17;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only in the upper voice" }
}
CheckBox { id: res43VI; checked: false; x: 185; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if V7-I" }
}
CheckBox { id: res43Vvi; checked: false; x: 185; y: 17;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if V7-vi" }
}
}
}
}
}
Item { id: dissonancia; visible: false;
Rectangle { x: 5; y: 35; width: 500; height: 512; color: "#12280c"; radius: 2
// segunda inversão
Rectangle { id: item6; x: 10; y: 5; width: 480; height: 60; color: "#769b6c"; radius: 2
CheckBox { id: segInvDiss; checked: true; x: 5; y: 20;
onClicked: {if (segInvDiss.checked){segInvConj.checked = true; segInvArp.checked = true; segInvPara.checked = true;} else
{segInvConj.checked = false; segInvArp.checked = false; segInvPara.checked = false;}}
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "2nd inversion" }
CheckBox { id: segInvConj; checked: true; x: 135; y: -18;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Except when low moves by joint degree" }
}
CheckBox { id: segInvArp; checked: true; x: 135; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Except when playing the bass arpeggio" }
}
CheckBox { id: segInvPara; checked: true; x: 135; y: 18;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Except when bass doesn't move" }
}
}
}
// dissonances
Rectangle { id: item7; x: 10; y: 70; width: 480; height: 248; color: "#769b6c"; radius: 2
CheckBox { id: dissonancias; checked: true; x: 5; y: 76;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Dissonances" }
CheckBox { id: dissSusp; checked: true; x: 135; y: -72;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless suspended" }
}
CheckBox { id: dissNP; checked: false; x: 135; y: -54;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless passing note" }
}
CheckBox { id: dissBordS; checked: false; x: 135; y: -36;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless upper border" }
}
CheckBox { id: dissBordI; checked: false; x: 135; y: -18;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless bottom border" }
}
CheckBox { id: dissAp; checked: false; x: 135; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless it flattens" }
}
CheckBox { id: dissRet; checked: false; x: 135; y: 18;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless I'm late" }
}
CheckBox { id: dissAnt; checked: false; x: 135; y: 36;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless anticipated" }
}
CheckBox { id: dissEsc; checked: false; x: 135; y: 54;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless escaped" }
}
CheckBox { id: dissPed; checked: false; x: 135; y: 72;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless you notice a pedal" }
}
CheckBox { id: dissRes; checked: false; x: 135; y: 90;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless resolution by set degree desc." }
}
}
CheckBox { id: dissDiss; checked: true; x: 5; y: 198;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Dissonance prepared or resolved by another dissonance" }
CheckBox { id: dDissB; checked: false; x: 135; y: 20;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Only if in the lower voice" }
}
}
}
}
}
Item { id: melodia; visible: false;
Rectangle { x: 5; y: 35; width: 500; height: 512; color: "#39420b"; radius: 2
Rectangle { id: item8; x: 10; y: 3; width: 480; height: 272; color: "#84832e"; radius: 2
CheckBox { id: melAum; checked: true; x: 5; y: 5;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Increased ranges" }
}
CheckBox { id: melDim; checked: true; x: 5; y: 30;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Miniature ranges" }
CheckBox { id: melDimMuda; checked: true; x: 120; y: 20;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless you change direction by joint degree" }
}
}
CheckBox { id: mel7; checked: true; x: 5; y: 80;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Seventh Jumps" }
}
CheckBox { id: mel8; checked: true; x: 5; y: 105;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Jumps greater than octave" }
}
CheckBox { id: mel4; checked: true; x: 5; y: 130;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Jumps bigger than a tight fourth" }
CheckBox { id: mel4Op; checked: true; x: 120; y: 19;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "If not hit in the opposite direction" }
}
CheckBox { id: mel4r; checked: false; x: 120; y: 37;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "If not resolved in the opposite direction" }
}
CheckBox { id: mel4cj; checked: true; x: 120; y: 55;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "If it is not resolved by joint degree" }
}
}
CheckBox { id: mel2Salt; checked: true; x: 5; y: 206;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Consecutive jumps in the same direction" }
CheckBox { id: mel2tri; checked: true; x: 120; y: 20;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Unless you draw a triad" }
}
}
CheckBox { id: melDC; checked: false; x: 5; y: 250;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Composite dissonance" }
}
}
Rectangle { id: item81; x: 10; y: 279; width: 480; height: 54; color: "#84832e"; radius: 2
// Text { x: 5; y: 5; text: "Ponto Focal (vozes externas)" }
CheckBox { id: melPFs; checked: true; x: 5; y: 5;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Top focal point" }
CheckBox { id: melPFsS; checked: false; x: 280; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Higher voice only" }
}
}
CheckBox { id: melPFi; checked: true; x: 5; y: 30;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Lower focal point" }
CheckBox { id: melPFiS; checked: false; x: 280; y: 0;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "Higher voice only" }
}
}
}
Rectangle { id: item82; x: 10; y: 337; width: 480; height: 116; color: "#84832e"; radius: 2
//Text { x: 5; y: 5; text: "Melodic variety" }
CheckBox { id: varDir; checked: true; x: 5; y: 5;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Variety of directions" }
Text { id: varDirTxt; x: 5; y: 20; anchors.leftMargin: 0; font.pixelSize: 12; text: "- until" }
TextInput { id: varDirQt; anchors.left: varDirTxt.right; anchors.leftMargin: 5; y: varDirTxt.y; font.underline: true; font.pixelSize: 12; color: "white"; text: "4"; validator: IntValidator{bottom: 0; top: 99;} }
Text { anchors.left: varDirQt.right; anchors.leftMargin: 5; y: varDirQt.y; font.pixelSize: 12; text: "moves in the same direction" }
}
CheckBox { id: repNota; checked: true; x: 5; y: 40;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14;text: "Repeating notes" }
Text { id: repNotaTxt; x: 5; y: 20; anchors.leftMargin: 0; font.pixelSize: 12; text: "- until" }
TextInput { id: repNotaQt; anchors.left: repNotaTxt.right; anchors.leftMargin: 5; y: repNotaTxt.y; font.underline: true; font.pixelSize: 12; color: "white"; text: "4"; validator: IntValidator{bottom: 0; top: 99;} }
Text { anchors.left: repNotaQt.right; anchors.leftMargin: 5; y: repNotaQt.y; font.pixelSize: 12; text: "repetitions" }
}
CheckBox { id: repPad; checked: true; x: 5; y: 75;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Pattern Repeat" }
Text { id: repPadTxt; x: 5; y: 20; anchors.leftMargin: 0; font.pixelSize: 12; text: "- until" }
TextInput { id: repPadQt; anchors.left: repPadTxt.right; anchors.leftMargin: 5; y: repPadTxt.y; font.underline: true; font.pixelSize: 12; color: "white"; text: "2"; validator: IntValidator{bottom: 0; top: 99;} }
Text { anchors.left: repPadQt.right; anchors.leftMargin: 5; y: repPadQt.y; font.pixelSize: 12; text: "repetitions" }
}
CheckBox { id: varMelS; checked: true; x: 285; y: 20;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "In the upper voice" }
}
CheckBox { id: varMelI; checked: false; x: 285; y: 45;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "In the internal voices" }
}
CheckBox { id: varMelG; checked: true; x: 285; y: 70;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "In the lower voice" }
}
}
Rectangle { id: item83; x: 10; y: 457; width: 480; height: 52; color: "#84832e"; radius: 2
CheckBox { id: extMel; checked: true; x: 5; y: 11;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Extension of melodies" }
Text { id: extMeltxt; x: 5; y: 20; anchors.leftMargin: 0; font.pixelSize: 12; text: "- until" }
TextInput { id: extMelQt; anchors.left: extMeltxt.right; anchors.leftMargin: 5; y: extMeltxt.y; font.underline: true; font.pixelSize: 12; color: "white"; text: "12"; validator: IntValidator{bottom: 0; top: 99;} }
Text { anchors.left: extMelQt.right; anchors.leftMargin: 5; y: extMelQt.y; font.pixelSize: 12; text: "semitones" }
}
CheckBox { id: extMelS; checked: true; x: 285; y: 1;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "In the upper voice" }
}
CheckBox { id: extMelI; checked: false; x: 285; y: 17;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "In the internal voices" }
}
CheckBox { id: extMelG; checked: true; x: 285; y: 33;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12; text: "In the lower voice" }
}
}
}
}
Item { id: textura; visible: false;
Rectangle { x: 5; y: 35; width: 500; height: 512; color: "#66632a"; radius: 2
Rectangle { id: item9; x: 10; y: 5; width: 480; height: 70; color: "#f9f59a"; radius: 2
CheckBox { id: espaço; checked: true; x: 5; y: 5;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Maximum spacing" }
Text { id: espTxt1; x: 35; y: 25; anchors.leftMargin: 0; font.pixelSize: 12; text: "Among the higher voices:" }
TextInput { id: espS; anchors.left: espTxt1.right; anchors.leftMargin: 5; y: espTxt1.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "12"; validator: IntValidator{bottom: 0; top: 99;}}
Text { anchors.left: espS.right; anchors.leftMargin: 5; y: espS.y; font.pixelSize: 12; text: "semitones" }
Text { id: espTxt2; x: 35; y: 45; anchors.leftMargin: 0; font.pixelSize: 12; text: "Between bass and tenor:" }
TextInput { id: espB; anchors.left: espTxt2.right; anchors.leftMargin: 5; y: espTxt2.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "24"; validator: IntValidator{bottom: 0; top: 99;}}
Text { anchors.left: espB.right; anchors.leftMargin: 5; y: espB.y; font.pixelSize: 12; text: "semitones" }
}
}
Rectangle { id: item91; x: 10; y: 80; width: 480; height: 110; color: "#f9f59a"; radius: 2
CheckBox { id: extens; checked: true; x: 5; y: 5;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 14; text: "Vocal extension" }
Text { id: sopTxt1; x: 35; y: 25; anchors.leftMargin: 0; font.pixelSize: 12; text: "Soprano:" }
TextInput { id: sop1; anchors.left: sopTxt1.right; anchors.leftMargin: 5; y: sopTxt1.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "C3"; }
Text { id: sopTxt2; anchors.left: sop1.right; anchors.leftMargin: 5; y: sop1.y; font.pixelSize: 12; text: "a" }
TextInput { id: sop2; anchors.left: sopTxt2.right; anchors.leftMargin: 5; y: sopTxt2.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "A4"; }
Text { anchors.left: sop2.right; anchors.leftMargin: 5; y: sop2.y; font.pixelSize: 12; text: "(C3 = central C)" }
Text { id: altoTxt1; x: 35; y: 45; anchors.leftMargin: 0; font.pixelSize: 12; text: "Contralto:" }
TextInput { id: alto1; anchors.left: altoTxt1.right; anchors.leftMargin: 5; y: altoTxt1.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "F2"; }
Text { id: altoTxt2; anchors.left: alto1.right; anchors.leftMargin: 5; y: alto1.y; font.pixelSize: 12; text: "a" }
TextInput { id: alto2; anchors.left: altoTxt2.right; anchors.leftMargin: 5; y: altoTxt2.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "D4"; }
Text { id: tenTxt1; x: 35; y: 65; anchors.leftMargin: 0; font.pixelSize: 12; text: "Tenor:" }
TextInput { id: ten1; anchors.left: tenTxt1.right; anchors.leftMargin: 5; y: tenTxt1.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "B1"; }
Text { id: tenTxt2; anchors.left: ten1.right; anchors.leftMargin: 5; y: ten1.y; font.pixelSize: 12; text: "a" }
TextInput { id: ten2; anchors.left: tenTxt2.right; anchors.leftMargin: 5; y: tenTxt2.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "G3";}
Text { id: bxoTxt1; x: 35; y: 85; anchors.leftMargin: 0; font.pixelSize: 12; text: "Bass:" }
TextInput { id: bxo1; anchors.left: bxoTxt1.right; anchors.leftMargin: 5; y: bxoTxt1.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "E1"; }
Text { id: bxoTxt2; anchors.left: bxo1.right; anchors.leftMargin: 5; y: bxo1.y; font.pixelSize: 12; text: "a" }
TextInput { id: bxo2; anchors.left: bxoTxt2.right; anchors.leftMargin: 5; y: bxoTxt2.y; font.underline: true; font.pixelSize: 12; color: "blue"; text: "C3"; }
}
}
}
}
Item { id: acordes; visible: false;
Rectangle { x: 5; y: 35; width: 500; height: 512; color: "#5b5b5b"; radius: 2
Rectangle { id: item10; x: 10; y: 5; width: 480; height: 215; color: "#303030"; radius: 2
Text { x: 5; y: 5; font.pixelSize: 14; color: "#e0dfc3"; text: "Folds and omissions" }
CheckBox { id: sem3; checked: true; x: 10; y: 30;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13;
color: "#e0dfc3"; text: "If you omit the third, in texture of 3 or more voices" }
}
CheckBox { id: pc3; checked: true; x: 10; y: 55;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13;
color: "#e0dfc3"; text: "Chords with less than 3 PCs, with 4 or more voices texture" }
}
CheckBox { id: triadesDobra3; checked: true; x: 10; y: 80;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13;
color: "#e0dfc3"; text: "Triads consonant with the 3rd doubled" }
}
CheckBox { id: dobra7; checked: true; x: 10; y: 105;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13;
color: "#e0dfc3"; text: "Chords with the 7th doubled" }
}
CheckBox { id: dobraSens; checked: true; x: 10; y: 130;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13;
color: "#e0dfc3"; text: "Chords with the feeling doubled" }
CheckBox { id: dSensV2I; checked: true; x: 130; y: 20;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12;
color: "#e0dfc3"; text: "Only if V-I or vii°-I" }
}
CheckBox { id: dSensV2vi; checked: true; x: 130; y: 40;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 12;
color: "#e0dfc3"; text: "Only if V-vi or vii°-vi" }
}
}
CheckBox { id: dobra5dim; checked: true; x: 10; y: 190;
Text { anchors.left: parent.right; anchors.leftMargin: 0; anchors.verticalCenter: parent.verticalCenter; font.pixelSize: 13;
color: "#e0dfc3"; text: "Chords with the 5th diminished or increased doubled" }
}
}
}
}
} // window
//--------------------------------------------------------------------------------
ApplicationWindow { // window with result messages
id: msgResult
visible: false;
title: "Result"
width: 450; height: 40
color: "#343530"
Rectangle {
id: btResult
property alias text: lresult.text
signal clicked
visible: true
width: 100; height: 25
x: 110
border { width: 1; color: "#555555" }
smooth: true
radius: 3
gradient: Gradient {
GradientStop { position: 0.0
color: {
if (mArea6.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#035b25" }
}
Text {
id: lresult
anchors.centerIn: parent
text: "Close"
color: "#aaf0e1"
}
MouseArea {
id: mArea6
anchors.fill: parent
onClicked: { window.raise(); msgResult.close(); apagaCor(); return }
} // mouseArea
} // Rectangle btResult
Rectangle {
id: btAtualiza
property alias text: latual.text
signal clicked
visible: true
width: 100; height: 25
x: 240
border { width: 1; color: "#555555" }
smooth: true
radius: 3
gradient: Gradient {
GradientStop { position: 0.0
color: {
if (mArea61.pressed)
return "#888d96"
else
return "#a0a8af"
}
}
GradientStop { position: 1.0; color: "#035b25" }
}
Text {
id: latual
anchors.centerIn: parent
text: "Update"
color: "#aaf0e1"
}
MouseArea {
id: mArea61
anchors.fill: parent
onClicked: { msgResult.close(); apagaCor(); verificar(); }
} // mouseArea
} // Rectangle btAtualiza
Component {
id: component
Rectangle {
id: msg
property alias text: lResul.text
property int value: 0
signal clicked
visible: true
width: 450; height: 21
border { width: 1; color: "#000000" }
smooth: true
radius: 3
color: "#6c6d6d"
/*gradient: Gradient {
GradientStop { position: 0.0; color: "#234049"}
GradientStop { position: 0.5; color: {
if (msgClick.pressed)
return "#c4ae05"
else
return "#6c6d6d"
}}
GradientStop { position: 1.0; color: "#234049"}
} */
Text {
id: lResul
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
text: "-"
color: "#aaf0e1"
}
MouseArea {
id: msgClick
anchors.fill: parent
onClicked: { colorir(parent.value); }
}
}
} // component
}
// ----------------------------------------------------------------------------------------------------------------
MessageDialog {
id: msgErros
title: "Error!"
text: "-"
property bool estado: false
onAccepted: {
msgErros.visible=false;
}
visible: false;
}
// -----------------------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------------------
// ---- global variables ----
property bool processaTudo: false;
property var vozes: [];
property var resultado: [];
property var mensagem: [];
property var verificados: 0;
property var acordeGrau: [];
// ----------- functions ---------
function openFile(fileUrl) {
var request = new XMLHttpRequest();
request.open("GET", fileUrl, false);
request.send(null);
var preSet = request.responseText.split("\n");
nomePre.text = fileUrl;
var nomeSplit = nomePre.text.split('/');
nomePre.text = nomeSplit[nomeSplit.length-1];
for (var i=0;i rep:",rep)
};
};
return rep;
}
function mostraCifras() {
curScore.startCmd();
var cursor = curScore.newCursor();
cursor.track = 0; var pos = 0;
for (var x=0;x 0 && (vozes[x].posição[0] == vozes[x-1].posição[0])) { myText.offsetX = -3; } else {myText.offsetX = 0;};
if (cursor.track > 3) { myText.offsetY = 13; } else { myText.offsetY = 28; };
cursor.add(myText);
};
curScore.endCmd();
}
function colorir(valor) {
curScore.startCmd();
apagaCor();
mensagem[valor-1].color = "#6b6746";
for (var z=1;z -1) { contTest++; };
if (contTest == acordeX.length) { resultaGrau = i.toString(); }; };
};
};
if (resultaGrau) {return Math.abs(resultaGrau);} else { //|| resultaGrau == 0
msgErros.text += "The chord" + (x + 1) + "was not recognized!!\n";
msgErros.estado=true; return false;};
}
function removeRepetição(tpc) {
var acordeX = [];
for (var i = 0;i < tpc.length; i++){
if(acordeX.indexOf(tpc[i]) == -1){
acordeX.push(tpc[i]);
};
};
return acordeX;
}
function reconheceOmissão(tpc) {
var acordeX = removeRepetição(tpc);
var result = [];
var intrv = [];
var om31 = [2,1], om32 = [1,4], om33 = [3,6], om34 = [4,2], om35 = [2,8], om36 = [5,3];
var om51 = [2,4], om52 = [4,1], om53 = [1,2], om54 = [3,5], om55 = [6,3], om56 = [1,2];
acordeX.sort(function(a, b){return a - b});
for (var x=1;x 0) return(1); // ascendente
else if (x == 0) return(0); // without direction
else return(-1); // descendente
}
function tonicaTPC(nome,acidente) {
var tonica = nome+acidente
switch (tonica) {
case "C": return 14; break;
case "C#": return 21; break;
case "Cb": return 7; break;
case "D": return 16; break;
case "D#": return 23; break;
case "Db": return 9; break;
case "E": return 18; break;
case "E#": return 25; break;
case "Eb": return 11; break;
case "F": return 13; break;
case "F#": return 20; break;
case "Fb": return 6; break;
case "G": return 15; break;
case "G#": return 22; break;
case "Gb": return 8; break;
case "A": return 17; break;
case "A#": return 24; break;
case "Ab": return 10; break;
case "B": return 19; break;
case "B#": return 26; break;
case "Bb": return 12; break;
}
}
function n2m(texto) {
if (texto.length > 3 || texto.length < 2) { msgErros.text += "Invalid index for calculating the extension of voices!\n";
msgErros.estado = true; return null; } else
if (texto.length == 2) {var nota = texto.substr(0,1);} else { var nota = texto.substr(0,2); };
nota = nota.toUpperCase();
switch(nota.substr(0,1)) {
case "C": var midi = 0; break;
case "D": var midi = 2; break;
case "E": var midi = 4; break;
case "F": var midi = 5; break;
case "G": var midi = 7; break;
case "A": var midi = 9; break;
case "B": var midi = 11; break;
};
if (nota.length == 2) {
switch(nota.substr(1,1)) {
case "#": midi = midi + 1; break;
case "B": midi = midi - 1; break;
};
};
var oitava = parseInt(texto.substr(-1,1));
if (oitava > 5 || oitava < 1) { msgErros.text += "Invalid index for calculating the extension of voices!\n";
msgErros.estado = true; return null; };
switch(oitava) {
case 1: midi = midi + 36; break;
case 2: midi = midi + 48; break;
case 3: midi = midi + 60; break;
case 4: midi = midi + 72; break;
case 5: midi = midi + 84; break;
};
return midi;
}
//-------------------------------
function verificar() {
msgErros.text = "";
msgErros.estado = false;
msgResult.height = 40;
destroirMsg();
resultado = [];
tipoAcordes();
carregarNotas();
//mostraCifras();
if (mesmaDir.checked) { mesmaDireção(); };
if (paralela5.checked || paralela8.checked) { quintasOitavas(); };
if (oculta5.checked || oculta8.checked) { ocultas(); };
if (consecObli.checked || consecCont.checked) { consecutivas(); };
if (paralela4.checked) { quartas(); };
if (paralela36.checked) { terçasSextas(); };
if (cruzaVozes.checked) { cruzamento(); };
if (overlap.checked) { overlapping(); };
if (resolvSens.checked) { resolveSens(); };
if (res43.checked) { resolve43(); };
if (segInvDiss.checked) { segInvDissonancia(); };
if (dissonancias.checked) { trataDissonancias(); };
if (melAum.checked) { melodiaAum(); };
if (melDim.checked) { melodiaDim(); };
if (mel7.checked) { melodia7(); };
if (mel8.checked) { melodia8(); };
if (mel4.checked) { melodia4(); };
if (mel2Salt.checked) { melodia2Salt(); };
if (melDC.checked) { melodiaDC(); };
if (melPFs.checked || melPFi.checked) { melodiaPF(); };
if (espaço.checked) { espaçamento(); };
if (extens.checked) { extensVozes(); };
if (sem3.checked) { acordeSemTerça(); };
if (pc3.checked) { menos3PCs(); };
if (triadesDobra3.checked) { dobramentoTerça(); };
if (dobra7.checked) { dobramentoSetima(); };
if (dobraSens.checked) {dobramentoSensivel(); };
if (dobra5dim.checked) {dobramentoQuinta(); };
if (varDir.checked) { variedadeDirecionamento(); };
if (repNota.checked) { repetiçãoNotas(); };
if (repPad.checked) { repetePadrão(); };
if (extMel.checked) { extensãoMelodica(); };
if (uniss.checked) { unissono(); };
if (falsaR.checked) { falsaRelação(); };
for (var i=0;i=0;j--) {
vozes[seg].nota[voz] = notas[j].pitch;
vozes[seg].tonal[voz] = notas[j].tpc
vozes[seg].trilha[voz] = trilha;
vozes[seg].posição[voz] = segmento.tick;
vozes[seg].duração[voz] = duração;
vozes[seg].compasso = compasso;
vozes[seg].objeto[voz] = notas[j];
vozes[seg].ligadura[voz] = false;
voz++;
carregou = true;
// if (poli.checked) { break; }
};
};
} else {
// if (poli.checked && vozes[seg-1]) {
if (vozes[seg-1]) {
for (var y=0; y segmento.tick) { var prolonga = true; } else { var prolonga = false; };
if (prolonga) {
vozes[seg].nota[voz] = vozes[seg-1].nota[y];
vozes[seg].tonal[voz] = vozes[seg-1].tonal[y]
vozes[seg].trilha[voz] = vozes[seg-1].trilha[y]
vozes[seg].posição[voz] = segmento.tick;
vozes[seg].duração[voz] = vozes[seg-1].duração[y] - (segmento.tick - vozes[seg-1].posição[y]);
vozes[seg].compasso = compasso;
vozes[seg].objeto[voz] = vozes[seg-1].objeto[y];
vozes[seg].ligadura[voz] = true;
voz++;
carregou = true;
};
break;
};
};
};
};
};
if (carregou) {
cursor.track = 0;
for (var i=1;i= vozes[x].nota.length-1 || i >= vozes[x].nota.length) { continue ; };
var dir1 = direção(vozes[x].nota[voz] - vozes[x-1].nota[voz]);
var dir2 = direção(vozes[x].nota[i] - vozes[x-1].nota[i]);
var intAtual = vozes[x].nota[voz] - vozes[x].nota[i];
var intAnt = vozes[x-1].nota[voz] - vozes[x-1].nota[i];
if (dir1 == dir2 && dir1 != 0) { // both voices moving in the same direction
if (Math.abs(intAtual%12) == 7 && intAtual == intAnt && paralela5.checked) { //tests 5th parallel
if (vozAnt == voz) { var qtdPar5 = par5 + 2; }
par5++;
par5Status = true;
vozAnt = voz, vozAtual = i;
acorAnt = x;
par8 = 0, par8Status = false;
} else if (par5Status) { verificou58(); };
if (Math.abs(intAtual%12) == 0 && intAtual == intAnt && paralela8.checked) { // tests 8th parallel
if (vozAnt == voz) { var qtdPar8 = par8 + 2;}
par8++;
par8Status = true;
vozAnt = voz, vozAtual = i;
acorAnt = x;
par5 = 0, par5Status = false;
} else if (par8Status) { verificou58(); };
} else { verificou58(); };
};
};
};
function verificou58() {
if (paral8Ext.checked) {
if (vozAnt == 0 && vozAtual == vozes[acorAnt].nota.length-1) {
if (par8Status && par8 > qtdpar8Rep) {
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "8th parallel", qtdPar8 , 2);};
}; } else {
if (par8Status && par8 > qtdpar8Rep) {
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "8th parallel", qtdPar8 , 2);};
};
if (paral5Ext.checked) {
if (vozAnt == 0 && vozAtual == vozes[acorAnt].nota.length-1) {
if (par5Status && par5 > qtdpar5Rep) {
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "5th parallel", qtdPar5 , 2);};
}; } else {
if (par5Status && par5 > qtdpar5Rep) {
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "5th parallel", qtdPar5 , 2);};
};
par8Status = false; par8 = 0;
par5Status = false; par5 = 0;
};
}
function quartas() {
var par4Status = true;
var acorAnt = 1;
var qtdpar4Rep = parseInt(par4Rep.text);
// console.log("par4Rep : "+ qtdpar4Rep)
for (var voz=0; voz < 10; voz++) { // go through voices
var vozAnt = voz;
for (var i=voz+1; i < 10; i++) { // go through other voices
var vozAtual = i;
var par4 = 0;
for (var x=1;x= vozes[x].nota.length-1 || i >= vozes[x].nota.length) { verificou4(); continue; };
var dir1 = direção(vozes[x].nota[voz] - vozes[x-1].nota[voz]);
var dir2 = direção(vozes[x].nota[i] - vozes[x-1].nota[i]);
var intAtual = vozes[x].nota[voz] - vozes[x].nota[i];
var intAnt = vozes[x-1].nota[voz] - vozes[x-1].nota[i];
if (Math.abs(intAtual%12) == 5 && intAtual == intAnt && dir1 == dir2 && dir1 != 0) { //tests for 4th parallel
if (vozAnt == voz) { var qtdPar4 = par4 + 2;}
par4++;
par4Status = true;
acorAnt = x;
vozAnt = voz, vozAtual = i;;
} else { verificou4(); };
};
};
};
function verificou4() {
if (par4Status && par4 > qtdpar4Rep) {
if (paral4Ext.checked) {
if (vozAnt == 0 && vozAtual == vozes[acorAnt].nota.length-1) {
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "4th parallel", qtdPar4 , 2); };
} else {
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "4th parallel", qtdPar4 , 2);
};
};
par4Status = false; par4 = 0;
};
}
function terçasSextas() {
var par3Status = true, par6Status = true;
var acorAnt = 1;
var qtdpar36Rep = parseInt(par36Rep.text);
for (var voz=0; voz < 10; voz++) { // percorre vozes
var vozAnt = voz;
for (var i=voz+1; i < 10; i++) { // percorre outras vozes
var vozAtual = i;
var par3 = 0, par6 = 0;
for (var x=1;x= vozes[x].nota.length-1 || i >= vozes[x].nota.length) {
if (x==vozes.length-1) {verificou36();};
continue;
};
var dir1 = direção(vozes[x].nota[voz] - vozes[x-1].nota[voz]);
var dir2 = direção(vozes[x].nota[i] - vozes[x-1].nota[i]);
var intAtual = vozes[x].nota[voz] - vozes[x].nota[i];
var intAnt = vozes[x-1].nota[voz] - vozes[x-1].nota[i];
// console.log("voz, i, x: "+voz+", "+i+", "+x+" | intAnt: "+intAnt+" intAtual: "+intAtual)
if (dir1 == dir2 && dir1 != 0) { // both voices moving in the same direction
if ((Math.abs(intAtual%12) == 3 || Math.abs(intAtual%12) == 4) && //testa por 3ª paralela --
(Math.abs(intAnt%12) == 3 || Math.abs(intAnt%12) == 4)) {
if (vozAnt == voz) { var qtdPar3 = par3 + 2; }
// console.log("testa por 3ª: x = " + x + " | qtdPar3 = "+ qtdPar3 + " ("+ par3 + " + 2) | vozAnt = " + vozAnt + ", voz = " + voz)
par3++;
par3Status = true;
vozAnt = voz, vozAtual = i;
acorAnt = x;
par6 = 0, par6Status = false;
} else if (par3Status) { verificou36(); };
if ((Math.abs(intAtual%12) == 8 || Math.abs(intAtual%12) == 9) && //testa por 6ª paralela --
(Math.abs(intAnt%12) == 8 || Math.abs(intAnt%12) == 9)) {
if (vozAnt == voz) { var qtdPar6 = par6 + 2;}
// console.log("testa por 6: x = " + x + " | qtdPar6 = "+ qtdPar6 + " ("+ par6 + " + 2) | vozAnt = " + vozAnt + ", voz = " + voz)
par6++;
par6Status = true;
vozAnt = voz, vozAtual = i;
acorAnt = x;
par3 = 0, par3Status = false;
} else if (par6Status) { verificou36(); };
} else { verificou36(); };
};
};
};
function verificou36() {
if (paral36Ext.checked) {
if (vozAnt == 0 && vozAtual == vozes[acorAnt].nota.length-1) {
if (par3Status && par3 > qtdpar36Rep) { //console.log("Else NOT from 3rd. acorAnt = " + acorAnt)
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "3rd parallel", qtdPar3 , 2);};
if (par6Status && par6 > qtdpar36Rep) { //console.log("Else NOT from 6th. acorAnt = " + acorAnt)
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "6th parallel", qtdPar6 , 2);};
}; } else {
if (par3Status && par3 > qtdpar36Rep) { //console.log("Else NOT from 3rd. acorAnt = " + acorAnt)
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "3rd parallel", qtdPar3 , 2);};
if (par6Status && par6 > qtdpar36Rep) { //console.log("Else NOT from 6th. acorAnt = " + acorAnt)
verificados++;
criaResultado(verificados, acorAnt, vozAnt, vozAtual, "6th parallel", qtdPar6 , 2);}
};
par6Status = false; par6 = 0;
par3Status = false; par3 = 0;
};
}
function ocultas() {
for (var x=1;x 2) { cond = cond + "c" }; // somente salto na superior
if (ocultAsc.checked) { ocultas = "a" };
if (ocultExt.checked) { ocultas = ocultas + "b" };
if (ocultSalto.checked) { ocultas = ocultas + "c" };
var pertence = false;
for (z=0;z -1) { pertence = true;} else { pertence = false; break; };
};
if (pertence || ocultas == "") {
verificados++;
criaResultado(verificados, x, voz, i, "5th hidden", 2, 2);
};
};
if (Math.abs(intAtual%12) == 0 && intAtual != intAnt && oculta8.checked) { // testa ocultas
// testa consições
var cond = ""; var ocultas = ""; // limpa variáveis
if (dir1 == 1) { cond = "a" }; // somente ascendente
if (voz == 0 && i == vozes[x].nota.length-1) { cond = cond + "b" }; // somente vozes externas
if (Math.abs(vozes[x-1].nota[voz] - vozes[x].nota[voz]) > 2) { cond = cond + "c" }; // somente salto na superior
if (ocultAsc.checked) { ocultas = "a" };
if (ocultExt.checked) { ocultas = ocultas + "b" };
if (ocultSalto.checked) { ocultas = ocultas + "c" };
var pertence = false;
for (z=0;z -1) { var pertence = true;} else { pertence = false; break; };
};
if (pertence || ocultas == "") {
verificados++;
criaResultado(verificados, x, voz, i, "8ª oculta", 2, 2);
};
};
};
};
};
};
}
function consecutivas() {
for (var x=1;x vozes[x].nota[voz]) { // testa overlapping desc
verificados++;
criaResultado(verificados, x, voz, i, "overlapping", 2, 2);};
};
};
};
};
}
function unissono() {
var int1;
for (var x=0;x1) {acordeAnt = acordeAtual;};
recGrau = reconheceGrau(x); if (!recGrau && recGrau !== 0) { return; };
acordeAtual = acordeGrau[recGrau].Grau;
if (acordeAtual.substr(-1,1) == "O") { acordeAtual = acordeAtual.slice(0, acordeAtual.length-1)}
for (var voz=0; voz < vozes[x].tonal.length; voz++) { // verifica se acorde atual contém a tônica
if (vozes[x].tonal[voz] == tonica) { contemTonica = true; }
};
for (var voz=0; voz < vozes[x].tonal.length; voz++) { // verifica resolução em todas as vozes
if (vozes[x].tonal[voz] != tonica && vozes[x-1].tonal[voz] == sensivel && contemTonica) {
if ((acordeAnt == "V" || acordeAnt == "V7") && (acordeAtual == "I" || acordeAtual == "i" || acordeAtual == "I7" ||
acordeAtual == "i7")) { cond = cond+"a";}; // V-I
if ((acordeAnt == "V" || acordeAnt == "V7") && (acordeAtual == "vi" || acordeAtual == "VI" || acordeAtual == "vi7" ||
acordeAtual == "VI7")) { cond = cond+"b";}; // V-vi
if ((sensivelExt.checked && voz == 0) || !sensivelExt.checked ) { libVoz = true; } else { libVoz = false; };
if ((sensivelVI.checked && cond.substr(0,1) == "a") || (sensivelVvi.checked && cond.substr(-1,1) == "b") ||
(!sensivelVI.checked && !sensivelVvi.checked)) { libAcorde = true; } else { libAcorde = false; };
if (libVoz && libAcorde) {
verificados++;
criaResultado(verificados, x, voz, voz+1, "sensível não resolveu na tônica", 2, 1);
};
};
};
};
}
function resolve43() {
var tonica = tonicaTPC(btTonica.text, btAcid.text);
var terça = tonica + 4;
var sensivel = tonica - 1;
var acordeAnt = acordeGrau[reconheceGrau(0)].Grau;
var acordeAtual;
for (var x=1;x1) {acordeAnt = acordeAtual;};
acordeAtual = acordeGrau[reconheceGrau(x)].Grau;
if (acordeAtual.substr(-1,1) == "O") { acordeAtual = acordeAtual.slice(0, acordeAtual.length-1)}
for (var voz=0; voz < vozes[x].tonal.length; voz++) { // verifica se acorde atual contém a terça
if (vozes[x].tonal[voz] == terça) { contemTerça = true; }
};
for (var voz=0; voz < vozes[x].tonal.length; voz++) { // verifica resolução em todas as vozes
if (vozes[x].tonal[voz] != terça && vozes[x-1].tonal[voz] == sensivel && contemTerça) {
if ((acordeAnt == "V" || acordeAnt == "V7") && (acordeAtual == "I" || acordeAtual == "i" || acordeAtual == "I7" ||
acordeAtual == "i7")) { cond = cond+"a";}; // V-I
if ((acordeAnt == "V" || acordeAnt == "V7") && (acordeAtual == "vi" || acordeAtual == "VI" || acordeAtual == "vi7" ||
acordeAtual == "VI7")) { cond = cond+"b";}; // V-vi
if ((res43Ext.checked && voz == 0) || !res43Ext.checked ) { libVoz = true; } else { libVoz = false; };
if ((res43VI.checked && cond.substr(0,1) == "a") || (res43Vvi.checked && cond.substr(-1,1) == "b") ||
(!res43VI.checked && !res43Vvi.checked)) { libAcorde = true; } else { libAcorde = false; };
if (libVoz && libAcorde) {
verificados++;
criaResultado(verificados, x, voz, voz+1, "4^ não resolveu no 3^", 2, 1);
};
};
};
};
}
function segInvDissonancia() {
if (vozes.length<3) {msgErros.text += "You don't have the minimum number of chords to check the 2nd inversion treatment!\n";
msgErros.estado = true; return; }
var grau = reconheceGrau(0); if (!grau && grau !== 0) { return; };
var acorde1 = acordeGrau[grau].Grau;
var pos1 = reconheceInversão(grau, vozes[0].tonal[vozes[0].tonal.length-1]);
grau = reconheceGrau(1); if (!grau && grau !== 0) { return; }
var acorde2 = acordeGrau[grau].Grau;
var pos2 = reconheceInversão(grau, vozes[1].tonal[vozes[1].tonal.length-1]);
var acorde3, pos3;
var vB1 = vozes[0].nota[vozes[0].nota.length-1]; // voz do Baixo
var vB2 = vozes[1].nota[vozes[1].nota.length-1];
var vB3;
for (var x=2;x 2) { acorde1 = acorde2; pos1 = pos2; vB1 = vB2; acorde2 = acorde3; pos2 = pos3; vB2 = vB3; };
grau = reconheceGrau(x); if (!grau && grau !== 0) { continue; }
acorde3 = acordeGrau[grau].Grau;
pos3 = reconheceInversão(grau, vozes[x].tonal[vozes[x].tonal.length-1]);
vB3 = vozes[x].nota[vozes[x].nota.length-1];
if (pos2 == 2) {
var int1 = Math.abs(vB1-vB2); var int2 = Math.abs(vB3-vB2);
// verifica condições
if (int1 < 3 && int1 > 0) { gConj1 = true; } else if (int1 == 0) { bPara1 = true; } ; // grau conjunto e baixo parado
if (int2 < 3 && int2 > 0) { gConj2 = true; } else if (int2 == 0) { bPara2 = true; } ;
if (acorde1 == acorde2 && pos1 != pos2) { arp1 = true; } ; // arpejo
if (acorde3 == acorde2 && pos3 != pos2) { arp2 = true; } ;
if (pos1 == 2 || pos3 == 2) { seguidos = true; }; // acordes seguidos em segunda inversão
if (!segInvConj.checked) { gConj1 = false; gConj2 = false; };
if (!segInvArp.checked) { arp1 = false; arp2 = false; };
if (!segInvPara.checked) { bPara1 = false; bPara2 = false; };
if ((!gConj1 && !arp1 && !bPara1) || (!gConj2 && !arp2 && !bPara2) || seguidos) {
verificados++;
criaResultado(verificados, x-1, 0, vozes[x-1].nota.length-1, texto, 1, vozes[x].nota.length);
};
};
};
}
function trataDissonancias() {
if (vozes.length<3) { msgErros.text += "You do not have the minimum number of chords to check for dissonance treatment!\n";
msgErros.estado=true; return; };
var tom = tonicaTPC(btTonica.text, btAcid.text);
var acorde1 = false, acorde2 = false, acorde3 = false;
var diss1=[], diss2=[], diss3=[];
var notas1=[], notas2=[], notas3=[];
for (var x=0;x= 2) { acorde1 = acorde2; acorde2 = acorde3;
diss1 = diss2; diss2 = diss3;
notas1 = notas2; notas2 = notas3;
};
var grau = reconheceGrau(x); if (!grau && grau !== 0) { continue; };
switch (acordeGrau[grau].modo) { // if omitted, check the corresponding complete chord;
case "M": if (acordeGrau[grau].Grau.substr(-1,1) == "O"){ grau = grau - 7;}; break;
case "m": if (acordeGrau[grau].Grau.substr(-1,1) == "O"){ grau = grau - 15;}; break;
};
notas3 = acordeGrau[grau].tpc;
var cifra = acordeGrau[grau].Grau.substr(-1,1);
if (cifra == "7" || cifra == "+" || cifra == "°" || cifra == "ø" || cifra == "M") { acorde3 = true; } else { acorde3 = false; };
diss3 = acordeGrau[grau].diss;
if (x > 1 && acorde2) { // proceeds to checks, if chord2 is dissonant
for (var voz=0; voz < vozes[x].tonal.length; voz++) { // percorre vozes
var sus = false, NP = false, BS = false, BI = false, Ap = false, Ret = false, Ant = false, Esc = false, ped = false, reso = false;
var dissAtual = identificaDisso(diss2, x-1, voz, notas2);
if (dissAtual) {
// var dissPreparação = identificaDisso(diss1, x-2, voz, notas1);
var dissResolução = identificaDisso(diss3, x, voz, notas3);
var int1 = vozes[x-1].nota[voz]-vozes[x-2].nota[voz];
var int2 = vozes[x].nota[voz]-vozes[x-1].nota[voz];
var int3 = vozes[x].nota[voz]-vozes[x-2].nota[voz];
// verifica condições
if (dissSusp.checked) { // suspensão
if (int1 == 0 && int2 > -3 && int2 < 0) { sus = true; }; };
if (dissNP.checked) { // nota de passagem
if ((int1 > - 3 && int1 < 0 && int2 > -3 && int2 < 0) ||
(int1 < 3 && int1 > 0 && int2 < 3 && int2 > 0)) { NP = true; }; };
if (dissBordS.checked) { // bordadura superior
if (int1 < 3 && int1 > 0 && int2 > -3 && int2 < 0) { BS = true; }; };
if (dissBordI.checked) { // bordadura inferior
if (int1 > -3 && int1 < 0 && int2 < 3 && int2 > 0) { BI = true; }; };
if (dissAp.checked) { // apojatura
if (int1 > 0 && int2 > -3 && int2 < 0) { Ap = true; }; };
if (dissRet.checked) { // retardo
if (int1 == 0 && int2 < 3 && int2 > 0) { Ret = true; }; };
if (dissAnt.checked) { // antecipação
if (int1 != 0 && int2 == 0) { Ant = true; }; };
if (dissEsc.checked) { // escapada
if (int1 < 3 && int1 > 0 && int2 < -2 && int3 > -5 && int3 < 0) { Esc = true; }; };
if (dissPed.checked) { // nota pedal
if (int1 == 0 && int2 == 0) { ped = true; }; };
if (dissRes.checked) { // resolução descendente
if (int2 > -3 && int2 < 0) { reso = true;}; };
if (dissDiss.checked && dissResolução) { // dissonancia preparada ou resolvida em outra dissonancia
if (dDissB.checked) {
if (voz == vozes[x].tonal.length-1) {
verificados++;
criaResultado(verificados, x, voz, voz, "diss. preparada/resolvida em diss.", 2, 1); };
} else {
verificados++;
criaResultado(verificados, x, voz, voz, "diss. preparada/resolvida em diss.", 2, 1); };
};
if (!sus && !NP && !BS && !BI && !Ap && !Ret && !Ant && !Esc && !ped && !reso) {
verificados++;
criaResultado(verificados, x-1, voz, voz, "dissonância não tratada", 1, 1);
};
};
};
};
};
function identificaDisso(diss, acorde, voz, notas) { // function to identify whether the current voice note is a dissonance
if (diss && diss.length>0) {
for (var d=0; d 0 && int2 < 0 && int2 > -3) ||
(int1 < 0 && int2 > 0 && int2 < 3))) { continue; };
verificados++;
criaResultado(verificados, x-1, voz, voz, "diminished melodic interval", 2, 1);
};
};
};
}
function melodia7() {
if (vozes.length<2) { msgErros.text += "You don't have the minimum number of chords for the seventh jump check!\n";
msgErros.estado=true; return; };
for (var voz=0; voz < 10; voz++) { // percorre vozes
for (var x=1;x 12) {
verificados++;
criaResultado(verificados, x, voz, voz, "intervalo melódico > 8ª", 2, 1);
};
};
};
}
function melodia4() {
if (vozes.length<4) { msgErros.text += "It does not have the minimum number of chords for checking Jumps greater than the fourth fair!\n";
msgErros.estado=true; return; };
var cond1 = false, cond2 = false, cond3 = false;
for (var voz=0; voz < 10; voz++) { // percorre vozes
for (var x=3;x 5) {
if (dir1 != dir2 && dir1 != 0) { cond1 = true; } else { cond1 = false; }; //atingido na direção oposta
if (dir3 != dir2 && dir3 != 0) { cond2 = true; } else { cond2 = false; }; //resolvido na direção oposta
if (int2 < 3 && dir3 != 0) { cond3 = true; } else { cond3 = false; }; //resolve por grau conjunto
if (mel4Op.checked) { if (cond1) { marca1 = false } else { marca1 = true }; } else { marca1 = true };
if (mel4r.checked) { if (cond2) { marca2 = false } else { marca2 = true }; } else { marca2 = true };
if (mel4cj.checked) { if (cond3) { marca3 = false } else { marca3 = true }; } else { marca3 = true };
if (marca1 && marca2 && marca3) {
verificados++;
criaResultado(verificados, x-1, voz, voz, "intervalo melódico > 4ªJ", 2, 1);
};
};
};
};
}
function melodia2Salt() {
if (vozes.length<3) { msgErros.text += "You don't have the minimum number of chords to check consecutive Jumps in the same direction!\n";
msgErros.estado=true; return; };
for (var voz=0; voz < 10; voz++) { // percorre vozes
for (var x=2;x 2 && int2 > 2 && dir1 == dir2 && dir1 != 0) {
if (mel2tri.checked && ((int1 == 3 && int2 == 3) || //dim
(int1 == 3 && int2 == 4) || //m
(int1 == 4 && int2 == 3) || //M
(int1 == 4 && int2 == 4) || //A
(int1 == 3 && int2 == 6) || //dim6
(int1 == 4 && int2 == 5) || //m6
(int1 == 3 && int2 == 5) || //M6
(int1 == 6 && int2 == 3) || //dim64
(int1 == 5 && int2 == 3) || //m64
(int1 == 5 && int2 == 4) //M64
)) { continue; };
verificados++;
criaResultado(verificados, x, voz, voz, "jumps in the same direction", 3, 1);
};
};
};
}
function melodiaDC() {
if (vozes.length<3) { msgErros.text += "It does not have the minimum number of chords for the verification of composite Dissonance!\n";
msgErros.estado=true; return; };
for (var voz=0; voz < 10; voz++) { // percorre vozes
for (var x=2;x pfSs) { pfSs = vozSup[x]; };
if (vozInf[x] > pfIs) { pfIs = vozInf[x]; };
if (vozSup[x] < pfSi) { pfSi = vozSup[x]; };
if (vozInf[x] < pfIi) { pfIi = vozInf[x]; };
};
for (var x=0;x0 && vozSup[x-1] == pfSs) || (x == vozes.length-1 && vozSup[0] == pfSs)) { pfSsc--; } else
if (melPFs.checked && pfSsc > 1) { verificados++; criaResultado(verificados, x, 0, 0, "repeat upper focal point", 1, 1); }; };
if (vozSup[x] == pfSi) { pfSic++;
if ((x>0 && vozSup[x-1] == pfSi) || (x == vozes.length-1 && vozSup[0] == pfSi)) { pfSic--; } else
if (!melPFsS.checked && pfSic > 1) { verificados++; criaResultado(verificados, x, 0, 0, "repeat lower focal point", 1, 1); }; };
if (vozInf[x] == pfIs) { pfIsc++; // contagem dos pontos focais voz inferior;
if ((x>0 && vozInf[x-1] == pfIs) || (x == vozes.length-1 && vozInf[0] == pfIs)) { pfIsc--; } else
if (melPFi.checked && pfIsc > 1) { verificados++; criaResultado(verificados, x, baixo, baixo, "repeat upper focal point", 1, 1); }; };
if (vozInf[x] == pfIi) { pfIic++;
if ((x>0 && vozInf[x-1] == pfIi) || (x == vozes.length-1 && vozInf[0] == pfIi)) { pfIic--; } else
if (!melPFiS.checked && pfIic > 1) { verificados++; criaResultado(verificados, x, baixo, baixo, "repeat lower focal point", 1, 1); }; };
};
}
function variedadeDirecionamento() {
// alertar se houver acorde com qtd diferente de notas e cancelar verificação;
/*if (vozes.length<2) { msgErros.text = "It does not have the minimum number of chords for checking Jumps greater than the octave!\n ";
msgErros.visible=true; return; };*/
var qtMov = parseInt(varDirQt.text);
for (var voz=0; voz < vozes[0].nota.length; voz++) { // percorre vozes
if (!varMelS.checked && voz == 0) { continue; };
if (!varMelG.checked && voz == vozes[0].nota.length-1) { continue; };
if (!varMelI.checked && (voz != 0 && voz != vozes[0].nota.length-1)) { continue; };
var asc = [], desc = [], mov = [];
var qtA = 0, qtD = 0, qtN = 0;
for (var x=1;x=2 && mov[x-1] != mov[x-2]) { testaQt(qtN); asc = []; qtA = 0; desc = []; qtD = 0;};
if (dir1 == 0) { qtN = 0; };
if (dir1 == 1) { asc[qtA] = dir1; qtA++; qtN = asc.length; };
if (dir1 == -1) { desc[qtD] = dir1; qtD++; qtN = desc.length; };
};
testaQt(qtN);
};
function testaQt(qt) {
if (qt > qtMov) {
verificados++;
criaResultado(verificados, x-1, voz, voz, "movements in the same direction", qt+1, 1); };
};
}
function repetiçãoNotas() {
//console.log("=================repetição================")
var qtRep = parseInt(repNotaQt.text);
for (var voz=0; voz < vozes[0].nota.length; voz++) { // percorre vozes
if (!varMelS.checked && voz == 0) { continue; };
if (!varMelG.checked && voz == vozes[0].nota.length-1) { continue; };
if (!varMelI.checked && (voz != 0 && voz != vozes[0].nota.length-1)) { continue; };
var mov = []; var qt = 0;
for (var x=1;x qtRep) { verificados++;
criaResultado(verificados, x-1, voz, voz, "repetição de notas", mov.length+1, 1); };
};
}
function repetePadrão() {
if (vozes.length<4) {msgErros.text += "It does not have the minimum number of chords for checking melodic pattern repetition!\n";
msgErros.estado=true; return; }
var qtRep = parseInt(repPadQt.text);
for (var voz=0; voz < vozes[0].nota.length; voz++) { // percorre vozes
if (!varMelS.checked && voz == 0) { continue; };
if (!varMelG.checked && voz == vozes[0].nota.length-1) { continue; };
if (!varMelI.checked && (voz != 0 && voz != vozes[0].nota.length-1)) { continue; };
for (var x=4;x= 6 && vozes[x].nota[voz] == vozes[x-3].nota[voz] && vozes[x-1].nota[voz] == vozes[x-4].nota[voz]
&& vozes[x-2].nota[voz] == vozes[x-5].nota[voz] && vozes[x].nota[voz] != vozes[x-1].nota[voz]) { verRepPad(6); };
};
};
function verRepPad(numAcordes) {
verificados++;
criaResultado(verificados, x, voz, voz, "repeating honey pattern.", numAcordes, 1);
};
}
function extensãoMelodica() {
for (var voz=0; voz < vozes[0].nota.length; voz++) { // percorre vozes
if (!extMelS.checked && voz == 0) { continue; };
if (!extMelG.checked && voz == vozes[0].nota.length-1) { continue; };
if (!extMelI.checked && (voz != 0 && voz != vozes[0].nota.length-1)) { continue; };
var agudo = 0, grave = 128;
var pos1, pos2, posI, posF;
for (var i=0;i agudo) { agudo = nota; pos1 = i; };
if (nota < grave) { grave = nota; pos2 = i; };
};
if (pos1 > pos2) { posI = pos2; posF = pos1; } else { posI = pos1; posF = pos2; };
var extensao = agudo - grave;
var numAcordes = (posF - posI)+1;
var extQt = parseInt(extMelQt.text);
if (extensao > extQt) {
verificados++;
criaResultado(verificados, posF, voz, voz, "melody extension", numAcordes, 1);
};
};
}
function espaçamento() {
var int1;
var intSup = parseInt(espS.text), intBai = parseInt(espB.text)
for (var x=0;x intSup) { marcaEspaço(x,voz); };
if (voz == vozes[x].nota.length-1 && int1 > intBai) { marcaEspaço(x,voz); };
};
};
function marcaEspaço(x,voz) {
verificados++;
criaResultado(verificados, x, voz-1, voz, "maximum spacing", 1, 2);
};
}
function extensVozes() {
if (vozes[0].nota.length!=4) { msgErros.text += "Voice extension verification can only be applied to 4-voice textures!\n";
msgErros.estado=true; return; };
var sopS = n2m(sop2.text), sopI = n2m(sop1.text), altS = n2m(alto2.text), altI = n2m(alto1.text);
var tenS = n2m(ten2.text), tenI = n2m(ten1.text), baiS = n2m(bxo2.text), baiI = n2m(bxo1.text);
for (var voz=0;voz<4;voz++) { // percorre vozes
for (var x=0;x sopS || vozes[x].nota[voz] < sopI)) { marcaExtensão(x,0); };
if (voz == 1 && (vozes[x].nota[voz] > altS || vozes[x].nota[voz] < altI)) { marcaExtensão(x,1); };
if (voz == 2 && (vozes[x].nota[voz] > tenS || vozes[x].nota[voz] < tenI)) { marcaExtensão(x,2); };
if (voz == 3 && (vozes[x].nota[voz] > baiS || vozes[x].nota[voz] < baiI)) { marcaExtensão(x,3); };
};
};
function marcaExtensão(x,voz) {
verificados++;
criaResultado(verificados, x, voz, voz, "out of vocal range", 1, 1);
};
}
function acordeSemTerça() {
for (var x=0;x 3 && pcL.length < 3) { continue; };
var omitida = reconheceOmissão(vozes[x].tonal);
if ((omitida.length == 1 && omitida[0] == 3) || omitida.length == 2) {
verificados++;
criaResultado(verificados, x, 0, vozes[x].tonal.length-1, "acorde sem terça", 1, vozes[x].tonal.length);
};
};
}
function menos3PCs() {
for (var x=0;x 1) { var compasso = compAnt+" ao "+compAtual;}
else { var compasso = compAtual; };
switch (numVozes) {
case 1: var qualVoz = ", na voz "+ (voz+1); break;
case "fr":
case 2: var qualVoz = ", entre as vozes "+(voz+1)+" e "+(i+1); break;
case qtdVozes: var qualVoz = ""; break;
};
var texto = verificados+") "+tipo+": compasso "+ compasso + qualVoz;
resultado[verificados] = [texto];
for (var y=primAcorde;y<=x;y++) {
switch (numVozes) {
case 1: resultado[verificados].push(vozes[y].objeto[voz]); break;
case 2: resultado[verificados].push(vozes[y].objeto[voz], vozes[y].objeto[i]); break;
case qtdVozes: for (var k=0;k