public void Highlight(ButtonName button, bool isNoteOn, byte velocity) { Visibility result = Convert.ToVisibility(isNoteOn); var status = isNoteOn ? MIDIStatus.NoteOn : MIDIStatus.NoteOff; MidiNote note = MidiNote.None; if (button == ButtonName.Red) { this.RedVisibility = result; note = MidiNote.AcousticSnare; } else if (button == ButtonName.Yellow_Tom) { this.YellowTomVisibility = result; note = MidiNote.LowTom; } else if (button == ButtonName.Blue_Tom) { this.BlueTomVisibility = result; note = MidiNote.HighFloorTom; } else if (button == ButtonName.Green_Tom) { this.GreenTomVisibility = result; note = MidiNote.LowFloorTom; } else if (button == ButtonName.Yellow) { this.YellowCymbalVisibility = result; note = MidiNote.ClosedHiHat; } else if (button == ButtonName.Green) { this.GreenCymbalVisibility = result; note = MidiNote.CrashCymbal1; } else if (button == ButtonName.Blue) { this.BlueCymbalVisibility = result; note = MidiNote.RideCymbal2; } else if (button == ButtonName.Bass) { this.BassVisibility = result; note = MidiNote.BassDrum1; } if (note != MidiNote.None) { MidiModel.Send(new MidiShortMessage(status, 9, (byte)note, velocity, 0)); } }
public void Highlight(ButtonName button, bool isNoteOn, byte velocity) { var result = Helpers.Convert.ToVisibility(isNoteOn); var status = isNoteOn ? MIDIStatus.NoteOn : MIDIStatus.NoteOff; byte note = 0; if (button == ButtonName.Green) { this.GreenVisibility = result; note = 50; } else if (button == ButtonName.Red) { this.RedVisibility = result; note = 52; } else if (button == ButtonName.Yellow) { this.YellowVisibility = result; note = 53; } else if (button == ButtonName.Blue) { this.BlueVisibility = result; note = 55; } else if (button == ButtonName.Orange) { this.OrangeVisibility = result; note = 57; } if (note != 0) { MidiModel.Send(new MidiShortMessage(status, 1, note, velocity, 0)); } }
public void HighlightNote(byte note, bool isNoteOn, byte velocity) { if (note < 48 || note > 72) { return; } var result = Helpers.Convert.ToVisibility(isNoteOn); switch (note) { case 48: this.C3 = result; break; case 49: this.CSharp3 = result; break; case 50: this.D3 = result; break; case 51: this.DSharp3 = result; break; case 52: this.E3 = result; break; case 53: this.F3 = result; break; case 54: this.FSharp3 = result; break; case 55: this.G3 = result; break; case 56: this.GSharp3 = result; break; case 57: this.A3 = result; break; case 58: this.ASharp3 = result; break; case 59: this.B3 = result; break; case 60: this.C4 = result; break; case 61: this.CSharp4 = result; break; case 62: this.D4 = result; break; case 63: this.DSharp4 = result; break; case 64: this.E4 = result; break; case 65: this.F4 = result; break; case 66: this.FSharp4 = result; break; case 67: this.G4 = result; break; case 68: this.GSharp4 = result; break; case 69: this.A4 = result; break; case 70: this.ASharp4 = result; break; case 71: this.B4 = result; break; case 72: this.C5 = result; break; default: throw new NotImplementedException("Unexpected note to highlight: " + note); } var status = isNoteOn ? MIDIStatus.NoteOn : MIDIStatus.NoteOff; MidiModel.Send(new radio42.Multimedia.Midi.MidiShortMessage(status, 1, note, velocity, 0)); }
public void Highlight(ButtonName button, bool isNoteOn, byte velocity) { Visibility result = PsMidiProfiler.Helpers.Convert.ToVisibility(isNoteOn); var status = isNoteOn ? MIDIStatus.NoteOn : MIDIStatus.NoteOff; MidiNote note = MidiNote.None; if (button == ButtonName.Red) { this.RedVisibility = result; note = MidiNote.AcousticSnare; } else if (button == ButtonName.Yellow_Tom) { this.YellowTomVisibility = result; note = MidiNote.LowTom; } else if (button == ButtonName.Blue) { this.BlueVisibility = result; note = MidiNote.RideCymbal2; } else if (button == ButtonName.Blue_Tom) { this.BlueTomVisibility = result; note = MidiNote.HighFloorTom; } else if (button == ButtonName.Green) { this.GreenVisibility = result; note = MidiNote.CrashCymbal1; } else if (button == ButtonName.Green_Tom) { this.GreenTomVisibility = result; note = MidiNote.LowFloorTom; } else if (button == ButtonName.Bass) { this.BassVisibility = result; note = MidiNote.BassDrum1; } else if (button == ButtonName.Yellow) { var hihatState = Helpers.Convert.ToHiHatState(this.HiHatPedalVelocity); switch (hihatState) { case HiHatState.Closed: this.YellowClosedVisibility = result; note = MidiNote.ClosedHiHat; break; case HiHatState.HalfClosed: this.YellowSizzleVisibility = result; note = MidiNote.RideCymbal1; break; case HiHatState.Opened: this.YellowOpenVisibility = result; note = MidiNote.OpenHiHat; break; default: throw new NotImplementedException("Not implemented HiHatState: " + hihatState); } } if (note != MidiNote.None) { MidiModel.Send(new MidiShortMessage(status, 9, (byte)note, velocity, 0)); } }