LFO to CC whit Lua

Home Forums General Programming LFO to CC whit Lua

Tagged: , , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #71629
    seq303seq303
    Participant
    • Topics: 8
    • Replies: 13
    • Total: 21

    Hi,
    how can I use Lua to program an LFO? I want to adjust the time with the Modulator. A second modulator should then send CC via Midi! Is there a delay function in Lua?

    Thanks for your help!

    Greatings Michael

    #71655
    PuppeteerPuppeteer
    Participant
    • Topics: 15
    • Replies: 181
    • Total: 196
    • ★★

    There are timers available in LUA. Do a search for callback functions as a lot of them use timers.

    The Puppeteer
    http://godlike.com.au

    #71663
    seq303seq303
    Participant
    • Topics: 8
    • Replies: 13
    • Total: 21

    Hi,
    I once made an example for the Arduino. It works fine with the Arduino Nano
    How do I do this in Lua? Greetings Michael

    Code ——————————————————————-

    // Arduino Example LFO CC MIDI OUT

    // LFO
    String Modulator_BUTTON_Name = “LFO_BUTTON”;
    boolean Modulator_BUTTON_Value = true; // 0-1 on/Off
    String Modulator_LFO_SPEED_Name = “LFO_SPEED”;
    int Modulator_LFO_SPEED_Value = 400; // 0-127 0ms – 800ms
    // Taget
    String Modulator_CUTTOFF_Name = “FADER_CUTTOFF”;
    int Modulator_CUTTOFF_Value = 0; // 0-127 0ms – 800ms

    const int MIDI_OUT_LED_PIN = 13;
    const int CC = 0xB1;
    const int CC_Nummer = 0x4a;
    int CC_Wert = 0; // 0-127
    int LFO_Speed = 150; // 0 ms – 800 ms

    void setup()
    {
    pinMode(MIDI_OUT_LED_PIN, OUTPUT);
    Serial.begin(31250);
    }

    void loop()
    {
    if (Modulator_BUTTON_Value == true)
    {
    for (int CC_Wert = 0x00; CC_Wert < 0x7f; CC_Wert ++) { CC_WRITE(CC,CC_Nummer,CC_Wert); delay(LFO_Speed); } for (int CC_Wert = 0x7f; CC_Wert > 0x00; CC_Wert –)
    {
    CC_WRITE(CC,CC_Nummer,CC_Wert);
    delay(LFO_Speed);
    }
    }

    }

    // Funktion
    void CC_WRITE(int CC, int CC_Nummer, int CC_Wert)
    {
    digitalWrite(MIDI_OUT_LED_PIN, HIGH);
    delay(2);
    digitalWrite(MIDI_OUT_LED_PIN, LOW);
    Serial.write(CC);
    Serial.write(CC_Nummer);
    Serial.write(CC_Wert);
    }

    #71666
    seq303seq303
    Participant
    • Topics: 8
    • Replies: 13
    • Total: 21

    Hi,

    How can I use socket.sleep() in clrtr?

    I need a delay() in ms. 0ms – 800ms

    Can someone please help me?

    I need an example in clrtr Lua!

    Greeting Michael

    #71689
    seq303seq303
    Participant
    • Topics: 8
    • Replies: 13
    • Total: 21

    Hi what do I have to change so the code also runs in ctrlr? The code is only available in Zerobrainstudio!

    http://ctrlr.org/wp-content/uploads/2017/03/LFOtoCC.lua

    • This reply was modified 3 years, 4 months ago by seq303seq303.
    • This reply was modified 3 years, 4 months ago by seq303seq303.
    #71690
    seq303seq303
    Participant
    • Topics: 8
    • Replies: 13
    • Total: 21

    The Test Panel

    http://ctrlr.org/wp-content/uploads/2017/03/LFO_TEST.panel

    • This reply was modified 3 years, 4 months ago by seq303seq303.
    • This reply was modified 3 years, 4 months ago by seq303seq303.
    • This reply was modified 3 years, 4 months ago by seq303seq303.
    #116420
    F0h
    Participant
    • Topics: 2
    • Replies: 5
    • Total: 7

    Hello seq303,
    Have you find a solution to your LFO with CTRLR?
    Cheers

    F0h

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
There is currently 0 users and 25 guests online
No users are currently active
Forum Statistics
Threads: 2,398, Posts: 16,810, Members: 59,777
Most users ever online was 12 on January 22, 2019 3:47 pm
Do NOT follow this link or you will be banned from the site!