Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC | TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);

            //Guid manufacturer = new Guid("aa4e075f-3504-4aab-9b06-9a4104a91cf0");
            //Guid product = new Guid("bb4e075f-3504-4aab-9b06-9a4104a91cf0");

            //CommandReader.Initialize(new TeVirtualMIDI("C# loopback", 65535, TeVirtualMIDI.TE_VM_FLAGS_PARSE_RX, ref manufacturer, ref product));

            //alernatively: simple instantiation without any "special" stuff:
            var port = new TeVirtualMIDI("eeee el pueeeerto");

            CommandReader.Initialize(port);

            Thread thread = new Thread(new ThreadStart(CommandReader.WorkThreadFunction));

            CommandReader.MessageReceived += CommandReader_MessageReceived;
            thread.Start();
            Console.WriteLine("Virtual port created - press enter to close port again");
            Console.ReadKey();
            //CommandReader.port.shutdown();
            CommandReader.ShutDown();
            Console.WriteLine("Virtual port closed - press enter to terminate application");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
    public static void Main()
    {
        // Instantiate the port
        Console.WriteLine("Initializing MIDI port...");
        TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC | TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);
        var drawLink = new TeVirtualMIDI("C# loopback", 65535, TeVirtualMIDI.TE_VM_FLAGS_PARSE_RX, ref manufacturer, ref product);

        Console.WriteLine("Done!");

        // Connect to Leap controller
        Console.WriteLine("Initializing Leap...");
        Controller leapMotion = new Controller();

        do
        {
            System.Threading.Thread.Sleep(1000);
            Console.WriteLine(".");
        } while (!leapMotion.IsConnected);

        // Allows controller to analyze frames as a background applciation
        leapMotion.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);

        bool isDrawing  = true;
        bool wasDrawing = true;

        byte[] c_midC_on  = { 0b10011010, 0b00111100, 0b01111111 };
        static void Main(string[] args)
        {
            Console.WriteLine("teVirtualMIDI C# loopback sample");
            Console.WriteLine("using dll-version:    " + TeVirtualMIDI.versionString);
            Console.WriteLine("using driver-version: " + TeVirtualMIDI.driverVersionString);

            TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC | TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);

            Guid manufacturer = new Guid("aa4e075f-3504-4aab-9b06-9a4104a91cf0");
            Guid product      = new Guid("bb4e075f-3504-4aab-9b06-9a4104a91cf0");

            port = new TeVirtualMIDI("C# loopback", 65535, TeVirtualMIDI.TE_VM_FLAGS_PARSE_RX, ref manufacturer, ref product);

//			alernatively: simple instantiation without any "special" stuff:
//			port = new TeVirtualMIDI( "C# loopback" );

            Thread thread = new Thread(new ThreadStart(WorkThreadFunction));

            thread.Start();

            Console.WriteLine("Virtual port created - press enter to close port again");
            Console.ReadKey();
            port.shutdown();
            Console.WriteLine("Virtual port closed - press enter to terminate application");
            Console.ReadKey();
        }
        public ReCommand8Midi()
        {
            TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC | TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);
            Guid manufacturer = new Guid("aa4e075f-3504-4aab-9b06-9a4104a91cf0");
            Guid product      = new Guid("bb4e075f-3504-4aab-9b06-9a4104a91cf0");

            port = new TeVirtualMIDI("ReCommand8", 65535, TeVirtualMIDI.TE_VM_FLAGS_PARSE_RX, ref manufacturer, ref product);
            Thread thread = new Thread(new ThreadStart(WorkThreadFunction));

            thread.Start();
        }
Ejemplo n.º 5
0
    private TeVirtualMIDI startMidiPort()
    {
        Debug.Log("Up and running");
        //LaunchMidi();
        Console.WriteLine("teVirtualMIDI C# loopback sample");
        Console.WriteLine("using dll-version:    " + TeVirtualMIDI.versionString);
        Console.WriteLine("using driver-version: " + TeVirtualMIDI.driverVersionString);

        TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC | TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);

        Guid manufacturer = new Guid("aa4e075f-3504-4aab-9b06-9a4104a91cf0");
        Guid product      = new Guid("bb4e075f-3504-4aab-9b06-9a4104a91cf0");

        TeVirtualMIDI port = new TeVirtualMIDI(portName, 65535, TeVirtualMIDI.TE_VM_FLAGS_PARSE_RX, ref manufacturer, ref product);

        Debug.Log("Midi Port started !");
        return(port);
    }
Ejemplo n.º 6
0
        public static void CreateMidiPort()
        {
            //Writing to Log File
            TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC |
                                  TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);

            Guid manufacturer = new Guid("aa4e075f-3504-4aab-9b06-9a4104a91cf0");
            Guid product      = new Guid("bb4e075f-3504-4aab-9b06-9a4104a91cf0");

            //Create MIDI Port
            string portName = "BDB_MIDI";

            port = new TeVirtualMIDI(portName);

            //Create Thread for MIDI Events
            Thread thread = new Thread(new ThreadStart(SendNextMidiOutMessage));

            thread.Start();
        }