public void SetTuning(TuningType tuningType) { type = tuningType; switch (type) { case TuningType.EQUAL_TEMPERAMENT: tuningStrategy = new EqualTemperament(); break; case TuningType.PYTHAGOREAN_TUNING: tuningStrategy = new PythagoreanTuning(); break; case TuningType.MEANTONE_TEMPERAMENT: throw new System.NotImplementedException(); break; case TuningType.JUST_INTONATION: throw new System.NotImplementedException(); break; default: tuningStrategy = null; break; } }
public EngineTuning(TuningType type) { this.type = type; }
public DifferentialTuning(TuningType type) { this.type = type; }
public BodyTuning(TuningType type) { this.type = type; }
private void CreateFretBoard() { InstrumentType type = InstrumentType.Guitar; int numberOfStrings = 6; TuningType tuning = TuningType.Standard; // Die Schleife geht durch die MenuItems der Instrumente durch und ignoriert den Seperator for (int i = 0; i < mInstrumentType.Items.Count; i++) { try { MenuItem item = (MenuItem)mInstrumentType.Items[i]; if (item.IsChecked == true) { type = _dicInstruments[item.Header.ToString()].InstrumentType; numberOfStrings = _dicInstruments[item.Header.ToString()].NumberOfStrings; break; } } catch { // ignored } } for (int i = 0; i < mTune.Items.Count; i++) { try { MenuItem item = (MenuItem)mTune.Items[i]; if (item.IsChecked == true) { tuning = Tuning.GetDicTuningsValue(item.Header.ToString()); } } catch { // ignored } } Instrument firstInstrument = new Instrument(type, numberOfStrings, tuning); Scale scale = new Scale(CBBaseNote.SelectedItem.ToString(), _dicToneMode[CBToneMode.SelectedItem.ToString()]); for (int i = 0; i < _labelList.Count; i++) { GridApplication.Children.Remove(_labelList[i]); } int numberofstrings = firstInstrument.NumberOfStrings; int wantedRows = numberofstrings + 1; int numberoffrets = 15; int wantedColumns = numberoffrets + 1; int[] fretMarkers = { 3, 5, 7, 9, 12, 15, 17 }; double heightOfFretBoard = 170; //200; // Versuchen die Höhe durch eine Funktion zu bekommen double heightOfSingleFret = heightOfFretBoard / numberOfStrings; //wantedRows; double widhtOfFretBoard = 507; // Versuchen die Breite durch eine Funktion zu bekommen double widthOfSingleFret = widhtOfFretBoard / wantedColumns; for (int i = 0; i < wantedRows; i++) { for (int j = 0; j < wantedColumns; j++) { Label b = new Label { BorderBrush = Brushes.Black }; if (i < wantedColumns - 1) { try { if (scale.wantedScale.Contains(firstInstrument.StringsOfInstrument[i].GetNoteFromString(j))) { b.Content = firstInstrument.StringsOfInstrument[i].GetNoteFromString(j); b.Background = Brushes.DarkGray; } else { b.Content = ""; b.Background = Brushes.Transparent; //(SolidColorBrush)new BrushConverter().ConvertFromString("#0306FF"); } b.BorderThickness = j == 0 ? new Thickness(0, 0, 3, 1) : new Thickness(0, 0, 1, 1); } catch { // ignored } } b.Height = heightOfSingleFret; b.Width = widthOfSingleFret; b.HorizontalContentAlignment = HorizontalAlignment.Center; if (i == numberofstrings) { b.Content = ""; b.Background = System.Windows.Media.Brushes.Transparent; b.BorderThickness = new Thickness(0, 0, 0, 1); b.Height = 30; } if (i == numberofstrings && fretMarkers.Contains(j)) { b.Content = j; } b.VerticalAlignment = VerticalAlignment.Bottom; b.HorizontalAlignment = HorizontalAlignment.Left; b.HorizontalContentAlignment = HorizontalAlignment.Right; Thickness margin = b.Margin; margin.Left = widthOfSingleFret * j; margin.Bottom = heightOfSingleFret * i; b.Margin = margin; Grid.SetRow(b, 1); GridApplication.Children.Add(b); _labelList.Add(b); } } }
public Tuner(TuningType tuningType = TuningType.EQUAL_TEMPERAMENT) { SetTuning(tuningType); }
public TransmissionTuning(TuningType type) { this.type = type; }
public Instrument(InstrumentType type, int numberOfStrings, TuningType tuning) { InstrumentType = type; NumberOfStrings = numberOfStrings; Tuning = tuning; switch (InstrumentType) { case InstrumentType.Guitar: switch (NumberOfStrings) { case 6: StringsOfInstrument.Add(new String(AllBaseNotes.E)); StringsOfInstrument.Add(new String(AllBaseNotes.A)); StringsOfInstrument.Add(new String(AllBaseNotes.D)); StringsOfInstrument.Add(new String(AllBaseNotes.G)); StringsOfInstrument.Add(new String(AllBaseNotes.H)); StringsOfInstrument.Add(new String(AllBaseNotes.E)); break; case 7: StringsOfInstrument.Add(new String(AllBaseNotes.H)); goto case 6; } break; case InstrumentType.Bass: switch (NumberOfStrings) { case 4: StringsOfInstrument.Add(new String(AllBaseNotes.E)); StringsOfInstrument.Add(new String(AllBaseNotes.A)); StringsOfInstrument.Add(new String(AllBaseNotes.D)); StringsOfInstrument.Add(new String(AllBaseNotes.G)); break; case 5: StringsOfInstrument.Add(new String(AllBaseNotes.H)); goto case 4; case 6: StringsOfInstrument.Add(new String(AllBaseNotes.H)); StringsOfInstrument.Add(new String(AllBaseNotes.E)); StringsOfInstrument.Add(new String(AllBaseNotes.A)); StringsOfInstrument.Add(new String(AllBaseNotes.D)); StringsOfInstrument.Add(new String(AllBaseNotes.G)); StringsOfInstrument.Add(new String(AllBaseNotes.C)); break; } break; } switch (tuning) { case TuningType.DropD: StringsOfInstrument[0] = new String(AllBaseNotes.D); break; case TuningType.Standard: break; } }
public TiresTuning(TuningType type) { this.type = type; }