Exemplo n.º 1
0
        public PrefSettings()
        {
            StringSpacing                   = 10;
            NumberFrets                     = 24;
            MarkerSize                      = 8;
            ZoomLevelDefault                = 2F;
            BackgroundImageFileName         = "";
            IsDebugMode                     = true;
            EnableDiagramBackgroundImage    = false;
            EnableFretboardBackgroundFill   = false;
            EnableFretNumbers               = true;
            EnableDiagramFingering          = false;
            EnableDiagramStrings            = true;
            EnableDiagramNoteNames          = true;
            EnableDiagramNoteSequence       = false;
            EnableDiagramScaleIntervals     = false;
            EnableDiagramNoteNamesSharp     = true;
            EnableDiagramHighQuality        = true;
            EnableNoteColours               = true;
            EnableDisplacedFingeringMarkers = true;
            EnableDiagramTitle              = true;

            TuningManager = new TuningManager();
            CurrentTuning = new GuitarTuning();
            ScaleManager  = new ScaleManager();
        }
Exemplo n.º 2
0
 public ParameterList()
 {
     // Defaults (can be set manually in child constructors)
     TempoMean = 120;
     TempoStandardDeviation           = 0;
     LengthInSecondsMean              = 180;
     LengthInSecondsStandardDeviation = 0;
     MajorKeyFunc           = () => Pitch.G;
     TimeSignatureFunc      = () => TimeSignature.CommonTime;
     FeelFunc               = t => 4;
     ChordProgressionFilter = node => node;
     MeasuresPerSection     = type => 4;
     RepeatsPerSection      = RepeatsPerSectionFunc;
     GuitarTuning           = GuitarTuningLibrary.StandardGuitarTuning;
     BassTuning             = GuitarTuningLibrary.StandardBassTuning;
     DrumStyle              = t => new DrumStyle(t);
     RiffResolutionFunc     = t => 1.0;
 }
Exemplo n.º 3
0
        private static IEnumerable <MidiPitch> PlayableNotes(Chord chord, GuitarTuning tuning)
        {
            var chordPitches = chord.PitchesHigherThan(tuning.Pitches[0]).ToList();

            chordPitches.Add(chordPitches[0] + 7);
            chordPitches.Add(chordPitches[0] + 12);
            var root    = chordPitches[0];
            var pitches = new List <MidiPitch> {
                root
            };

            // Bottom string is the highest string in the tuning whose open pitch is lower than root
            var bottomStringIndex = 0;

            for (var i = tuning.Pitches.Length - 1; i >= 0; i--)
            {
                if (tuning.Pitches[i] < root)
                {
                    bottomStringIndex = i;
                    break;
                }
            }

            var bottomStringFingering = root - tuning.Pitches[bottomStringIndex];

            var openPitchesAboveBottomString = Enumerable.Range(bottomStringIndex + 1, tuning.Pitches.Length - 1 - bottomStringIndex).Select(i => tuning.Pitches[i]).ToList();
            var pitchesWeCanPlay             = openPitchesAboveBottomString.SelectMany(p =>
            {
                var pitchesAroundFinger = Enumerable.Range(bottomStringFingering - 2, 5).Where(f => f >= 0).Select(f => p + f);
                return(new[] { p }.Union(pitchesAroundFinger).ToList());
            }).ToList();

            pitches.AddRange(pitchesWeCanPlay.Where(p => chordPitches.Contains(p)));

            return(pitches);
        }
Exemplo n.º 4
0
        public static Pitch GetKey(GuitarTuning tuning)
        {
            var possibleKeys = new[] { tuning.Pitches[0], tuning.Pitches[0] + 2, tuning.Pitches[1] };             // e.g. E, F#, A (0, 2, 5)

            return(possibleKeys[Randomizer.Next(possibleKeys.Length)].FromMidiPitch());
        }