Skip to content

Commit

Permalink
Update initial set key, demo links
Browse files Browse the repository at this point in the history
  • Loading branch information
deltadada committed Aug 21, 2014
1 parent 8ef9ad0 commit 1582f30
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 69 deletions.
124 changes: 62 additions & 62 deletions ScaleDictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ kGsharp = {"name" : "G♯", "safename" : "Gsharp","baseScale" : CHROMSHARP,

// dict keys collects above objects
var dictKeys = {
"Cnatural" : kC,
"Dflat" : kDflat,
"Dnatural" : kD,
"Eflat" : kEflat,
"Enatural" : kE,
"Fnatural" : kF,
"Gflat" : kGflat,
"Gnatural" : kG,
"Aflat" : kAflat,
"Anatural" : kA,
"Bflat" : kBflat,
"Bnatural" : kB,
"Csharp" : kCsharp,
"Fsharp" : kFsharp,
"Cnatural" : kC,
"Dflat" : kDflat,
"Dnatural" : kD,
"Eflat" : kEflat,
"Enatural" : kE,
"Fnatural" : kF,
"Gflat" : kGflat,
"Gnatural" : kG,
"Aflat" : kAflat,
"Anatural" : kA,
"Bflat" : kBflat,
"Bnatural" : kB,
"Csharp" : kCsharp,
"Fsharp" : kFsharp,
"Gsharp" : kGsharp };

var INTS_FLATS = ['R', '♭9', '9', '♭3', '3', '11', '♭5', '5', '♭13', '13', '♭7', '7'];
Expand All @@ -52,9 +52,9 @@ var INTS_SUPERLOCRIAN = ['R', '♭9', '9', '♭3', '♭4', '11', '&#
var _ROOT = {
'SEMI' : 0,
'INT' : 'R',
'CLR' : 'i__ROOT'
'CLR' : 'i__ROOT'
}

var FLATNINE = {
'SEMI' : 1,
'INT' : '♭9',
Expand All @@ -71,26 +71,26 @@ var SHARPNINE = {
'SEMI' : 3,
'INT' : '♯11',
'CLR' : 'i_sharpnine'
}
}

var FLATTHREE = {
'SEMI' : 3,
'INT' : '♭3',
'CLR' : 'i_third'
}

var THIRD = {
'SEMI' : 4,
'INT' : '3',
'CLR' : 'i_third'
}
}

var DIMELEVEN = {
'SEMI' : 4,
'INT' : '♭11',
'CLR' : 'i_fourth'
}

var ELEVEN = {
'SEMI' : 5,
'INT' : '11',
Expand All @@ -114,7 +114,7 @@ var FIFTH = {
'INT' : '5',
'CLR' : 'i_fifth'
}

var AUGFIVE = {
'SEMI' : 8,
'INT' : '♯5',
Expand All @@ -126,46 +126,46 @@ var FLATTHIRTEEN = {
'INT' : '♭13',
'CLR' : 'i_sixth'
}

var THIRTEEN = {
'SEMI' : 9,
'INT' : '13',
'CLR' : 'i_sixth'
}
}

var AUGTHIRTEEN = {
'SEMI' : 10,
'INT' : '♯13',
'CLR' : 'i_sixth'
}
}

var FLATSEVEN = {
'SEMI' : 10,
'INT' : '♭7',
'CLR' : 'i_seventh'
}
}

var SEVENTH = {
'SEMI' : 11,
'INT' : '7',
'CLR' : 'i_seventh'
}
}

var TX = {
// tone outside of scale, inherit semitone and int
'SEMI' : -1,
'INT' : '',
'CLR' : 'white'
}
}

var TI = {
// tone in scale, inherit semitone and int
'SEMI' : -1,
'INT' : '',
'CLR' : 'black'
}
// Scale Formulas

