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

The only ControlChange that works is SustainPedal. #3

Open
torbjorngorsetbakk opened this issue Jan 14, 2020 · 7 comments
Open

The only ControlChange that works is SustainPedal. #3

torbjorngorsetbakk opened this issue Jan 14, 2020 · 7 comments

Comments

@torbjorngorsetbakk
Copy link

I'm trying to control sliders in ableton, but the only CC that works is SustainPedal. Can anyone help me?

@jstnryan
Copy link
Owner

Which controller are you using?

@torbjorngorsetbakk
Copy link
Author

I've tried volume, and also adding my own

@jstnryan
Copy link
Owner

Is this a MIDI piano or keyboard? Often controls that you might think are CC messages actually send note messages with variable velocities. Which specific model are you using?

@torbjorngorsetbakk
Copy link
Author

I’m sorry, I should’ve been more specific. I’m trying to make an ouput device that changes knobs in my DAW

@jstnryan
Copy link
Owner

Are you certain that the DAW is mapped in a way that will respond to the specific messages you are sending? Can you show some example code of what you've tried?

@torbjorngorsetbakk
Copy link
Author

It’s just example02, but changing Sustain to Volume

@torbjorngorsetbakk
Copy link
Author

`// Copyright (c) 2009, Tom Lokovic
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

using System;
using Midi;
using System.Threading;

namespace MidiExamples
{
///


/// Demonstrates simple single-threaded output.
///

///
/// This example uses the OutputDevice.Send* methods directly to generate output. It uses
/// Thread.Sleep for timing, which isn't practical in real applications because it blocks
/// the main thread, forcing the user to sit and wait. See Example03.cs for a more realistic
/// example using Clock for scheduling.
///
class Fader : ExampleBase
{
public Fader()
: base("Fader.cs", "Simple MIDI output example.")
{ }

    void PlayChordRun(OutputDevice outputDevice, Chord chord, int millisecondsBetween)
    {
        Pitch previousNote = (Pitch)(-1);
        for (Pitch pitch = Pitch.A0; pitch < Pitch.C8; ++pitch)
        {
            if (chord.Contains(pitch))
            {
                if (previousNote != (Pitch)(-1))
                {
                    outputDevice.SendNoteOff(Channel.Channel1, previousNote, 80);
                }
                outputDevice.SendNoteOn(Channel.Channel1, pitch, 80);
                Thread.Sleep(millisecondsBetween);
                previousNote = pitch;
            }
        }
        if (previousNote != (Pitch)(-1))
        {
            outputDevice.SendNoteOff(Channel.Channel1, previousNote, 80);
        }
    }

    public override void Run()
    {
        // Prompt user to choose an output device (or if there is only one, use that one).
        Console.WriteLine("aAAAAAa");
        OutputDevice outputDevice = OutputDevice.InstalledDevices[0];
        if (outputDevice == null)
        {
            Console.WriteLine("No output devices, so can't run this example.");
            ExampleUtil.PressAnyKeyToContinue();
            return;
        }
        outputDevice.Open();

        for (int i = 0; i <= 127; i++) {
            outputDevice.SendControlChange(Channel.Channel1, Control.CustomControl, i);
            Thread.Sleep(100);
        }
       
        Console.WriteLine();
        ExampleUtil.PressAnyKeyToContinue();
        outputDevice.Close();
    }
}

}
`

CustomControl is added in the Midi.Control file. Is it possible change a float in the software and change the reverb in ableton?

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