Changing Quick Control Display

Post topics about HALion scripting.
Post Reply
User avatar
abject39
Member
Posts: 267
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Changing Quick Control Display

Post by abject39 » Sat Oct 21, 2017 11:57 pm

I have a quick control tied to different parameters. It would probably be best if I wrote code to tie all of these things together but I'm not proficient enough with coding to do that just yet (I know how to set a parameter but not how to set curves, minimal and maximum values and such for it). Anyway, I wanted to change the way this quick control displayed itself. I want "Digital", ""Analog", and "Bionic" to replace the "0","50", and "100" position. I wrote this code below but it didn't work. Can someone help me out please.

Code: Select all

local QC3Value = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}
local QC3String = { "Digital", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "Analog", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "Bionic" }

defineParameter("QUALITY", nil, 1, QC3String, function() onQuickControl3Changed() end )

function onQuickControl3Changed()
	print(QC3String[131073].." = "..QC3Value[131073])
end
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

misohoza
Member
Posts: 821
Joined: Sun Oct 05, 2014 12:18 am
Contact:

Re: Changing Quick Control Display

Post by misohoza » Mon Oct 23, 2017 11:59 pm

Hi abject39.

I'm not sure I understand what you are trying to achieve.
Try this. It should change the quick control name depending on its value.

Code: Select all

defineParameter("QCName1",nil,50,0,100,1,function() setQCName1()end)

function setQCName1()
  if QCName1==50 then 
    this.parent:setParameter("QuickControl.Name1","Analog")
  elseif QCName1==0 then
    this.parent:setParameter("QuickControl.Name1","Digital")
  elseif QCName1==100 then
    this.parent:setParameter("QuickControl.Name1","Bionic")
  else
    this.parent:setParameter("QuickControl.Name1",tostring(QCName1))
  end
end

--delete or comment out the following once the script is run for the first time to avoid multiple qc assignments when the program is reloaded
qc1Assignments=this.parent:getNumQCAssignments(1)
this.parent:addQCAssignment(1,this,"QCName1",this)
this.parent:setQCAssignmentMode(1,qc1Assignments+1,QCAssignmentMode.absolute)
this.parent:setQCAssignmentMin(1,qc1Assignments+1,0)
this.parent:setQCAssignmentMax(1,qc1Assignments+1,100)

qc1Value=this.parent:getParameter("QuickControl.QC1")
this:setParameter("QCName1",qc1Value)
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 9, Wavelab Pro 9, Halion 6, Dorico,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

User avatar
abject39
Member
Posts: 267
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Re: Changing Quick Control Display

Post by abject39 » Tue Oct 24, 2017 5:42 am

misohoza wrote:
Mon Oct 23, 2017 11:59 pm
Hi abject39.

I'm not sure I understand what you are trying to achieve.
Try this. It should change the quick control name depending on its value.

Code: Select all

defineParameter("QCName1",nil,50,0,100,1,function() setQCName1()end)

function setQCName1()
  if QCName1==50 then 
    this.parent:setParameter("QuickControl.Name1","Analog")
  elseif QCName1==0 then
    this.parent:setParameter("QuickControl.Name1","Digital")
  elseif QCName1==100 then
    this.parent:setParameter("QuickControl.Name1","Bionic")
  else
    this.parent:setParameter("QuickControl.Name1",tostring(QCName1))
  end
end

--delete or comment out the following once the script is run for the first time to avoid multiple qc assignments when the program is reloaded
qc1Assignments=this.parent:getNumQCAssignments(1)
this.parent:addQCAssignment(1,this,"QCName1",this)
this.parent:setQCAssignmentMode(1,qc1Assignments+1,QCAssignmentMode.absolute)
this.parent:setQCAssignmentMin(1,qc1Assignments+1,0)
this.parent:setQCAssignmentMax(1,qc1Assignments+1,100)

qc1Value=this.parent:getParameter("QuickControl.QC1")
this:setParameter("QCName1",qc1Value)
Sorry for the confusion of what I was trying to do. I'm still trying to learn this code and I spend hours only to write code that just makes no sense it seems. Every time I think I have a grasp of this it becomes more and more advance. Moving along, as usual your code works. Thank you but it isn't giving the exact results I'm looking for. It makes the Quick Control work exactly as I wished but the macro knob I connected to it is still displaying "0-100" instead of "Digital-1-49-Analog-51-99-Bionic". Is it a bug?
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