// Scale Formulas
var IF_IONIAN = [_ROOT, TX, TI, TX, THIRD, TI, TX, FIFTH, TX, TI, TX, SEVENTH];
var IF_LYDIAN = [_ROOT, TX, TI, TX, THIRD, TX, SHARPELEVEN, FIFTH, TX, TI, TX, SEVENTH];
var IF_MIXOLYDIAN = [_ROOT, TX, TI, TX, THIRD, TI, TX, FIFTH, TX, TI, FLATSEVEN, TX];
Expand Down Expand Up @@ -221,12 +221,12 @@ var SC_PENTDOM = { "name" : "Dominant Pentatonic", "intnames": INTS_FLATS, "col


var dictScales = {
"SC_MAJOR": SC_MAJOR,
"SC_LYDIAN": SC_LYDIAN,
"SC_MIXOLYDIAN": SC_MIXOLYDIAN,
"SC_DORIAN": SC_DORIAN,
"SC_AEOLIAN": SC_AEOLIAN,
"SC_PHRYGIAN": SC_PHRYGIAN,
"SC_MAJOR": SC_MAJOR,
"SC_LYDIAN": SC_LYDIAN,
"SC_MIXOLYDIAN": SC_MIXOLYDIAN,
"SC_DORIAN": SC_DORIAN,
"SC_AEOLIAN": SC_AEOLIAN,
"SC_PHRYGIAN": SC_PHRYGIAN,
"SC_LOCRIAN": SC_LOCRIAN,
"SC_DIMINISHED": SC_DIMINISHED,
"SC_PENTMIN": SC_PENTMIN,
Expand All @@ -243,7 +243,7 @@ var dictScales = {
};

var ScaleModel = {

"scale" : dictScales["SC_MAJOR"]
,
"setScale" : function(newScale){
Expand All @@ -263,14 +263,14 @@ var ScaleModel = {
"getScaleName" : function(){
var s = this["scale"];
return s["name"];
}


};

}


};





//arps
var INTCLR_MAJ = ["i_root", "white","white","white","i_third","white","white","i_fifth","white","white","white","white"];
var INTCLR_MAJ7 = ["i_root", "white","white","white","i_third","white","white","i_fifth","white","white","white","i_seventh"];
Expand All @@ -279,7 +279,7 @@ var INTCLR_MIN = ["i_root", "white","white","i_third","white","white","white","i
var INTCLR_MIN7 = ["i_root", "white","white","i_third","white","white","white","i_fifth","white","white","i_seventh","white"];
var INTCLR_MIN7b5 = ["i_root", "white","white","i_third","white","white","i_fifth","white","white","white","i_seventh","white"];
var INTCLR_DIM = ["i_root", "white","white","i_third","white","white","i_fifth","white","white","i_seventh","white","white"];

var ARP_MAJ = { "name" : "maj", "intnames": INTS_FLATS, "color" : INTCLR_MAJ };
var ARP_MAJ7 = { "name" : "maj7", "intnames": INTS_SHARP4, "color" : INTCLR_MAJ7 };
var ARP_DOM7 = { "name" : "7", "intnames": INTS_SHARP4, "color" : INTCLR_DOM7 };
Expand Down Expand Up @@ -315,31 +315,31 @@ var FretboardModel = {
"ngType" : dictScales,

"getChromNames" : function(){
var cn = this["chromNames"];
var cn = this["chromNames"];
return cn;
},
"setChromNames" : function(cn){
this["chromNames"] = cn;
},
"getKeyObj" : function(){
var kObj = this["key"];
var kObj = this["key"];
return kObj;
},
"getKeyTextName" : function(){
// return text html name for CURRENT key
var kObj = this["key"];
var kObj = this["key"];
return kObj["name"];
},

"getKeySafeName" : function(){
// returns safename for CURRENT key
var kObj= this["key"];
var kObj= this["key"];
return kObj["safename"];
},
},

"getKeyInt" : function(){
// returns int for CURRENT key
var kObj = this["key"];
var kObj = this["key"];
return kObj["fromC"];
},
"setKey" : function(kObj){
Expand All @@ -356,27 +356,27 @@ var FretboardModel = {
// chrom names array will start with KEY as root
this["chromNames"] = newscale;
},

"getNotegroupDict" : function(){
// returns CURRENT ng dictionary
var d = this["ngType"];
var d = this["ngType"];
return d;
},
},

"getNotegroup" : function(){
var dict = this["ngType"];
var ng = dict[this["ng"]];
return ng;
},

"setNotegroup" : function(ng, typeDict){
if(arguments.length < 2){
arr = ng.split('_');
switch(arr[0]){
case "SC":
this["ngType"] = dictScales;
break;
case "ARP":
case "ARP":
this["ngType"] = dictArps;
break;
case "CHD":
Expand All @@ -386,16 +386,16 @@ var FretboardModel = {
} else {
this["ngType"] = typeDict;
}

this["ng"] = ng;
},

"getNGname" : function(){
var dict = this["ngType"];
var ng = dict[this["ng"]];
return ng["name"];
},

"getNGintcolor" : function(){
var dict = this["ngType"];
var ng = dict[this["ng"]];
Expand All @@ -406,5 +406,5 @@ var FretboardModel = {
var ng = dict[this["ng"]];
return ng["intnames"]; // returns array of html texts
},
};

};
12 changes: 6 additions & 6 deletions boxfrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,21 +808,17 @@ jQuery(document).ready(function() {
}
$('#fretclone > tbody:last').append(newRow);

//populateScaleMenu(); // removed from view

var url_params = get_url_parameters();
var loadFromUrl = function(){

if (is_defined(url_params['intColor'])){
if(url_params['intColor'] == "true"){

ctl_updateColorIntMode(true);
}
}

if (is_defined(url_params['key'])){
// key should use safename
ctl_change_key.keyChangeNotegroup(url_params['key']);
}

if (is_defined(url_params['intNames'])){
if(url_params['intNames'] == "true"){
ctl_updateIntervalMode(true);
Expand All @@ -847,6 +843,10 @@ jQuery(document).ready(function() {
fill_from_repr(url_params['strings']);
}
}
if (is_defined(url_params['key'])){
// key should use safename
ctl_change_key.setRoot(getKeyObjFromSafeName(url_params['key']));
}
}
loadFromUrl();
update_link();
Expand Down
6 changes: 5 additions & 1 deletion fretboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@

<li><a href="#strings=3:19;2:19;3:19;2:20;;&key=Gnatural&intColor=false&intNames=false&diagram_title=Edim7%20Fingering"
>Edim7 fingering</a></li>
<li><a href="#strings=0:14,2:7,5:11,7:0,10:4,12:14,14:7;0:0,3:4,5:14,7:7,10:11,12:0,15:4;2:11,4:0,7:4,9:14,11:7,14:11;0:4,2:14,4:7,7:11,9:0,12:4,14:14;0:11,2:0,5:4,7:14,9:7,12:11,14:0;0:14,2:7,5:11,7:0,10:4,12:14,14:7&key=Bnatural&intColor=false&intNames=true&diagram_title=B%20minor%20pentatonic&dash=Cnatural_ARP_MIN7,Fnatural_ARP_MIN7,Bflat_ARP_MIN,Eflat_ARP_DOM7,Aflat_ARP_MAJ"
<li><a href="#strings=0:14,2:7,5:11,7:0,10:4,12:14,14:7,17:11;0:0,3:4,5:14,7:7,10:11,12:0,15:4,17:14;2:11,4:0,7:4,9:14,11:7,14:11,16:0;0:4,2:14,4:7,7:11,9:0,12:4,14:14,16:7;0:11,2:0,5:4,7:14,9:7,12:11,14:0,17:4;0:14,2:7,5:11,10:4,12:14,14:7,17:11&key=Bnatural&intColor=false&intNames=false&diagram_title=B%20Minor%20Pentatonic"
>B minor pentatonic</a></li>
<li><a href="#strings=;5:15;5:15;5:15;;5:20&key=Anatural&intColor=false&intNames=true&diagram_title=A-7%20Fingering"
>A-7 fingering</a></li>

<li><a href="#strings=2:16,5:19,9:16,12:19,14:16;2:16,5:19,7:16,10:19,14:16;2:16,6:19,9:16,11:19,14:16;2:16,4:19,7:16,11:19,14:16;;&key=Fsharp&intColor=false&intNames=false&diagram_title=A%20Major%206th%20%3D%20F%23%20Minor%207th%20%3A%20b3%20of%20Min7%20%3D%20relative%20Maj%206%2C%2013%20of%20Maj6%20%3D%20relative%20Min6">
A6 / F# min7</a>
</li>

</ul>
</div>
</div>
Expand Down

0 comments on commit 1582f30

Please sign in to comment.