From 3205cf1e23596d4cb79cde5cf7c7a17ea4736d4d Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Wed, 9 Nov 2022 00:16:23 -0800 Subject: [PATCH 1/9] reformat private methods harmony --- classes/Harmony.sc | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/classes/Harmony.sc b/classes/Harmony.sc index fab6725..1156c07 100644 --- a/classes/Harmony.sc +++ b/classes/Harmony.sc @@ -20,33 +20,30 @@ Harmony{ defAc= ChordsDefinitions.new.init; notesHarmony = notesList; notesInterval = Array.fill(notesHarmony.size,0); - this.setSimplify(); - this.assignListIndex(); - this.setNotesIntervals(); - this.setInversion(); - this.setInversionString(); + this.prSetSimplify(); + this.prAssignListIndex(); + this.prsetNotesIntervals(); + this.prSetInversion(); + this.prSetInversionString(); },{ notesHarmony = [0]; notesInterval = [0]; }); } - create{arg fund, type; - var notesList; - defAc= ChordsDefinitions.new.init; - defAc.arms.collect({arg elem, num; + *create{arg fund, type; + var notesList, def; + def= ChordsDefinitions.new.init; + def.arms.collect({arg elem, num; if(elem.name == type,{ notesList = elem.notesDefinition; }); }); if(notesList.size==3,{notesList.add(notesList[0]+12)}); - notesHarmony = notesList; ^Harmony.new.init(notesList+fund); } - - - assignListIndex{ + prAssignListIndex{ var cond = true; var i=0; for(0,defAc.arms.size-1,{arg i; @@ -79,7 +76,7 @@ Harmony{ ^cond; } - setSimplify{ + prSetSimplify{ var notesTemp = this.notesHarmony; var different = Array.new(notesHarmony.size); notesTemp = notesTemp %12; @@ -101,7 +98,7 @@ Harmony{ notesSimplified = different; } - setNotesIntervals{ + prsetNotesIntervals{ var dist; notesInterval = Array.new(notesHarmony.size); for(0,notesHarmony.size-1,{arg i; @@ -133,7 +130,7 @@ Harmony{ ^regresar; } - setInversion{ + prSetInversion{ inversion = switch (notesInterval[0], 1, { 0 }, 3, { 1 }, @@ -142,7 +139,7 @@ Harmony{ ); } - setInversionString{ + prSetInversionString{ var invS=""; var inv = inversion; if(isSeventh.not,{ @@ -286,5 +283,4 @@ Harmony{ ^this.fundamentalString++ harmonyTypeStr; } - } \ No newline at end of file From 2d51014d23943961e7214cbc261e71ad434cf7c2 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Wed, 9 Nov 2022 00:16:46 -0800 Subject: [PATCH 2/9] First version Harmony helpfile --- HelpSource/Classes/Harmony.schelp | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 HelpSource/Classes/Harmony.schelp diff --git a/HelpSource/Classes/Harmony.schelp b/HelpSource/Classes/Harmony.schelp new file mode 100644 index 0000000..08ddac7 --- /dev/null +++ b/HelpSource/Classes/Harmony.schelp @@ -0,0 +1,66 @@ +TITLE:: Harmony +summary:: Representation of a chord with its harmonic content. +categories:: Chords, Harmonies, Tonalities + + +DESCRIPTION:: +Defines a chord as an array of numbers toghether with its harmonic content, including its chord type, base and inversion. + +Part of link::Guides/superharmony::, a diverse library of tonal analysis of chords. + +CLASSMETHODS:: + +METHOD:: new +Defines a new Cartesian point. + +METHOD:: create +Get or set the x coordinate value. + +ARGUMENT:: +Fundamental note of the chord. + +ARGUMENT:: +Type of chord. + + +INSTANCEMETHODS:: + +subsection:: Accessing + + +METHOD:: belongsInList +Get or set the x coordinate value. + +code:: +Matrix.newDiagonal(Array.series(8)); // Integer +Matrix.newDiagonal(Array.series(8.0)); // Float +:: + +ARGUMENT:: +Array of notes + +METHOD:: equivalent +Checks if two chords have the same chord and type +code:: +Harmony([10] +:: + +ARGUMENT:: +Harmony to compare with. + + +EXAMPLES:: + +a plot: +code:: +{ LFPulse.ar(Line.kr(100, 800, 0.1)) }.plot(0.1); +:: + +50 Hz wave: +code:: +{ LFPulse.ar(50) * 0.1 }.play; +:: + + +section:: Authors +Cristian Banuelos, 2022. From 4241183e53244ee305c3aa81abbc419f265f0980 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Wed, 9 Nov 2022 13:18:53 -0800 Subject: [PATCH 3/9] Change private variables Harmony class --- classes/Harmony.sc | 53 +++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/classes/Harmony.sc b/classes/Harmony.sc index 1156c07..bafd7b6 100644 --- a/classes/Harmony.sc +++ b/classes/Harmony.sc @@ -1,15 +1,15 @@ Harmony{ - var <>fundamental = 0; - var <>notesHarmony; - var <>notesSimplified; - var <>notesInterval; - var <>harmonyTypeStr="*"; - var <>inversion; - var <>inversionStr=""; - var <>defAc; + var idxAcorde; + var prIdxAcorde; *new { arg notesList=[0]; ^super.new.init(notesList); } @@ -17,12 +17,12 @@ Harmony{ init{arg notesList; notesList=notesList.sort; if(notesList.size>0,{ - defAc= ChordsDefinitions.new.init; + prDefAc= ChordsDefinitions.new.init; notesHarmony = notesList; notesInterval = Array.fill(notesHarmony.size,0); this.prSetSimplify(); this.prAssignListIndex(); - this.prsetNotesIntervals(); + this.prSetNotesIntervals(); this.prSetInversion(); this.prSetInversionString(); },{ @@ -46,15 +46,15 @@ Harmony{ prAssignListIndex{ var cond = true; var i=0; - for(0,defAc.arms.size-1,{arg i; - if(this.belongsInList(defAc.arms[i].notesDefinition),{ - idxAcorde = i; - harmonyTypeStr = defAc.arms[i].name; + for(0,prDefAc.arms.size-1,{arg i; + if(this.prBelongsInList(prDefAc.arms[i].notesDefinition),{ + prIdxAcorde = i; + harmonyTypeStr = prDefAc.arms[i].name; }); }); } - belongsInList{arg chordNotes; + prBelongsInList{arg chordNotes; var cond=false; var tempA = Array.new(); if(notesSimplified.size==chordNotes.size,{ @@ -79,8 +79,9 @@ Harmony{ prSetSimplify{ var notesTemp = this.notesHarmony; var different = Array.new(notesHarmony.size); - notesTemp = notesTemp %12; - notesTemp = notesTemp .sort; + "prSetSimplify".postln; + notesTemp = notesTemp%12; + notesTemp = notesTemp.sort; different.add(notesTemp[0]); for(0, notesTemp.size-1,{arg i; var condicion = 0; @@ -95,23 +96,25 @@ Harmony{ different.add(notesTemp[i]); }); }); + "different".postln; + different.postln; notesSimplified = different; } - prsetNotesIntervals{ + prSetNotesIntervals{ var dist; notesInterval = Array.new(notesHarmony.size); for(0,notesHarmony.size-1,{arg i; var resta = (fundamental-notesHarmony[i]); dist = abs((fundamental-notesHarmony[i]))%12; - notesInterval.add(this.diatonicInterval(dist)); - if(this.diatonicInterval(dist)==7,{ + notesInterval.add(this.prDiatonicInterval(dist)); + if(this.prDiatonicInterval(dist)==7,{ isSeventh=true; }); }); } - diatonicInterval{arg dist; + prDiatonicInterval{arg dist; var regresar=(-1); regresar = switch (dist, 0, { 1 }, @@ -207,12 +210,14 @@ Harmony{ } metricMod12{arg unArm; - ^this.distance( + ^Harmony.lavenshteinDistance( this.notesHarmony%12, unArm.notesHarmony%12); } - distance{arg s0, s1; + *lavenshteinDistance{arg s0, s1; + // Levenshtein_distance + // https://gist.github.com/ogregoire/6eff7186fb73715924c2c1b044daee63 var len0 = s0.size+1; var len1 = s1.size+1; // the array of distances From 48bd4c285633190bb8c91b42b9e6c0acbcc224b4 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Wed, 9 Nov 2022 13:19:12 -0800 Subject: [PATCH 4/9] Change harmony create reference tonality --- classes/Tonality.sc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/Tonality.sc b/classes/Tonality.sc index 3d72644..235d393 100644 --- a/classes/Tonality.sc +++ b/classes/Tonality.sc @@ -138,7 +138,7 @@ Tonality{ getHarmonyTriad{arg degree=0; var arm =""; - arm = Harmony().create( + arm = Harmony.create( notesTonality[degree], this.getTriadType(degree)); ^arm; @@ -146,7 +146,7 @@ Tonality{ getHarmonySeventh{arg degree=0; var arm =""; - arm = Harmony().create( + arm = Harmony.create( notesTonality[degree], this.getSeventhType(degree)); ^arm; @@ -261,16 +261,16 @@ Tonality{ getHarmony{arg degree=0, type="3"; var arm =""; - arm = Harmony().create( + arm = Harmony.create( notesTonality[degree], this.getTriadType(degree)); if(type == "7",{ - arm = Harmony().create( + arm = Harmony.create( notesTonality[degree], this.getSeventhType(degree)); },{ if(type == "DD",{ - arm = Harmony().create( + arm = Harmony.create( notesTonality[degree]+7, "D7"); }); From a368b524d7a9f64a989ac3f753321ccde4b87728 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Wed, 9 Nov 2022 13:19:32 -0800 Subject: [PATCH 5/9] Harmony help file version 1 --- HelpSource/Classes/Harmony.schelp | 156 +++++++++++++++++++++++++----- 1 file changed, 134 insertions(+), 22 deletions(-) diff --git a/HelpSource/Classes/Harmony.schelp b/HelpSource/Classes/Harmony.schelp index 08ddac7..5641823 100644 --- a/HelpSource/Classes/Harmony.schelp +++ b/HelpSource/Classes/Harmony.schelp @@ -6,61 +6,173 @@ categories:: Chords, Harmonies, Tonalities DESCRIPTION:: Defines a chord as an array of numbers toghether with its harmonic content, including its chord type, base and inversion. -Part of link::Guides/superharmony::, a diverse library of tonal analysis of chords. +Part of link::Guides/superharmony::, a library with utilities for tonal analysis of chords. CLASSMETHODS:: METHOD:: new -Defines a new Cartesian point. +Creates a new Harmony instance, it takes an array of integer numbers. Can be called with the shorthand notation +code:: +a = Harmony.new([0,4,7]) +b = Harmony([0,4,7]) +:: METHOD:: create -Get or set the x coordinate value. +Creates a four voice harmony instance from the fundamental note and chord type from the list in link::Classes/ChordsDefinition:: where you can select triads, sevenths and ninth chords among others. For example +code:: +// C minor chord [0,3,7,12] +a = Harmony.create(0,"m") -ARGUMENT:: -Fundamental note of the chord. +// A major chord [9,13,16,21] +b = Harmony.create(9,"M") + +// G diminished seventh chord [7,10,13,16] +c = Harmony.create(7,"o7") + +// D dominant seventh [2,6,9,12] +d = Harmony.create(2,"D7") + +// B major ninth with fourth suspended [11,13,16,18,22] +e = Harmony.create(11,"M9sus4") +:: ARGUMENT:: -Type of chord. +Fundamental note of the chord as an integer number. +ARGUMENT:: +Type of chord, see link::Classes/ChordsDefinition:: for available types. INSTANCEMETHODS:: subsection:: Accessing -METHOD:: belongsInList -Get or set the x coordinate value. +METHOD:: equivalent +Checks if two chords have the same chord and type, regardless of number of voices and order or octave. +code:: +a= Harmony([4,7,12,0]) +b= Harmony.create(12,"M") +c= Harmony([0,4,7]) +d= Harmony([0,3,7]) +a.equivalent(b) // true +a.equivalent(c) // true +a.equivalent(d) // false +:: +METHOD:: fundamental +Fundamental interger value of a chord. code:: -Matrix.newDiagonal(Array.series(8)); // Integer -Matrix.newDiagonal(Array.series(8.0)); // Float +a= Harmony([0,4,9]) // A minor chord +a.fundamental // 9, which is the A value of the A minor chord :: -ARGUMENT:: -Array of notes +METHOD:: fundamentalString +Fundamental string value of a chord. +code:: +a= Harmony([0,4,9]) // A minor chord +a.fundamentalString // "A" +:: -METHOD:: equivalent -Checks if two chords have the same chord and type +METHOD:: harmonyTypeStr +String value of the harmony type code:: -Harmony([10] +a= Harmony([0,4,9]) // A minor chord +a.harmonyTypeStr // "m", which is the kinf of chord of A minor :: -ARGUMENT:: -Harmony to compare with. +METHOD:: inversion +Numerical value of the inversion of the chord, CM in root value would be [0,4,7] would have value 0, first inversion [4,7,12] would have value 1, and so on. +code:: +a= Harmony([0,4,7]) // A minor chord +a.inversion // "0", root position of C Major chord +a= Harmony([4,7,12]) // A minor chord +a.inversion // "1", first inversion oc C Major chord +a= Harmony([7,12,12+4]) // A minor chord +a.inversion // "2", first inversion oc C Major chord +:: +METHOD:: inversionStr +String value of the inversion of the chord, CM in root value would be [0,4,7,11] would have value "7" as a seventh chord in root position, first inversion [4,7,12] would have value "6,5". Other inversions would have "6,4", "4,3", "2". This method works for triads and seventh chords. +code:: +a= Harmony([0,4,7,11,12]) +a.inversionStr // "7", root position of C M7 chord +b= Harmony([7,4,11,12,7+12]) +b.inversionStr // "6,5", first inversion of C M7 chord +c= Harmony([7,11,12,12+4]) +c.inversionStr // "4,3", second inversion of C M7 chord +:: -EXAMPLES:: +METHOD:: notesHarmony +Array with the sorted notes in the harmony. +code:: +b= Harmony([7,4,12,19,11,4]) +b.notesHarmony // [ 4, 4, 7, 11, 12, 19 ] +:: + +METHOD:: notesSimplified +Array with simplified version of the array of notes. Notes are converted to pitch class module 12, duplicates are removed and elements are sorted ascending. +code:: +b= Harmony([7,4,12,11,4,19]) +b.notesSimplified // [ 0,4,7,11 ] +:: + +METHOD:: nameHarmonyNoInversionStr +String with fundamental letter value an type of chord string value +code:: +b= Harmony([7,4,12,11,4,19]) +b.nameHarmonyNoInversionStr // CM7 +:: + +METHOD:: nameHarmonyString +String with fundamental letter value an type of chord string value with inversion string added. +code:: +b= Harmony([7,4,12,11,4,19]) +b.nameHarmonyString // CM7 6,5 +:: + +METHOD:: notesInterval +Degree of each chord with respect to chord type, for example for C Major seventh chord [0,4,7,11], 0 would be the fundamental 1, 4 would be the and interval of third, 7 an interval of fifth and 11 the seventh interval. +code:: +a= Harmony([0,4,7,11]) // CM7 +a.notesInterval // [1,3,5,7] + +b= Harmony([7,4,12,11,4,19]) // CM7 +b.notesInterval // [ 3, 3, 5, 7, 1, 5 ] +:: -a plot: +METHOD:: print +Prints information about the harmony: Fundamental string, type, inversion, notes, simplified notes and interval types code:: -{ LFPulse.ar(Line.kr(100, 800, 0.1)) }.plot(0.1); +a= Harmony([0,4,7,11]) // CM7 +a.print +// Fundamental: C M7 7 +// Notes: [ 0, 4, 7, 11 ] +// Simplified Notes[ 0, 4, 7, 11 ] +// Interval types[ 1, 3, 5, 7 ] :: -50 Hz wave: +METHOD:: printSimple +Prints simplifiedinformation about the harmony: Fundamental string, type and inversion. code:: -{ LFPulse.ar(50) * 0.1 }.play; +a= Harmony([0,4,7,11]) // CM7 +a.printSimple // CM7 7 :: + +EXAMPLES:: + +Creating a chord +code:: +a = Harmony([0,4,7,10]) +a.print +// Fundamental: C D7 7 +// Notes: [ 0, 4, 7, 10 ] +// Simplified Notes[ 0, 4, 7, 10 ] +// Interval types[ 1, 3, 5, 7 ] +:: + + + section:: Authors Cristian Banuelos, 2022. From 09917a7ed5c1c31939e483da4266964d2eb2a0a0 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Wed, 9 Nov 2022 13:19:49 -0800 Subject: [PATCH 6/9] Superharmony help file version 1 --- HelpSource/Guides/superharmony.schelp | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 HelpSource/Guides/superharmony.schelp diff --git a/HelpSource/Guides/superharmony.schelp b/HelpSource/Guides/superharmony.schelp new file mode 100644 index 0000000..20b0a98 --- /dev/null +++ b/HelpSource/Guides/superharmony.schelp @@ -0,0 +1,28 @@ +title:: Superharmony +summary:: Harmony universe utilities +categories:: Libraries>superharmony + +Superharmony is a diverse library of utilities for exploring tonality. + +section:: Components + +subsection:: Harmony + +Supported by link::Browse#Libraries>MathLib>Cartesian%20&c.#Cartesian &c.:: + + +subsection:: Tonality + +Tonality and scales + +subsection:: Tonal universe + +Tonal universe of coordinates. + +image::Chordtris.png:: + + + +section:: Author +Cristian Banuelos, +dr_holomorfo \ No newline at end of file From 4711bd3bc6bc658bb4945b9723ba57bf93fa0567 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Sat, 12 Nov 2022 19:19:07 -0800 Subject: [PATCH 7/9] Configure help files Fixes #2 --- HelpSource/Classes/ChordsDefinition.schelp | 85 ++++++ HelpSource/Classes/Tonality.schelp | 334 +++++++++++++++++++++ classes/Harmony.sc | 7 +- classes/ScalesChordsDefinitions.sc | 6 +- classes/TonalUniverse.sc | 25 +- classes/Tonality.sc | 94 +++--- 6 files changed, 485 insertions(+), 66 deletions(-) create mode 100644 HelpSource/Classes/ChordsDefinition.schelp create mode 100644 HelpSource/Classes/Tonality.schelp diff --git a/HelpSource/Classes/ChordsDefinition.schelp b/HelpSource/Classes/ChordsDefinition.schelp new file mode 100644 index 0000000..22ee23d --- /dev/null +++ b/HelpSource/Classes/ChordsDefinition.schelp @@ -0,0 +1,85 @@ +TITLE:: ChordsDefinition +summary:: Representation of a chord with its harmonic content. +categories:: Chords, Harmonies, Tonalities + + +DESCRIPTION:: +Defines a chord as an array of numbers toghether with its harmonic content, including its chord type, base and inversion. + +Part of link::Guides/superharmony::, a diverse library of tonal analysis of chords. + +code:: +"M": [0, 4, 7] +"m": [0, 3, 7] +"o": [0, 3, 6] +"+": [0, 4, 8] +"M7": [0, 4, 7, 11] +"D7": [0, 4, 7, 10] +"m7": [0, 3, 7, 10] +"o/7": [0, 3, 6, 10] +"o7": [0, 3, 6, 9] +"mM7": [0, 3, 7, 11] +"D7*5": [0, 4, 10] +"DM9*5": [0, 2, 4, 10] +"Dm9*5": [0, 1, 4, 10] + +"5": [0,7] +"Sus4": [0,5,7] +"Sus2": [0,2,7] +"m6": [0,3,7,9] +"9": [0,2,4,7,10] +"m9": [0,2,3,7,10] +"M9": [0,2,4,7,11] +"mM9": [0,2,3,7,11] +"11": [0,2,4,5,7,10] +"m11": [0,2,3,5,7,10] +"M11": [0,2,4,5,7,11] +"mM11": [0,2,3,5,7,11] +"13": [0,2,4,7,9,10] +"m13": [0,2,3,7,9,10] +"M13": [0,2,4,7,9,11] +"mM13": [0,2,3,7,9,11] +"add9": [0,2,4,7] +"Madd9": [0,2,3,7] +"6add9": [0,2,4,7,9] +"m6add9": [0,2,3,7,9] +"D7add11": [0,4,5,7,10] +"M7add11": [0,4,5,7,11] +"m7add11": [0,3,5,7,10] +"mM7add11": [0,3,5,7,11] +"D7add13": [0,4,7,9,11] +"M7add13": [0,4,7,9,11] +"m7add13": [0,3,7,9,10] +"mM7add13": [0,3,7,9,11] +"7b5": [0,4,6,10] +"7#5": [0,4,8,10] +"7b9": [0,1,4,7,10] +"7#9": [0,3,4,7,10] +"7#5b9": [0,1,4,8,10] +"m7#5": [0,3,8,10] +"m7b9": [0,1,3,7,10] +"9#11": [0,2,4,6,7,11] +"9b13": [0,2,4,7,8,11] +"6sus4": [0,5,7,9] + +"7sus4": [0,5,7,10] +"M7sus4": [0,5,7,11] +"9sus4": [0,2,5,7,10] +"M9sus4": [0,2,5,7,11] + +"2m": [0,1] +"2M": [0,2] +"3m": [0,3] +"3M": [0,4] +"4P": [0,5] +"6+": [0,6] +"5P": [0,7] +"6m": [0,8] +"6M": [0,9] +"7m": [0,10] +"7M": [0,11] +:: + + +section:: Authors +Cristian Banuelos, 2022. diff --git a/HelpSource/Classes/Tonality.schelp b/HelpSource/Classes/Tonality.schelp new file mode 100644 index 0000000..df53be7 --- /dev/null +++ b/HelpSource/Classes/Tonality.schelp @@ -0,0 +1,334 @@ +TITLE:: Tonality +summary:: Representation of a tonality via a scale and harmonies +categories:: Harmony + + +DESCRIPTION:: +Defines a Tonality as a pari of arrays of notes and chords with methods to get harmonic function I, II, III, IV, V, VI, VII etc. + +Part of link::Guides/superharmony::, a library with utilities for tonal analysis of chords. + +CLASSMETHODS:: + +METHOD:: new +Creates a new Tonality instance with a base note integer and a string type. +"M" major = [0,2,4,5,7,9,11], "m" harmonic minor = [0, 2, 3, 5, 7, 8, 11] +Can be called with the shorthand notation +code:: +a = Tonality.new(0,"M") +b = Tonality(0,"m") +:: + +ARGUMENT:: +Base of the scale as in integer value + +ARGUMENT:: +Type of the scale, currently only major "M" and harmonic minor "m" are supported. + + +METHOD:: degreeRoman2Number +Converts string degree to integer value. + +code:: +Tonality.degreeRoman2Number("I") // 0 +Tonality.degreeRoman2Number("iii") // 2 +Tonality.degreeRoman2Number("VII") // 6 +:: + +ARGUMENT:: +String with the value of degree. + +RETURNS:: +Integer with degree value, from 0 to 6. + + +METHOD:: getClosestChord +A origin harmony and a target harmony, this function returns an harmony equivalent to the "target" that is closest to the "origin" harmony using the Manhattan metric (taxicab metric). + +code:: +a= Harmony([0,4,7,12]) +b= Harmony.create(9,"D7") +b.print + +c=Tonality.getClosestChord(a,b) +c.print +// [9,13,16,19] +:: + +ARGUMENT:: +Origin Harmony + +ARGUMENT:: +Target Harmony + +RETURNS:: +A harmony equivalent to target harmony closest to Origin Harmony + + + + + +INSTANCEMETHODS:: + +subsection:: Accessing + + +METHOD:: notesPercentage +Checks the percentage (value from 0 to 1), of notes in an array that are part of the current tonality. +code:: +a = Tonality(0,"M") // [0,2,4,5,7,9,11] +a.notesPercentage([0,2,4]) // 1.0 +a.notesPercentage([1,3,6]) // 0.0 +a.notesPercentage([4,6,7]) // 0.666... +a.notesPercentage([0,1]) // 0.5 +:: + +ARGUMENT:: +Array of interger values. + +RETURNS:: +Float value with range 0.0 to 1.0 representing the percentage of notes present in the tonality + + +METHOD:: getHarmonyfromDegree +Returns the harmony/chord associated with the corresponding scale degree in roman numeral. +code:: +a = Tonality(0,"M") // [0,2,4,5,7,9,11] +h = a.getHarmonyfromDegree("I") // Harmony +h.printSimple // CM +a.getHarmonyfromDegree("i").printSimple // CM since its case insensitive +a.getHarmonyfromDegree("II").printSimple // Dm +a.getHarmonyfromDegree("III").printSimple // Em +a.getHarmonyfromDegree("IV").printSimple // FM +a.getHarmonyfromDegree("V").printSimple // GM +a.getHarmonyfromDegree("V7/V").printSimple // DD7 7 (D dominant seventh) +a.getHarmonyfromDegree("VI").printSimple // AM +a.getHarmonyfromDegree("VI").printSimple // AM +a.getHarmonyfromDegree("VII").printSimple // Bo (B diminished) +a.getHarmonyfromDegree("x") // nil +:: + +ARGUMENT:: +String degree, values can be I,II,III,IV,V,VI,VII and seventh chords I7,II7,III7,IV7,V7,VI7,VII7. The value is case insensitive, so I gives the same result as i. +RETURNS:: +A link::Classes/Harmony:: with the corresponding tonal function is the input is value, nil if the input was invalid + + +METHOD:: getHarmony +Returns the harmony/chord triad or seventh associated with the corresponding scale degree in numeric value (0-6). +code:: +a = Tonality(0,"M") +h = a.getHarmony(0,"3") // Harmony +h.print // CM +a.getHarmony(0,"3").printSimple // CM +a.getHarmony(0,"7").printSimple // CM7 +a.getHarmony(1,"3").printSimple // Dm +a.getHarmony(1,"7").printSimple // Dm7 +a.getHarmony(2,"3").printSimple // Em +a.getHarmony(2,"7").printSimple // Em7 +a.getHarmony(3,"3").printSimple // FM +a.getHarmony(3,"7").printSimple // FM7 +:: + +ARGUMENT:: +Integer degree, values can be 0 to 6. + +ARGUMENT:: +String to indicate if triad "3" or seventh "7" chord. + +RETURNS:: +A link::Classes/Harmony:: with the corresponding tonal function is the input is value, nil if the input was invalid + + + +METHOD:: getHarmonySeventh +Returns the harmony/chord seventh associated with the corresponding scale degree in numeric value (0-6). +code:: +a = Tonality(0,"M") +h = a.getHarmonySeventh(0) // Harmony +h.print // CM +a.getHarmonySeventh(1).printSimple // Dm7 7 +a.getHarmonySeventh(2).printSimple // Em7 7 +a.getHarmonySeventh(3).printSimple // FM7 7:w +:: + +ARGUMENT:: +Integer degree, values can be 0 to 6. + + +RETURNS:: +A seventh link::Classes/Harmony:: with the corresponding tonal function is the input is value, nil if the input was invalid + + + +METHOD:: getHarmonyTriad +Returns the harmony/chord triad associated with the corresponding scale degree in numeric value (0-6). +code:: +a = Tonality(0,"M") +h = a.getHarmonyTriad(0) // Harmony +h.print // CM +a.getHarmonyTriad(1).printSimple // Dm +a.getHarmonyTriad(2).printSimple // Em +a.getHarmonyTriad(3).printSimple // FM +:: + +ARGUMENT:: +Integer degree, values can be 0 to 6. + +RETURNS:: +A seventh link::Classes/Harmony:: with the corresponding tonal function is the input is value, nil if the input was invalid. + + +METHOD:: getSeventhType +Returns the type of seventh chord from an integer scale degree. +code:: +a = Tonality(0,"M") +h = a.getSeventhType(0) // M7 +a.getSeventhType(1) // m7 +a.getSeventhType(2) // m7 +a.getSeventhType(3) // M7 +a.getSeventhType(4) // D7 +a.getSeventhType(5) // m7 +a.getSeventhType(6) // o/7 +:: + +ARGUMENT:: +Integer degree, values can be 0 to 6. + +RETURNS:: +A string with the type of seventh chord. + + +METHOD:: getTriadType +Returns the type of triad chord from an integer scale degree. +code:: +a = Tonality(0,"M") +a.getTriadType(0) // M +a.getTriadType(1) // m +a.getTriadType(2) // m +a.getTriadType(3) // M +a.getTriadType(4) // D +a.getTriadType(5) // m +a.getTriadType(6) // o +:: + +ARGUMENT:: +Integer degree, values can be 0 to 6. + +RETURNS:: +A string with the type of triad chord. + + +METHOD:: listChords +Returns a list of Harmonies that belong to the tonality. + +RETURNS:: +List of link::Classes/Harmony::. + + +METHOD:: listNotesBelongs +Checks if a list of notes belongs to the tonality, true if all notes belong to the tonality, false if at least one note is not part of the tonality. +code:: +a = Tonality(0,"M") +a.notesTonality // -> [ 0, 2, 4, 5, 7, 9, 11 ] +a.listNotesBelongs([0,2,1]) // false +a.listNotesBelongs([0,2,4]) // true +a.listNotesBelongs([7,9]) // true +a.listNotesBelongs([]) // false +:: + +ARGUMENT:: +List of integers. + +RETURNS:: +Boolean value, true if all notes belong to the tonality, false if at least one note is not part of the tonality. + + +METHOD:: noteBelongs +Checks if a note belongs in the tonality. +code:: +a = Tonality(0,"M") +a.notesTonality // -> [ 0, 2, 4, 5, 7, 9, 11 ] +a.noteBelongs(0) // true +a.noteBelongs(1) // false +:: + +ARGUMENT:: +Integer value + +RETURNS:: +Boolean value, true if note belongs to the tonality, false if its not part of the tonality. + + +METHOD:: noteDegree +Returns an integeger degree from the note numerical value, returns -1 if number is not part of the scale. + +code:: +a = Tonality(0,"M") +a.notesTonality // -> [ 0, 2, 4, 5, 7, 9, 11 ] +a.noteDegree(0) // 1 +a.noteDegree(1) // 1 +a.noteDegree(5) // 4 +a.noteDegree(11) // 7 +:: + +ARGUMENT:: +Integer value with numeric note. + +RETURNS:: +Integer value with degree value 0 to 6, and -1 if it does not belong. + + +METHOD:: notesTonality +Notes that are part of the tonality. + +code:: +a = Tonality(0,"M") +a.notesTonality // -> [ 0, 2, 4, 5, 7, 9, 11 ] +b = Tonality(9,"m") +b.notesTonality // -> [ 9, 11, 0, 2, 4, 5, 8 ] +c = Tonality(6,"M") +c.notesTonality // -> [ 6, 8, 10, 11, 1, 3, 5 ] +:: + +RETURNS:: +List of integers with tonality values in degree order. + + +METHOD:: possibleChords +From a harmony, returns a list of the closest chords in the tonality to the reference ordered. + +code:: +a = Tonality(0,"M") +a.possibleChords(Harmony([0,2,4,7])) +// -> [ [ 1, CM ], [ 2, CM7 7 ], [ 2, Am7 7 ], [ 3, Dm ], [ 3, Em ], [ 3, Am ], [ 3, Bo ], [ 3, Dm6 6 ], [ 3, Do ], [ 3, Bo7 ], [ 4, FM ], [ 4, GM ], [ 4, Dm7 7 ], [ 4, Em7 7 ], [ 4, FM7 7 ], [ 4, GD7 7 ], [ 4, Em7 7 ], [ 4, Fm ], [ 4, GDM9*5 7 ], [ 4, GDm9*5 7 ], [ 4, G7b5 7 ], [ 4, G7#5 7 ], [ 4, GD7*5 7 ], [ 5, G9 7 ], [ 5, G7b9 7 ] ] +:: + +ARGUMENT:: +link::Classes/Harmony:: of reference. + +RETURNS:: +List of distance and link::Classes/Harmony::, [distance,Harmony] closest to the reference that belongs to the tonality, ordered by distance. + + +METHOD:: scaleBase +Integer value with base of the chord 0-6. + +METHOD:: scaleType +String value with the type of the scale "M" for major and "m" for minor. + + + +EXAMPLES:: + +Creating a Tonalyt +code:: +a = Tonality(0,"M") +h = a.getHarmonyfromDegree("I7") +h.printSimple // CM7 7 +:: + + + +section:: Authors +Cristian Banuelos, 2022. diff --git a/classes/Harmony.sc b/classes/Harmony.sc index bafd7b6..302c531 100644 --- a/classes/Harmony.sc +++ b/classes/Harmony.sc @@ -20,7 +20,7 @@ Harmony{ prDefAc= ChordsDefinitions.new.init; notesHarmony = notesList; notesInterval = Array.fill(notesHarmony.size,0); - this.prSetSimplify(); + notesSimplified = this.prSetSimplify(); this.prAssignListIndex(); this.prSetNotesIntervals(); this.prSetInversion(); @@ -79,7 +79,6 @@ Harmony{ prSetSimplify{ var notesTemp = this.notesHarmony; var different = Array.new(notesHarmony.size); - "prSetSimplify".postln; notesTemp = notesTemp%12; notesTemp = notesTemp.sort; different.add(notesTemp[0]); @@ -96,9 +95,7 @@ Harmony{ different.add(notesTemp[i]); }); }); - "different".postln; - different.postln; - notesSimplified = different; + ^different } prSetNotesIntervals{ diff --git a/classes/ScalesChordsDefinitions.sc b/classes/ScalesChordsDefinitions.sc index 0aafd5a..f633a50 100644 --- a/classes/ScalesChordsDefinitions.sc +++ b/classes/ScalesChordsDefinitions.sc @@ -136,9 +136,9 @@ ScalesChordsDefinitions{ chordsList.add (Harmony.new.init(base+7+def.str2Ac("7b9"))); } - {"l"} { "no hay".postln; } - {"n"} { "no hay".postln; } - {"a"} { "no hay".postln; }; + {"l"} { "coming soon".postln; } + {"n"} { "coming soon".postln; } + {"a"} { "coming soon".postln; }; ^this; } } \ No newline at end of file diff --git a/classes/TonalUniverse.sc b/classes/TonalUniverse.sc index d15e71f..67fdc8a 100644 --- a/classes/TonalUniverse.sc +++ b/classes/TonalUniverse.sc @@ -69,7 +69,6 @@ TonalUniverse{ var esc,fund, tip ; string= string.stripWhiteSpace; fund = this.note2Num(string.split($,)[0]); - //("fund "++fund).postln; tip =string.split($,)[1]; if(tip=="M",{ esc=this.majorUniverse[fund]; @@ -111,24 +110,24 @@ TonalUniverse{ tonActStr=seccionAct[0]; tonActual= this.getScaleString(tonActStr); listaGradStr =seccionAct[1].stripWhiteSpace.split($ ); - listaGradStr.do({arg grad; + listaGradStr.do({arg degree; if(listaFinal.size>0,{ var arm; - grad = grad.stripWhiteSpace; + degree = degree.stripWhiteSpace; // "Agregar los siguientes".postln; // "==== ".post; // ("Lista size "++listaFinal.size).postln; // listaFinal.do({arg v; (","++v.nameHarmonyNoInversionStr).post}); // (listaFinal[listaFinal.size-1].notesHarmony // ).postln; - arm=tonActual.getClosestChord( - listaFinal[listaFinal.size-1],tonActual.getChordDegreeString(grad)); + arm=Tonality.getClosestChord( + listaFinal[listaFinal.size-1],tonActual.getHarmonyfromDegree(degree)); listaFinal.add(arm); //listaFinal.postln; },{ - grad = grad.stripWhiteSpace; + degree = degree.stripWhiteSpace; //"Agregar el primero".postln; - listaFinal.add(tonActual.getChordDegreeString(grad)); + listaFinal.add(tonActual.getHarmonyfromDegree(degree)); }); listaFinal.collect({arg val; val.nameHarmonyNoInversionStr}); }); @@ -205,25 +204,25 @@ TonalUniverse{ //"Entré1".postln; // Si es dominante de otra scale for(0,scale.notesTonality.size-1,{arg i; - var grad; + var degree; //"Entré 1.1".postln; fund=scale.notesTonality[i]; //Aqui los grados 0-6 type=scale.getTriadType(i); esc = this.getScale(fund,type); - grad=this.degreeSimple(unArm,esc); + degree=this.degreeSimple(unArm,esc); //"Entré3".postln; - if(grad==5,{ + if(degree==5,{ coor.setRegion( - i+1,esc.scaleType,grad); + i+1,esc.scaleType,degree); // AQUI VOY }); - if(grad==7,{ + if(degree==7,{ // Aqui revisa si es o7 if(unArm.harmonyTypeStr=="o7",{ for(0,unArm.notesHarmony.size-1,{arg j; if(esc.noteDegree(unArm.notesHarmony[j])==7,{ - coor.setRegion(i+1,esc.scaleType,grad); + coor.setRegion(i+1,esc.scaleType,degree); //break }); }); diff --git a/classes/Tonality.sc b/classes/Tonality.sc index 235d393..8aed7f3 100644 --- a/classes/Tonality.sc +++ b/classes/Tonality.sc @@ -1,9 +1,9 @@ Tonality{ - var <>notesTonality; + var listChords; - var <>scaleType; //Char M:major, m: minor, a: armonica, n: natural, l:melodica - var <>scaleBase; var sharp; // boolean if notation has sharps or not var major; var harmonicMinor; @@ -12,6 +12,26 @@ Tonality{ ^super.new.init(base, type); } + *degreeRoman2Number{arg romNum; + var gradNum=(-1); + switch (romNum) + {"I" } { gradNum = 0;} + {"II"} { gradNum = 1;} + {"III"} { gradNum = 2;} + {"IV"} { gradNum = 3;} + {"V"} { gradNum = 4;} + {"VI"} { gradNum = 5;} + {"VII"} { gradNum = 6;} + {"i" } { gradNum = 0;} + {"ii"} { gradNum = 1;} + {"iii"} { gradNum = 2;} + {"iv"} { gradNum = 3;} + {"v"} { gradNum = 4;} + {"vi"} { gradNum = 5;} + {"vii"} { gradNum = 6;}; + ^gradNum; + } + init{arg base=0, type="M"; major = [0,2,4,5,7,9,11]; harmonicMinor = [0, 2, 3, 5, 7, 8, 11]; @@ -71,10 +91,10 @@ Tonality{ noteDegree{arg notaAc; var reg=(-1); - var grad = + var degree = this.notesTonality.indexOf(notaAc%12); - if((grad==nil).not,{ - reg = grad+1; + if((degree==nil).not,{ + reg = degree+1; }); ^reg; } @@ -130,7 +150,6 @@ Tonality{ swap=true; }); }); - }); ^lista; } @@ -152,14 +171,14 @@ Tonality{ ^arm; } - getClosestChord{arg ar1, ar2; - var armTemp=ar1, armReg, distFinal=(100), dist; - var nots, r=2; + *getClosestChord{arg originHarmony, targetHarmony; + var armTemp=originHarmony, armReg, distFinal=(100), dist; + var nots, r=3; "_______________".postln; - // ("Harmony 1 "++ar1.nameHarmonyNoInversionStr).postln; - // ("Harmony 2 "++ar2.nameHarmonyNoInversionStr).postln; - armReg = Harmony(ar2.notesHarmony); - nots = ar1.notesHarmony; + ("Harmony 1 "++originHarmony.nameHarmonyNoInversionStr).postln; + ("Harmony 2 "++targetHarmony.nameHarmonyNoInversionStr).postln; + armReg = Harmony(targetHarmony.notesHarmony); + nots = originHarmony.notesHarmony; if(nots.size==4,{ for(nots[0]-r,nots[0]+r,{arg v1; for(nots[1]-r,nots[1]+r,{arg v2; @@ -167,8 +186,8 @@ Tonality{ for(nots[3]-r,nots[3]+r,{arg v4; //(""++v1++","++v2++","++v3++","++v4).postln; armTemp = Harmony([v1,v2,v3,v4]); - dist = ar1.metricTaxi(armTemp); - if(armTemp.equivalent(ar2),{ + dist = originHarmony.metricTaxi(armTemp); + if(armTemp.equivalent(targetHarmony),{ if(dist=0,{ + regArm =this.getHarmony(gradNum,gradTipNum); + },{ + regArm= nil + }); },{ // Aqui si es dominante secundario - var gradObjNum = this.degreeRoman2Number(domSec[1]); + var gradObjNum = Tonality.degreeRoman2Number(domSec[1]); var tipoObj =this.getTriadType(gradObjNum); var gradEscalado = this.notesTonality[gradObjNum]; if((""++tipoObj) == "o",{"entro".postln; tipoObj = "m";}); "Dominante secundario".postln; ("Valores "++gradEscalado++" "++tipoObj).postln; tonTemporal = Tonality(gradEscalado,tipoObj); - regArm = tonTemporal.getChordDegreeString(domSec[0]); + regArm = tonTemporal.getHarmonyfromDegree(domSec[0]); }); ^(regArm); // ^(""++(gradNum)++" "++gradTip); } - degreeRoman2Number{arg romNum; - var gradNum=1; - switch (romNum) - {"I" } { gradNum = 0;} - {"II"} { gradNum = 1;} - {"III"} { gradNum = 2;} - {"IV"} { gradNum = 3;} - {"V"} { gradNum = 4;} - {"VI"} { gradNum = 5;} - {"VII"} { gradNum = 6;} - {"i" } { gradNum = 0;} - {"ii"} { gradNum = 1;} - {"iii"} { gradNum = 2;} - {"iv"} { gradNum = 3;} - {"v"} { gradNum = 4;} - {"vi"} { gradNum = 5;} - {"vii"} { gradNum = 6;}; - ^gradNum; - } - separateStringDegree{arg strDgr; + prSeparateStringDegree{arg strDgr; var degreeRom="", typeRom =""; var reg= Array.new(2); strDgr= strDgr.stripWhiteSpace; From adf42b9a9e7622f10941592d5ffadb23a3c44852 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Sat, 12 Nov 2022 19:19:30 -0800 Subject: [PATCH 8/9] Remove sixth chord 6 Fixes #8 --- classes/ChordsDefinition.sc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/classes/ChordsDefinition.sc b/classes/ChordsDefinition.sc index cdac449..028c4a4 100644 --- a/classes/ChordsDefinition.sc +++ b/classes/ChordsDefinition.sc @@ -2,24 +2,24 @@ ChordsDefinitions{ var <>arms; init{ arms=Array.new(500); - arms.add(HarmonyDefinition.new.init("M",[0, 4, 7])); - arms.add(HarmonyDefinition.new.init("m",[0, 3, 7])); - arms.add(HarmonyDefinition.new.init("o",[0, 3, 6])); - arms.add(HarmonyDefinition.new.init("+",[0, 4, 8])); - arms.add(HarmonyDefinition.new.init("M7",[0, 4, 7, 11])); - arms.add(HarmonyDefinition.new.init("D7",[0, 4, 7, 10])); - arms.add(HarmonyDefinition.new.init("m7",[0, 3, 7, 10])); - arms.add(HarmonyDefinition.new.init("o/7",[0, 3, 6, 10])); - arms.add(HarmonyDefinition.new.init("o7",[0, 3, 6, 9])); - arms.add(HarmonyDefinition.new.init("mM7",[0, 3, 7, 11])); - arms.add(HarmonyDefinition.new.init("D7*5",[0, 4, 10])); - arms.add(HarmonyDefinition.new.init("DM9*5",[0, 2, 4, 10])); - arms.add(HarmonyDefinition.new.init("Dm9*5",[0, 1, 4, 10])); + arms.add(HarmonyDefinition.new.init("M",[0,4,7])); + arms.add(HarmonyDefinition.new.init("m",[0,3,7])); + arms.add(HarmonyDefinition.new.init("o",[0,3,6])); + arms.add(HarmonyDefinition.new.init("+",[0,4,8])); + arms.add(HarmonyDefinition.new.init("M7",[0,4,7,11])); + arms.add(HarmonyDefinition.new.init("D7",[0,4,7,10])); + arms.add(HarmonyDefinition.new.init("m7",[0,3,7,10])); + arms.add(HarmonyDefinition.new.init("o/7",[0,3,6,10])); + arms.add(HarmonyDefinition.new.init("o7",[0,3,6,9])); + arms.add(HarmonyDefinition.new.init("mM7",[0,3,7,11])); + arms.add(HarmonyDefinition.new.init("D7*5",[0,4,10])); + arms.add(HarmonyDefinition.new.init("DM9*5",[0,2,4,10])); + arms.add(HarmonyDefinition.new.init("Dm9*5",[0,1,4,10])); arms.add(HarmonyDefinition.new.init("5",[0,7])); arms.add(HarmonyDefinition.new.init("Sus4",[0,5,7])); arms.add(HarmonyDefinition.new.init("Sus2",[0,2,7])); - arms.add(HarmonyDefinition.new.init("6",[0,4,7,9])); // Check difference with A7 in [CM] + // arms.add(HarmonyDefinition.new.init("6",[0,4,7,9])); // Check difference with A7 in [CM] arms.add(HarmonyDefinition.new.init("m6",[0,3,7,9])); arms.add(HarmonyDefinition.new.init("9",[0,2,4,7,10])); arms.add(HarmonyDefinition.new.init("m9",[0,2,3,7,10])); From 307f4c4865c9491009868d95bed73d77cad6cbd6 Mon Sep 17 00:00:00 2001 From: C Banuelos Date: Sat, 12 Nov 2022 20:03:57 -0800 Subject: [PATCH 9/9] Tonal univers help file --- HelpSource/Classes/TonalUniverse.schelp | 53 +++++++++++++++++++++++++ HelpSource/Guides/superharmony.schelp | 12 +----- classes/TonalUniverse.sc | 16 ++++---- 3 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 HelpSource/Classes/TonalUniverse.schelp diff --git a/HelpSource/Classes/TonalUniverse.schelp b/HelpSource/Classes/TonalUniverse.schelp new file mode 100644 index 0000000..d80faf7 --- /dev/null +++ b/HelpSource/Classes/TonalUniverse.schelp @@ -0,0 +1,53 @@ +TITLE:: TonalUniverse +summary:: Set of tonalities and relations between them +categories:: Harmony + + +DESCRIPTION:: +Defines a TonalUniverse that consists in an set of Tonalities, functions and relations among them. It can be used to analyze a chord relation to any tonality + +Part of link::Guides/superharmony::, a library with utilities for tonal analysis of chords. + +CLASSMETHODS:: + +METHOD:: new +Creates a tonality universe that contains all the mayor and minor tonalities. +code:: +u=TonalUniverse(); +:: + + + +INSTANCEMETHODS:: + +subsection:: Accessing + + +METHOD:: getHarmonyList +From a string of roman numeral functions, returns a proposal of chords with those tonal functions. +code:: +( +u=TonalUniverse(); +~str= +"C,m: I V7/VI VI V VI II II7 IV VII7 I +E,m: V7 I IV V7/V I +C,m: V7/V V7 I +"; +~chords=u.getHarmonyList(~str); +~arrayNotes=~chords.collect({arg ar; ar.notesHarmony[0..3]}); +) +// -> [ [ 0, 3, 7, 12 ], [ -2, 3, 7, 13 ], [ -4, 3, 8, 12 ], [ -5, 2, 7, 11 ], [ -4, 3, 8, 12 ], [ -4, 5, 8, 14 ], [ -7, 2, 8, 12 ], [ -7, 0, 8, 12 ], [ -7, -1, 8, 14 ], [ -9, 0, 7, 15 ], [ -9, -1, 9, 18 ], [ -8, -1, 7, 19 ], [ -8, 0, 9, 21 ], [ -8, 1, 6, 22 ], [ -8, -1, 7, 23 ], [ -10, -3, 6, 24 ], [ -10, -5, 5, 23 ], [ -9, -5, 3, 24 ] ] + +:: + +ARGUMENT:: +String with current tonality and harmonies in roman numerals separeted by space. + +RETURNS:: +List of Harmonies with those tonal functions. + + + + +section:: Authors +Cristian Banuelos, 2022. diff --git a/HelpSource/Guides/superharmony.schelp b/HelpSource/Guides/superharmony.schelp index 20b0a98..4a5cb3e 100644 --- a/HelpSource/Guides/superharmony.schelp +++ b/HelpSource/Guides/superharmony.schelp @@ -8,19 +8,9 @@ section:: Components subsection:: Harmony -Supported by link::Browse#Libraries>MathLib>Cartesian%20&c.#Cartesian &c.:: - - subsection:: Tonality -Tonality and scales - -subsection:: Tonal universe - -Tonal universe of coordinates. - -image::Chordtris.png:: - +subsection:: TonalUniverse section:: Author diff --git a/classes/TonalUniverse.sc b/classes/TonalUniverse.sc index 67fdc8a..1fa2452 100644 --- a/classes/TonalUniverse.sc +++ b/classes/TonalUniverse.sc @@ -1,12 +1,12 @@ TonalUniverse{ - var <>majorUniverse; - var <>minorUniverse; - var <>majorPercentage; - var <>minorPercentage; - var <>percentagesVector; - var <>currentScaleFundamental; - var <>currentScaleType; - var <>currentScaleIndex=0; + var