User avatar
abject39
Member
Posts: 267
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Re: Changing Quick Control Display

Post by abject39 » Thu Oct 26, 2017 12:20 am

The code works for the quick control but when I assign a macro knob to the quick control it doesn't display the parameter the same way. Is this some sort of bug?
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

misohoza
Member
Posts: 821
Joined: Sun Oct 05, 2014 12:18 am
Contact:

Re: Changing Quick Control Display

Post by misohoza » Thu Oct 26, 2017 1:13 am

No, it's not a bug. I probably misunderstood what you were trying to do.

The parameter in my script wasn't really meant to be used on macro page or connected to a knob. Only thing it does is mirror the value of quick control 1 and then renames it.

If you wanted a knob on macro page with that behaviour then you could use your original script with some modification.

Code: Select all

local QC3String = { [0]="Digital", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "Analog", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "Bionic" }

defineParameter("QUALITY", nil, 50, QC3String)

Or the same thing using loop to save some typing

Code: Select all

local QC3String={}
QC3String[0]="Digital"
for i=1,100 do
  QC3String[i]=tostring(i)
end
QC3String[50]="Analog"
QC3String[100]="Bionic"

defineParameter("QUALITY",nil,50,QC3String)
This parameter doesn't do anything except for displaying the values you wanted.
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 9, Wavelab Pro 9, Halion 6, Dorico,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

User avatar
abject39
Member
Posts: 267
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Re: Changing Quick Control Display

Post by abject39 » Thu Nov 02, 2017 5:41 am

Hey, thank you! I've attached a GIF displaying what I've done with the code. I've also posted what I did to fine tune the code you gave me after a little feedback. Is there anyway to make this an actual controllable parameter instead of a display? It does what I want, but I assume it being a display is causing it to behave sluggish (you can see in the GIF as it skips values while I'm turning the knob in real time). Also being a display means that when the user manually inputs a value or clicks the center of the knob they are updating the display and not the parameter itself. Thank you again for the assistance in this.
Untitled Project.gif
(1.41 MiB) Not downloaded yet

Code: Select all

local QC3String = { [0]="DIGITAL 00", "DIGITAL 01", "DIGITAL 02", "DIGITAL 03", "DIGITAL 04", "DIGITAL 05", "DIGITAL 06", "DIGITAL 07", "DIGITAL 08", "DIGITAL 09", "DIGITAL 10", "DIGITAL 11", "DIGITAL 12", "DIGITAL 13", "DIGITAL 14", "DIGITAL 15", "DIGITAL 16", "DIGITAL 17", "DIGITAL 18", "DIGITAL 19", "DIGITAL 20", "DIGITAL 21", "DIGITAL 22", "DIGITAL 23", "DIGITAL 24", "DIGITAL 25", "DIGITAL 26", "DIGITAL 27", "DIGITAL 28", "DIGITAL 29", "DIGITAL 30", "DIGITAL 31", "DIGITAL 32", "DIGITAL 33", "ANALOG 34", "ANALOG 35", "ANALOG 36", "ANALOG 37", "ANALOG 38", "ANALOG 39", "ANALOG 40", "ANALOG 41", "ANALOG 42", "ANALOG 43", "ANALOG 44", "ANALOG 45", "ANALOG 46", "ANALOG 47", "ANALOG 48", "ANALOG 49", "ANALOG 50", "ANALOG 51", "ANALOG 52", "ANALOG 53", "ANALOG 54", "ANALOG 55", "ANALOG 56", "ANALOG 57", "ANALOG 58", "ANALOG 59", "ANALOG 60", "ANALOG 61", "ANALOG 62", "ANALOG 63", "ANALOG 64", "ANALOG 65", "ANALOG 66", "BIONIC 67", "BIONIC 68", "BIONIC 69", "BIONIC 70", "BIONIC 71", "BIONIC 72", "BIONIC 73", "BIONIC 74", "BIONIC 75", "BIONIC 76", "BIONIC 77", "BIONIC 78", "BIONIC 79", "BIONIC 80", "BIONIC 81", "BIONIC 82", "BIONIC 83", "BIONIC 84", "BIONIC 85", "BIONIC 86", "BIONIC 87", "BIONIC 88", "BIONIC 89", "BIONIC 90", "BIONIC 91", "BIONIC 92", "BIONIC 93", "BIONIC 94", "BIONIC 95", "BIONIC 96", "BIONIC 97", "BIONIC 98", "BIONIC 99", "BIONIC 100" }

