/// <inheritdoc /> public void DumpVocalEffects(IPatchPart vocalFx, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.VocalEffect"); output.Send(SysExUtils.GetMessage(_vfxEffectsOffset, vocalFx.GetBytes())); } }
/// <inheritdoc /> public void SetAutoNote(bool value, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.Common.AutoNote"); output.Send(SysExUtils.GetMessage(_autoNoteOffset, new[] { ByteUtils.BooleanToByte(value) })); } }
/// <inheritdoc /> public void DumpEffect(EffectPatch patch, Effect effect, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump($"Dumping {effect}"); output.Send(SysExUtils.GetMessage(EffectOffset(effect), patch.GetBytes())); } }
/// <inheritdoc /> public void DumpCommon(IPatchPart common, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.Common"); output.Send(SysExUtils.GetMessage(_commonOffset, common.GetBytes())); } }
/// <inheritdoc /> public void DumpPartial(Partial partial, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump($"Dumping Patch.Partial[{partial.Key}]"); output.Send(SysExUtils.GetMessage(PartialAddressOffset(partial.Key), partial.GetBytes())); } }
/// <inheritdoc /> public void DumpModifiers(Modifiers modifiers, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.Modifiers"); output.Send(SysExUtils.GetMessage(ModifiersAddressOffset, modifiers.GetBytes())); } }
/// <inheritdoc /> public void Dump(IPatch analogPatch, int deviceId) { using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch"); output.Send(SysExUtils.GetMessage(_addressOffset, analogPatch.GetBytes())); } }
/// <inheritdoc /> public void Read(int inputDeviceId, int outputDeviceId) { // Reset dump count counter _dumpCount = 0; // Initialize input device _device = new InputDevice(inputDeviceId); // Setup event handler for receiving SysEx messages _device.SysExMessageReceived += OnSysExMessageReceived; // Start recording input from device _device.StartRecording(); // Start timer before running task, so we have timer on the same thread // as the callbacks for timer and input device _timer.Start(); // Request data dump from device on separate thread Task.Run(() => { // Need to make 50ms delay between requests to ensure // that device will not hung up using (var output = new OutputDevice(outputDeviceId)) { _logger.Send("Request Patch.Common"); output.Send(SysExUtils.GetRequestDumpMessage(CommonAddressOffset, _commonDumpRequest)); Thread.Sleep(50); _logger.Send("Request Patch.PartialOne"); output.Send(SysExUtils.GetRequestDumpMessage(PartialAddressOffset(DigitalPartial.First), _partialDumpRequest)); Thread.Sleep(50); _logger.Send("Request Patch.PartialTwo"); output.Send(SysExUtils.GetRequestDumpMessage(PartialAddressOffset(DigitalPartial.Second), _partialDumpRequest)); Thread.Sleep(50); _logger.Send("Request Patch.PartialThree"); output.Send(SysExUtils.GetRequestDumpMessage(PartialAddressOffset(DigitalPartial.Third), _partialDumpRequest)); Thread.Sleep(50); _logger.Send("Request Patch.Modifiers"); output.Send(SysExUtils.GetRequestDumpMessage(ModifiersAddressOffset, _modifiersDumpRequest)); Thread.Sleep(50); } }); }
/// <inheritdoc /> public void Dump(IPatch patch, int deviceId) { var vfxPatch = (CommonAndVocalEffectPatch)patch; using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.Common"); output.Send(SysExUtils.GetMessage(_commonOffset, vfxPatch.Common.GetBytes())); _logger.DataDump("Dumping Patch.VocalEffect"); output.Send(SysExUtils.GetMessage(_vfxEffectsOffset, vfxPatch.VocalEffect.GetBytes())); _logger.DataDump("Dumping Patch.Common.AutoNote"); output.Send(SysExUtils.GetMessage(_autoNoteOffset, new[] { ByteUtils.BooleanToByte(vfxPatch.Common.AutoNote) })); } }
/// <inheritdoc /> public void Dump(IPatch patch, int deviceId) { var drumPatch = (Patch)patch; using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.Common"); output.Send(SysExUtils.GetMessage(_commonAddressOffset, drumPatch.Common.GetBytes())); foreach (var partial in drumPatch.Partials) { _logger.DataDump($"Dumping Patch.Partial[{partial.Key}]"); output.Send(SysExUtils.GetMessage(PartialAddressOffset(partial.Key), partial.Value.GetBytes())); } } }
/// <inheritdoc /> public void Read(int inputDeviceId, int outputDeviceId) { // Reset dump count counter _dumpCount = 0; // Initialize input device _device = new InputDevice(inputDeviceId); // Clear previous sysex dumps _commonDump = null; _partialsDump.Clear(); // Setup event handler for receiving SysEx messages _device.SysExMessageReceived += OnSysExMessageReceived; // Start recording input from device _device.StartRecording(); // Start timer before running task, so we have timer on the same thread // as the callbacks for timer and input device _timer.Start(); // Request data dump from device on separate thread Task.Run(() => { // Need to make 50ms delay between requests to ensure // that device will not hung up using (var output = new OutputDevice(outputDeviceId)) { _logger.Send("Request Patch.Common"); output.Send(SysExUtils.GetRequestDumpMessage(_commonAddressOffset, _commonDumpRequest)); Thread.Sleep(50); foreach (var vdPair in EnumHelper.GetAllValuesAndDescriptions(typeof(DrumKey))) { var key = (DrumKey)vdPair.Value; _logger.Send($"Request Patch.Partial[{key}]"); output.Send(SysExUtils.GetRequestDumpMessage(PartialAddressOffset(key), _partialDumpRequest)); Thread.Sleep(50); } } }); }
/// <inheritdoc /> public void Read(int inputDeviceId, int outputDeviceId) { // Reset dump count counter and dumps container _dumpCount = 0; _dataDumps.Clear(); // Initialize input device _device = new InputDevice(inputDeviceId); // Setup event handler for receiving SysEx messages _device.SysExMessageReceived += OnSysExMessageReceived; // Start recording input from device _device.StartRecording(); // Start timer before running task, so we have timer on the same thread // as the callbacks for timer and input device _timer.Start(); // Request data dump from device on separate thread Task.Run(() => { // Need to make 50ms delay between requests to ensure // that device will not hung up using (var output = new OutputDevice(outputDeviceId)) { _logger.Send("Request Effect 1"); output.Send(SysExUtils.GetRequestDumpMessage(EffectOffset(Effect.Effect1), EffectDumpRequest(Effect.Effect1))); Thread.Sleep(50); _logger.Send("Request Effect 2"); output.Send(SysExUtils.GetRequestDumpMessage(EffectOffset(Effect.Effect2), EffectDumpRequest(Effect.Effect2))); Thread.Sleep(50); _logger.Send("Request Delay"); output.Send(SysExUtils.GetRequestDumpMessage(EffectOffset(Effect.Delay), EffectDumpRequest(Effect.Delay))); Thread.Sleep(50); _logger.Send("Request Reverb"); output.Send(SysExUtils.GetRequestDumpMessage(EffectOffset(Effect.Reverb), EffectDumpRequest(Effect.Reverb))); Thread.Sleep(50); } }); }
/// <inheritdoc /> public void Dump(IPatch patch, int deviceId) { var effectPatch = (Patch)patch; using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Effect 1"); output.Send(SysExUtils.GetMessage(EffectOffset(Effect.Effect1), effectPatch.Effect1.GetBytes())); _logger.DataDump("Dumping Effect 2"); output.Send(SysExUtils.GetMessage(EffectOffset(Effect.Effect2), effectPatch.Effect2.GetBytes())); _logger.DataDump("Dumping Delay"); output.Send(SysExUtils.GetMessage(EffectOffset(Effect.Delay), effectPatch.Delay.GetBytes())); _logger.DataDump("Dumping Reverb"); output.Send(SysExUtils.GetMessage(EffectOffset(Effect.Reverb), effectPatch.Reverb.GetBytes())); } }
/// <inheritdoc /> public void Dump(IPatch patch, int deviceId) { var digitalPatch = (Patch)patch; using (var output = new OutputDevice(deviceId)) { _logger.DataDump("Dumping Patch.Common"); output.Send(SysExUtils.GetMessage(CommonAddressOffset, digitalPatch.Common.GetBytes())); _logger.DataDump("Dumping Patch.PartialOne"); output.Send(SysExUtils.GetMessage(PartialAddressOffset(DigitalPartial.First), digitalPatch.PartialOne.GetBytes())); _logger.DataDump("Dumping Patch.PartialTwo"); output.Send(SysExUtils.GetMessage(PartialAddressOffset(DigitalPartial.Second), digitalPatch.PartialTwo.GetBytes())); _logger.DataDump("Dumping Patch.PartialThree"); output.Send(SysExUtils.GetMessage(PartialAddressOffset(DigitalPartial.Third), digitalPatch.PartialThree.GetBytes())); _logger.DataDump("Dumping Patch.Modifiers"); output.Send(SysExUtils.GetMessage(ModifiersAddressOffset, digitalPatch.Modifiers.GetBytes())); } }
/// <inheritdoc /> public void Read(int inputDeviceId, int outputDeviceId) { _device = new InputDevice(inputDeviceId); // Setup event handler for receiving SysEx messages _device.SysExMessageReceived += OnSysExMessageReceived; // Start recording input from device _device.StartRecording(); // Start timer before running task, so we have timer on the same thread // as the callbacks for timer and input device _timer.Start(); // Request data dump from device on separate thread Task.Run(() => { using (var output = new OutputDevice(outputDeviceId)) { _logger.Send("Request Patch"); output.Send(SysExUtils.GetRequestDumpMessage(_addressOffset, _dumpRequest)); } }); }