Need help to create a simple knob for CC11 (expression)

Options
Ray123
Ray123 Member Posts: 6 Member
edited November 2023 in Scripting Workshop

Hi everyone,

I want to add a simple knob for CC11 (controlling volume) to one of my custom Kontakt Instruments.

So far I added an modulator (amplifier => external sources => midi CC) to tweak the volume.

This is my script so far:

on init
   make_perfview
   set_ui_height_px(120)

   declare ui_knob $Expression (0,127,1)
   move_control ($Expression,1,2)
   make_persistent($Expression)
   read_persistent_var($Expression)

end on

The I assigned midi CC to via midi learn to the knob.

This works when I adjust CC11 only with an external controller.

However, if I move the knob on the GUI with my mouse it won't have an effect on the engine (only the values on the GUI will change).


I figured that I would ne somethin involving

  • "on ui_control"
  • " set_engine_par",
  • "$ENGINE_PAR_VOLUME",
  • (maybe "set_knob_label" as well?)

but I'm not sure how to write the exact code.

I appreciate any help. Many thanks in advance.

Best,

Ray

Comments

  • Ray123
    Ray123 Member Posts: 6 Member
    Options

    Unfortunately, ChatGPT's suggestions were not helpful 🤪

    ...in case someone can help me to fix this, I'd be very glad.


    Best,

    Ray

  • Ray123
    Ray123 Member Posts: 6 Member
    Options

    ...still looking for a solution and thankful for any suggestions.

    Ray

  • Milos
    Milos Member Posts: 1,930 Guru
    Options

    Which DAW do you use?

    I might help you if you tell me.

  • Ray123
    Ray123 Member Posts: 6 Member
    Options

    Hi Milos,


    thanks for the reply!

    I'm using Logic X.

    But shouldn't this be independent from the DAW?

  • Milos
    Milos Member Posts: 1,930 Guru
    Options

    Well, not really.

    You need the automation and expression midi learn from the DAW to perform it.

    You can probably create it without the DAW, but to perform it without the DAW, yeah, impossible.

    Speaking from multiple experiences.

  • Ray123
    Ray123 Member Posts: 6 Member
    edited November 2023
    Options

    Hi Milos,

    I'm not sure if I get it.

    Let me explain my problem more detailed.

    The current state is:

    • If I move the fader for CC11 on my hardwarcontroller: I can see the knob that I created for CC11 on the GUI turning, and the sound is changing the volume (as expected)...the knob is already assigned via midi-learn
    • If I play a midi region in Logic that has CC11 embeded: I can see the knob that I created for CC11 on the GUI turning, and the sound is changing the volume (as expected)

    HOWEVER:

    If I tur the knob on the GUI for CC11 via my regular mouse ("on ui_control"?): I can se the knob moving when I move with the mouse pointer, but the volume of the sound does NOT change. How can I fix this?

Back To Top