defineParameter("QUALITY", nil, 50, QC3String)


function setQCName3()
  if QCName3==50 then 
    this.parent:setParameter("QuickControl.Name3","Analog")
  elseif QCName3==0 then
    this.parent:setParameter("QuickControl.Name3","Digital")
  elseif QCName3==100 then
    this.parent:setParameter("QuickControl.Name3","Bionic")
  else
    this.parent:setParameter("QuickControl.Name3",tostring(QCName3))
  end
end

--delete or comment out the following once the script is run for the first time to avoid multiple qc assignments when the program is reloaded
--qc1Assignments=this.parent:getNumQCAssignments(3)
--this.parent:addQCAssignment(3,this,"QCName3",this)
--this.parent:setQCAssignmentMode(3,qc1Assignments+1,QCAssignmentMode.absolute)
--this.parent:setQCAssignmentMin(3,qc1Assignments+1,0)
--this.parent:setQCAssignmentMax(3,qc1Assignments+1,100)

--qc1Value=this.parent:getParameter("QuickControl.QC3")
--this:setParameter("QCName3",qc1Value)
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

misohoza
Member
Posts: 821
Joined: Sun Oct 05, 2014 12:18 am
Contact:

Re: Changing Quick Control Display

Post by misohoza » Thu Nov 02, 2017 2:00 pm

Is there anyway to make this an actual controllable parameter instead of a display?
Yes, you need to write a function for it. The only part from your example that is actually being used or doing something is:

Code: Select all

local QC3String = { [0]="DIGITAL 00", "DIGITAL 01", "DIGITAL 02", "DIGITAL 03", "DIGITAL 04", "DIGITAL 05", "DIGITAL 06", "DIGITAL 07", "DIGITAL 08", "DIGITAL 09", "DIGITAL 10", "DIGITAL 11", "DIGITAL 12", "DIGITAL 13", "DIGITAL 14", "DIGITAL 15", "DIGITAL 16", "DIGITAL 17", "DIGITAL 18", "DIGITAL 19", "DIGITAL 20", "DIGITAL 21", "DIGITAL 22", "DIGITAL 23", "DIGITAL 24", "DIGITAL 25", "DIGITAL 26", "DIGITAL 27", "DIGITAL 28", "DIGITAL 29", "DIGITAL 30", "DIGITAL 31", "DIGITAL 32", "DIGITAL 33", "ANALOG 34", "ANALOG 35", "ANALOG 36", "ANALOG 37", "ANALOG 38", "ANALOG 39", "ANALOG 40", "ANALOG 41", "ANALOG 42", "ANALOG 43", "ANALOG 44", "ANALOG 45", "ANALOG 46", "ANALOG 47", "ANALOG 48", "ANALOG 49", "ANALOG 50", "ANALOG 51", "ANALOG 52", "ANALOG 53", "ANALOG 54", "ANALOG 55", "ANALOG 56", "ANALOG 57", "ANALOG 58", "ANALOG 59", "ANALOG 60", "ANALOG 61", "ANALOG 62", "ANALOG 63", "ANALOG 64", "ANALOG 65", "ANALOG 66", "BIONIC 67", "BIONIC 68", "BIONIC 69", "BIONIC 70", "BIONIC 71", "BIONIC 72", "BIONIC 73", "BIONIC 74", "BIONIC 75", "BIONIC 76", "BIONIC 77", "BIONIC 78", "BIONIC 79", "BIONIC 80", "BIONIC 81", "BIONIC 82", "BIONIC 83", "BIONIC 84", "BIONIC 85", "BIONIC 86", "BIONIC 87", "BIONIC 88", "BIONIC 89", "BIONIC 90", "BIONIC 91", "BIONIC 92", "BIONIC 93", "BIONIC 94", "BIONIC 95", "BIONIC 96", "BIONIC 97", "BIONIC 98", "BIONIC 99", "BIONIC 100" }

defineParameter("QUALITY", nil, 50, QC3String)
The rest are just comments and a function that's not being used (called) by anything.
It does what I want, but I assume it being a display is causing it to behave sluggish
Well, I see what you mean.
You could try to split the parameter into 2 to see if it helps. In that case you need to modify the knob template. Add another text element and connect it to QString parameter.
QString.png
(268.15 KiB) Not downloaded yet

