Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface.getConnectedLaunchpads Doesn't work ! #1

Open
vukast opened this issue Feb 8, 2017 · 2 comments
Open

Interface.getConnectedLaunchpads Doesn't work ! #1

vukast opened this issue Feb 8, 2017 · 2 comments

Comments

@vukast
Copy link

vukast commented Feb 8, 2017

Here is my code (Program.cs) :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Midi;

using LaunchpadNET;

namespace LaunchPad
{
class Program
{
static void Main(string[] args)
{
Interface lint = new Interface();

        lint.connect(Interface.getConnectedLaunchpads()[0]); //Connects with your Launchpad
        lint.setLED(5, 5, 127); //Sets the LED at position X=5;Y=5 to orange.
        Console.Write("Test");
        Console.ReadKey();

    }
}

}

@Electronics
Copy link

+1

Midi.DeviceException: Error in the application.
   at Midi.InputDevice.CheckReturnCode(MMRESULT rc)
   at Midi.InputDevice.Open()
   at LaunchpadNET.Interface.connect(LaunchpadDevice device) in ...\Projects\launchpad-dot-net-master\launchpad-dot-net\Interface.cs:line 330
Exception thrown: 'Midi.DeviceException' in Midi.dll
Exception thrown: 'System.InvalidOperationException' in Midi.dll

@Electronics
Copy link

Electronics commented Dec 20, 2017

It seems to occur from the OutputDevice.Open method, bizarely the error getting thrown from within the Midi.OutputDevice.CheckReturnCode method.
image

Stacktrace:

   at Midi.OutputDevice.CheckReturnCode(MMRESULT rc)
   at Midi.OutputDevice.Open()
   at LaunchpadNET.Interface.connect(LaunchpadDevice device) in C:\Users\Laurie\documents\visual studio 2015\Projects\launchpad-dot-net-master\launchpad-dot-net\Interface.cs:line 343
   at Padsys.Padsys.findAndConnectToLaunchpad() in C:\Users\Laurie\documents\visual studio 2015\Projects\Padsys\Padsys\Padsys.cs:line 65
   at Padsys.Padsys.initLaunchpad(Action completion) in C:\Users\Laurie\documents\visual studio 2015\Projects\Padsys\Padsys\Padsys.cs:line 43
   at Padsys.Padsys..ctor() in C:\Users\Laurie\documents\visual studio 2015\Projects\Padsys\Padsys\Padsys.cs:line 37
   at Padsys.Program.Main() in C:\Users\Laurie\documents\visual studio 2015\Projects\Padsys\Padsys\Program.cs:line 16
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

EDIT: This only happens when connecting to the launchpad on start of the application, if there's some delay i.e. due to waiting for a launchpad to be connected or w/e, it's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants