private void OnKeySelectedCommand(Key key)
 {
     Infrastructure.Dimensions.Keys.Key = key;
 }
Exemplo n.º 2
0
        public static void InitializeKeys()
        {
            if (KeyList.Count == 0)
            {
                KeyList = new List<Key>();

                KeyList.Add(new Key() { Id = 0, Index = 0, Name = "C", AccidentalCount = 0, Scale = "C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb", Caption = "Key of C", Listable = true, BindingHelper = new Tuple<string, int?>("", 0) });
                KeyList.Add(new Key() { Id = 1, Index = 7, Name = "G", AccidentalCount = 1, Scale = "G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb", Caption = "Key of G", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 1) });
                KeyList.Add(new Key() { Id = 2, Index = 2, Name = "D", AccidentalCount = 2, Scale = "D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db", Caption = "Key of D", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 2) });
                KeyList.Add(new Key() { Id = 3, Index = 9, Name = "A", AccidentalCount = 3, Scale = "A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab", Caption = "Key of A", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 3) });
                KeyList.Add(new Key() { Id = 4, Index = 4, Name = "E", AccidentalCount = 4, Scale = "E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb", Caption = "Key of E", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 4) });
                KeyList.Add(new Key() { Id = 5, Index = 11, Name = "B", AccidentalCount = 5, Scale = "B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb", Caption = "Key of B", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 5) });
                KeyList.Add(new Key() { Id = 12, Index = 6, Name = "Gb", AccidentalCount = 6, Scale = "Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F", Caption = "Key of Gb", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 6) });
                KeyList.Add(new Key() { Id = 13, Index = 1, Name = "Db", AccidentalCount = 5, Scale = "Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C", Caption = "Key of Db", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 5) });
                KeyList.Add(new Key() { Id = 8, Index = 8, Name = "Ab", AccidentalCount = 4, Scale = "Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G", Caption = "Key of Ab", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 4) });
                KeyList.Add(new Key() { Id = 9, Index = 3, Name = "Eb", AccidentalCount = 3, Scale = "Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D", Caption = "Key of Eb", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 3) });
                KeyList.Add(new Key() { Id = 10, Index = 10, Name = "Bb", AccidentalCount = 2, Scale = "As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A", Caption = "Key of Bb", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 2) });

                //In no circumstances may this note be called E♯
                KeyList.Add(new Key() { Id = 11, Index = 5, Name = "F", AccidentalCount = 1, Scale = "F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb", Caption = "Key of F", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 1) });
                KeyList.Add(new Key() { Id = 6, Index = 6, Name = "Fs", AccidentalCount = 6, Scale = "Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F", Caption = "Key of Fs", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 6) });
                KeyList.Add(new Key() { Id = 7, Index = 1, Name = "Cs", AccidentalCount = 7, Scale = "Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C", Caption = "Key of Cs", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Sharp, 7) });

                //1. the enharmonically equivalent key signature B major (five sharps) is usually used instead
                //2. C♭ major is the only major or minor key, other than theoretical keys, which has "flat" or "sharp" in its name, but whose tonic note is the enharmonic equivalent of a natural note (a white key on a keyboard instrument).
                KeyList.Add(new Key() { Id = 14, Index = 11, Name = "Cb", AccidentalCount = 7, Scale = "B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb", Caption = "Key of Cb", Listable = true, BindingHelper = new Tuple<string, int?>(_Accidental.Flat, 7) });

                //In no circumstances may this note be used as F Major
                KeyList.Add(new Key() { Id = 18, Index = 5, Name = "Es", AccidentalCount = null, Scale = "F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb", Caption = "", Listable = false, BindingHelper = new Tuple<string, int?>("", null) });

                //For clarity and simplicitly, F-flat major is usually notated as its enharmonic equivalent of E major.
                KeyList.Add(new Key() { Id = 19, Index = 4, Name = "Fb", AccidentalCount = null, Scale = "E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb", Caption = "Key of Fb", Listable = false, BindingHelper = new Tuple<string, int?>("", null) });

                //Theoretical keys
                //For clarity and simplicity, G-sharp major is usually notated as its enharmonic equivalent of A-flat major
                KeyList.Add(new Key() { Id = 15, Index = 8, Name = "Gs", AccidentalCount = null, Scale = "Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G", Caption = "Theoretical", Listable = false, BindingHelper = new Tuple<string, int?>("", null) });
                KeyList.Add(new Key() { Id = 16, Index = 3, Name = "Ds", AccidentalCount = null, Scale = "Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb,C,Cs-Db,D", Caption = "Theoretical", Listable = false, BindingHelper = new Tuple<string, int?>("", null) });
                KeyList.Add(new Key() { Id = 17, Index = 10, Name = "As", AccidentalCount = null, Scale = "As-Bb,B-Cb,C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A", Caption = "Theoretical", Listable = false, BindingHelper = new Tuple<string, int?>("", null) });
                KeyList.Add(new Key() { Id = 18, Index = 0, Name = "Bs", AccidentalCount = null, Scale = "C,Cs-Db,D,Ds-Eb,E-Fb,F,Fs-Gb,G,Gs-Ab,A,As-Bb,B-Cb", Caption = "", Listable = false, BindingHelper = new Tuple<string, int?>("", null) });
                //End Theoretical keys

                Key = (from a in KeyList where a.Name == Preferences.DefaultKey select a).Single();

                KeyScaleMap();
            }
        }
Exemplo n.º 3
0
 private static Key ChangeKey(string key)
 {
     var k = (from a in KeyList where a.Name.Trim() == key select a).DefaultIfEmpty(null).Single();
     if (k != null)
     {
         Key = k;
     }
     return Key;
 }
Exemplo n.º 4
0
 public static Key ChangeKey(Key key, int interval)
 {
     return key + interval;
 }