public string NameFromStrings(TuningStrings tuning, bool flats = true)
        {
            var t         = tuning.ToArray();
            var noteNames = String.Empty;

            switch (GetTuningFamily(t))
            {
            case TuningFamily.Standard:
                noteNames = string.Format("{0} Standard", NoteName(tuning, 0, flats));
                break;

            case TuningFamily.Drop:
                noteNames = string.Format("{0} Drop {1}", NoteName(tuning, 5, true), NoteName(tuning, 0, flats));
                break;

            case TuningFamily.Open:
                break;

            default:
                for (Byte s = 0; s < 6; s++)
                {
                    noteNames += NoteName(tuning, s, flats);
                }
                break;
            }
            return(noteNames);
        }
        static string NoteName(TuningStrings tuning, byte s, bool flats = false)
        {
            String[] notesNamesHi = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
            String[] notesNamesLo = { "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B" };

            var id = Sng2014FileWriter.GetMidiNote(tuning.ToArray(), s, 0, false, 0) % 12;

            return(flats ? notesNamesLo[id] : notesNamesHi[id]);
        }
Exemplo n.º 3
0
        public string NameFromStrings(TuningStrings tuning, bool isBass, bool inBem = true)
        {
            List <Int32>  Notes     = new List <Int32>();
            List <String> NoteNames = new List <String>();

            String[] notesNames   = new String[] { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
            String[] notesNamesHi = new String[] { "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B" };
            for (Byte s = 0; s < 6; s++)
            {
                Notes.Add(Sng2014FileWriter.GetMidiNote(tuning.ToArray(), s, 0, isBass, 0));
            }
            foreach (var mNote in Notes)
            {
                if (inBem)
                {
                    NoteNames.Add(notesNamesHi[mNote % 12]);        //oct = mNote / 12 - 1
                }
                else
                {
                    NoteNames.Add(notesNames[mNote % 12]);  //oct = mNote / 12 - 1
                }
            }
            return(String.Format("{0}{1}{2}{3}{4}{5}", NoteNames[0], NoteNames[1], NoteNames[2], NoteNames[3], NoteNames[4], NoteNames[5]));
        }
 //Tuning Strings + GameVersion
 public TuningDefinition Select(TuningStrings tuningStrings, GameVersion gameVersion)
 {
     return(List.FirstOrDefault <TuningDefinition>(s => s.Tuning.ToArray().SequenceEqual(tuningStrings.ToArray()) && s.GameVersion == gameVersion));
 }
 public IEnumerable <TuningDefinition> Select(TuningStrings tuningStrings)
 {
     return(List.OfType <TuningDefinition>().Where(s => s.Tuning.ToArray().SequenceEqual(tuningStrings.ToArray())));
 }