Code: Select all

defineParameter("QUALITY",nil,50,0,100,1,function() qualityChange() end)
defineParameter{
    name="QString",
    strings={[0]="Digital","Analog","Bionic"},
    readOnly=true,
}


function qualityChange()
    --set the QString value
    if QUALITY>=0 and QUALITY<=33 then
        QString=0
    elseif QUALITY>=34 and QUALITY<=66 then
        QString=1
    else
        QString=2
    end
    --continue here with setParameter()
end

qualityChange()
Modify the function so that the parameter actually does something
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 9, Wavelab Pro 9, Halion 6, Dorico,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

User avatar
abject39
Member
Posts: 267
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Re: Changing Quick Control Display

Post by abject39 » Fri Nov 03, 2017 5:46 am

Thanks! The splitting idea help me come up with a decent enough work around for now. I tried setting another parameter but in the end it never gave me the result I wanted. I decided to use the original Quick control for the knob value itself and for the second line of text in the knob. I then tied the first line of text to the QUALITY Parameter. This allowed me to use less code. I removed the original functions, as they were pointless since they had no affect on the macro page itself. This allowed me to just get by with this...

Code: Select all

--Secondary SUPERTONE display for QC3
QUALITY=this.parent:getParameter("QuickControl.QC3")
defineParameter("QUALITY",nil,50,0,100,1,function() qualityChange() end)
defineParameter{
    name="QString",
    strings={[0]="DIGITAL","ANALOG","BIONIC"},
    readOnly=true,
}


function qualityChange()
    --set the QString value
    if QUALITY>=0 and QUALITY<=33 then
        QString=0
    elseif QUALITY>=34 and QUALITY<=66 then
        QString=1
    else
        QString=2
    end
    --continue here with setParameter()
end

qualityChange()
Here's a GIF displaying how it looks...
Updated Knob.gif
(1.99 MiB) Not downloaded yet
Hopefully by the time my synth is released Halion 6.1 will be out which makes sure that the display is not editable. It's still slightly sluggish (I assume this behavior is related to quick controls) but it's best work around I could make happen.
TEXT.png
(164.01 KiB) Not downloaded yet
One more thing... Even though the QUALITY parameter is set to 50 as a default value, The quick control itself default value is 50, and the Qstring says that 50 should be displayed as ANALOG, Whenever I press Ctrl and Left-Click the QAULITY parameter defaults to DIGITAL. Is this a bug?
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

misohoza
Member
Posts: 821
Joined: Sun Oct 05, 2014 12:18 am
Contact:

Re: Changing Quick Control Display

Post by misohoza » Fri Nov 03, 2017 9:27 am

One more thing... Even though the QUALITY parameter is set to 50 as a default value, The quick control itself default value is 50, and the Qstring says that 50 should be displayed as ANALOG, Whenever I press Ctrl and Left-Click the QAULITY parameter defaults to DIGITAL. Is this a bug?
Did you assign a quick control to the QUALITY knob?

If the quick control is set to relative then the actual value of QUALITY parameter might be different from what the position of the knob suggests.
Try changing the quick control assignment to absolute to see if it helps.


But in my opinion you would be better off if you used the QUALITY parameter to actually change some parameters in your program. Because at the moment it does nothing except for showing some values.

If you really want to use quick control because it's easier to set the ranges and curves I would suggest using a layer quick control for the parameters you want to control. Make the QUALITY knob change the layer quick control. After that you can still assign a program quick control to the QUALITY knob, which will in turn change the layer quick control and the parameters assigned to it This way you will have program quick controls which will be accessible to end user and a knob that's actually doing something. Even Steinberg took this approach with their Office Lamps instrument.
If you plan to lock the layer before exporting your program as HSSE layer preset then the sublayer quick controls won't be accessible even in Halion 6. But you can still use them as interface between your knob and the parameters you want to control.
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 9, Wavelab Pro 9, Halion 6, Dorico,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

User avatar
abject39
Member
Posts: 267
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Re: Changing Quick Control Display

Post by abject39 » Fri Nov 03, 2017 10:59 pm

This is actually exactly what I have set up. It's a layer within a layer that is protected. I just wanted it displayed differently to the end user. I did this in several places to create the synth. There are places where code probably would've been more efficient but I either didn't have the skill to code it or coded parameters not being able to be mod matrix destinations/sources made quick controls a better option.
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest