private void InitializeMidi() { _midiClock = new MidiClockGenerator(); _midiWatcher = new MidiDeviceWatcher(); _midiClock.SendMidiStartMessage = true; _midiClock.SendMidiStopMessage = true; _midiClock.Tempo = 84; _midiWatcher.IgnoreBuiltInWavetableSynth = true; _midiWatcher.EnumerateOutputPorts(); }
public MainViewModel(int rows, int cols) { _rows = rows; _cols = cols; // make sure you have the event handlers wired up before this. _watcher.EnumerateOutputPorts(); _watcher.OutputPortsEnumerated += OnMidiDevicesEnumerated; Music = new ObservableCollection <MidiMessageBlock>(); Music.Add(new MidiMessageBlock(rows, cols)); CurrentBlockIndex = 0; CurrentBlock = _music[CurrentBlockIndex]; PlayAll = true; }
public MainViewModel() { _watcher.InputPortsEnumerated += _watcher_InputPortsEnumerated; _watcher.OutputPortsEnumerated += _watcher_OutputPortsEnumerated; // these are for debugging only _watcher.OutputPortDescriptors.VectorChanged += OutputPortDescriptors_VectorChanged; _watcher.InputPortDescriptors.VectorChanged += InputPortDescriptors_VectorChanged; // the built-in synth requires an add-on package for the solution, and isn't very good anyway // this is not a required setting. However, if you don't ignore it, you need to add the DLS package // via project->add reference->universal windows->extensions _watcher.IgnoreBuiltInWavetableSynth = true; // make sure you have the event handlers wired up before this. _watcher.EnumerateInputPorts(); _watcher.EnumerateOutputPorts(); }
private void MainPage_Loaded(object sender, RoutedEventArgs e) { _watcher.IgnoreBuiltInWavetableSynth = true; _watcher.EnumerateOutputPorts(); }