public static string ToPrettyString(this Intonation intonation) { switch (intonation) { case Intonation.A: return("A"); case Intonation.AsBb: return("A#/Bb"); case Intonation.B: return("B"); case Intonation.C: return("C"); case Intonation.CsDb: return("C#/Db"); case Intonation.D: return("D"); case Intonation.DsEb: return("D#/Eb"); case Intonation.E: return("E"); case Intonation.F: return("F"); case Intonation.FsGb: return("F#/Gb"); case Intonation.G: return("G"); case Intonation.GsAb: return("G#/Ab"); default: return("Unknown"); } }
static void Main(string[] args) { Console.WriteLine("MUSIQ"); Intonation root = Intonation.Unknown; while (root == Intonation.Unknown) { root = GetRoot(); } Console.Clear(); Scale scale = Scale.Unknown; while (scale == Scale.Unknown) { scale = GetScale(); } Console.Clear(); var key = new Key(root, scale, ModeBuilder.Create(scale)); Console.WriteLine(key); Console.WriteLine("Press a key to go away..."); Console.ReadKey(); }
public static string ToAudioSynthString(this Intonation intonation) { switch (intonation) { case Intonation.A: return("A"); case Intonation.AsBb: return("A#"); case Intonation.B: return("B"); case Intonation.C: return("C"); case Intonation.CsDb: return("C#"); case Intonation.D: return("D"); case Intonation.DsEb: return("D#"); case Intonation.E: return("E"); case Intonation.F: return("F"); case Intonation.FsGb: return("F#"); case Intonation.G: return("G"); case Intonation.GsAb: return("G#"); default: return(""); } }
public Chord(Intonation root, ChordComplexity complexity, IEnumerable <Interval> intervals) { Root = root; _intervals = intervals.ToList(); var octave = root.GetChromaticOctave().ToList(); switch (complexity) { case ChordComplexity.Triad: Intonations = new List <Intonation> { root, octave[_intervals.GetChromaticIndex(Degree.III)], octave[_intervals.GetChromaticIndex(Degree.V)] }; Type = GetTriadType(); break; case ChordComplexity.Seventh: Intonations = new List <Intonation> { root, octave[_intervals.GetChromaticIndex(Degree.III)], octave[_intervals.GetChromaticIndex(Degree.V)], octave[_intervals.GetChromaticIndex(Degree.VII)] }; Type = GetSeventhType(); break; } }
public static Chord GetTriadChord(this IEnumerable <Interval> intervals, Intonation root, Degree degree) { var offsetRoot = intervals.GetIntonation(root, degree); var offsetIntervals = intervals.GetOffset(degree); return(new Chord(offsetRoot, Chord.ChordComplexity.Triad, offsetIntervals)); }
public Note(Tones tone, int pitch, Intonation intonation) { this.tone = tone; this.pitch = pitch; this.intonation = intonation; this.connected = false; }
public TimelineFactory(SoundPlayer inputEmitter, Intonation intonationType) { Pronunciation = new Pronunciation(intonationType); timelinesField.Capacity = OutputManager.MAX_LETTERS; //lists resize constantly when filling. better to know its limit and prevent that to increase performance; soundPlayerRef = inputEmitter; //the reason im using a pointer is there is no need for a SoundPlayer per SentenceFactory. PossibleDebugOutput = new DebugOutputContainer(); }
public static IEnumerable <Intonation> GetChromaticOctave(this Intonation root) { var results = new List <Intonation>(); for (var i = (int)root; i <= 12; i++) { results.Add((Intonation)i); } for (var i = 1; i < (int)root; i++) { results.Add((Intonation)i); } return(results); }
public static Intonation GetIntonation(this IEnumerable <Interval> intervals, Intonation root, Degree degree) => root.GetChromaticOctave().ElementAt(intervals.GetChromaticIndex(degree));
public static IEnumerable <Intonation> GetIntonations(this IEnumerable <Interval> intervals, Intonation root) { var octave = root.GetChromaticOctave().ToList(); var results = new List <Intonation>(); results.Add(root); var index = 0; foreach (var interval in intervals) { index += (int)interval; if (index >= octave.Count) { continue; } results.Add(octave[index]); } return(results); }
private void WriteNote(StringBuilder builder, Intonation intonation) { builder.Append($"{intonation}".PadRight(20)); }
public Key(Intonation root, Scale scale, IDictionary <Degree, Mode> modes) { Root = root; Scale = scale; Modes = modes; }
public IEnumerable <Intonation> GetIntonations(Intonation root) => Intervals.GetIntonations(root);