//=========================================================================================\\ // 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