Forum Replies Created
-
AuthorPosts
-
August 9, 2011 at 1:43 pm in reply to: Logic for infobox to change data/state based on modulator #3050
I’ve created a method on the LFO Speed knob to paint the text in the LFO Bar based on it’s value. I think this is how to have the box update realtime as the LFO knob is turned, but I’m getting an error at the graphics:drawText. I know how to tell a modulator to be set to a value, but since this is a Custom Component and graphics is involved, I’m not exactly sure how to do this properly.
[code:16wsqpcz]
paintLFO = function(component,graphics)–making array begin at 0 instead of 1
a = {[0] = "1280 Bars", "1152 Bars", "1024 Bars", "896 Bars", "768 Bars", "640 Bars", "576 Bars", "512 Bars", "448 Bars",
"384 Bars", "320 Bars", "288 Bars", "256 Bars", "224 Bars", "192 Bars", "160 Bars", "144 Bars", "128 Bars",
"112 Bars", "96 Bars", "80 Bars", "72 Bars", "64 Bars", "56 Bars", "48 Bars", "40 Bars", "36 Bars", "32 Bars",
"28 Bars", "24 Bars", "20 Bars", "18 Bars", "16 Bars", "14 Bars", "12 Bars", "10 Bars", "9 Bars", "8 Bars", "7 Bars",
"6 Bars", "5 Bars", "4 Bars", "3.5 Bars", "3 Bars", "2.5 Bars", "2 Bars", "1.5 Bars", "1 Bar", "1/2.", "1/1T", "1/2",
"1/4.", "1/2T", "1/4", "1/8.", "1/4T", "1/8", "1/16.", "1/8T", "1/16", "1/32.", "1/16T", "1/32", "1/48"}l = panel:getModulatorByName("LFO 1 Speed")
b = panel:getModulatorByName("LFO 1 Box")if l ~= nil and b ~= nil then
lVal = l:getModulatorValue()
graphics:setColour (Colour(0xff950000))if lVal <= 1 then
text = a[0]
else
text = a[math.floor(lVal/2)]b:graphics:drawText (text, 0, 0, component:getWidth(), component:getHeight(), Justification (Justification.centred), true)
endend
end
[/code:16wsqpcz]I was searching in the JUCE forums for this component hoping that someone had already created on in Juce. Unfortunately I wasn’t able to find any. One user had started but didn’t seem to get very far.
I poured over the graphics class and some examples and realized this would be very difficult for me cobble together myself, with a LOT of experimentation to figure it out. I would love to have this avail as well as it would save me a lot of time. But on the other hand, I think a deviceDB would be more useful over all as a whole for all panels and that the Envelope more of a luxury at this point. Either way, either one will be cool to have ” title=”Smile” />
August 9, 2011 at 2:32 am in reply to: Logic for infobox to change data/state based on modulator #3049Okay, I’ve taken a stab at this. Right now I’m just trying to get the text field I’ve created with uiCustomComponent to show the proper bars/beats based on the value of the LFO knob. It grabs the initial value and writes the text, but it’s not changing when I change the LFO value. How do I do that? Here’s the code for the CustomComponent :
[code:261j67q4]
—
— Called when a component needs repainting
—paintBox = function(component,graphics)
graphics:fillAll (Colour(0xfff0f0f0))
graphics:setColour (Colour(0xff000000))
graphics:drawRect (0, 0, component:getWidth(), component:getHeight(), 1)a = {[0] = "1280 Bars", "1152 Bars", "1024 Bars", "896 Bars", "768 Bars", "640 Bars", "576 Bars", "512 Bars", "448 Bars",
"384 Bars", "320 Bars", "288 Bars", "256 Bars", "224 Bars", "192 Bars", "160 Bars", "144 Bars", "128 Bars",
"112 Bars", "96 Bars", "80 Bars", "72 Bars", "64 Bars", "56 Bars", "48 Bars", "40 Bars", "36 Bars", "32 Bars",
"28 Bars", "24 Bars", "20 Bars", "18 Bars", "16 Bars", "14 Bars", "12 Bars", "10 Bars", "9 Bars", "8 Bars", "7 Bars",
"6 Bars", "5 Bars", "4 Bars", "3.5 Bars", "3 Bars", "2.5 Bars", "2 Bars", "1.5 Bars", "1 Bar", "1/2.", "1/1T", "1/2",
"1/4.", "1/2T", "1/4", "1/8.", "1/4T", "1/8", "1/16.", "1/8T", "1/16", "1/32.", "1/16T", "1/32", "1/48"}l = panel:getModulatorByName("LFO 1 Speed")
if l ~= nil then
lVal = l:getModulatorValue()
graphics:setColour (Colour(0xff950000))if lVal <= 1 then
text = a[0]
else
text = a[math.floor(lVal/2)]
endgraphics:drawText (text, 0, 0, component:getWidth(), component:getHeight(), Justification (Justification.centred), true)
endend
[/code:261j67q4]I sent him another email last week, this time he chose not to respond at all. I’m starting to think that it’d actually be faster to build one from scratch than wait for him to share the panel.
Yes, that’s it. So obvious now. Plus I found it in the LUA Programming book after reading the chapter on tables :-p
Thanks ” title=”Smile” />
Totally.
If you can get at least a good outline going, chapters etc, style of writing, we could fill in some gaps here and there.
"2mm":nh1xdeju wrote:1. Absolutely. Click on your uiSlider. In the "Component" settings, look for "Minimum value" and "Maximum value". Change those to -64 and 64. Depending on the values that your synth is listening for, you might have to change the "Expression to evaluate when calculating the midi message value…" also. Normally it’s "modulatorValue", but if your synth expects values in a range of 0..127, change this to "modulatorValue+64". Then the next parameter — midi messages back to Ctrlr values — should be changed to "midiValue-64".[/quote:nh1xdeju]You won’t get the slider graphics to look bipolar, but the values it sends will be like you described. If you want your slider graphics to look bipolar as well, you’ll need to make a custom uiImageSlider.
doh, atom beat me to it. That’s what I get for leaving this window open for so long and not looking for recent updates
"Mr Arkadin":1k4p724q wrote:2. I am trying to use the uiCombo up/down button. I can’t see anywhere to define how many steps this has (I need four) and how to name each step (they will be waveform names).[/quote:1k4p724q]The combo is a dropdown box, not really an up/down button. Click the Box or button, the choices drop down, select the one you want. To set how many are there, go to the Combo Contents box on the modulator properties panel. Fill in the box with the choices you want.
Square
Sine
Saw
Randomthe first entry is value 0, the second is 1, etc. If you need the selection to be a specific value , you just set it " = " to.
Square=65
Sine=66
Saw=67etc
Try sending a PM to Layerz2 to see if he’ll post it or send to you.
As I do with your panels… The idea to change the group size to 0,0 instead of using tabs is quite genius really.
v1.94
— FX tab now goes to currently enabled FX after program dump
— Removed Bypass/Enable buttons from FX panels. Selecting the FX in the tab enables the effect, and selecting Bypass tab bypasses that fx unit.
— Respaced FX paramters after removing the buttons
— Changed polarity buttons in fx tabs and respaced
— Fixed scripts for Envelope Modes and Types to update the panel properly when getting program dump from Blofeld hardware
— Changed Envelope Mode and Filter Routing buttons from individual buttons for each mode into single toggle buttons to allow easier scripting
— Added scripts that will now update the Blofeld hardware when selecting :
+ Unison Voices and Mono/Poly
+ Envelope Mode and Typerev 648
SAVE is not working at all. It says "saved" , but it does not get saved to file. Only way to properly save is Save As another name.
Also, newly created methods in rev 648 are coming back as "nil" when loading the panel. They worked when I created them, but after Save As and loadthe panel, those functions are now "nil".
Even if I delete them , "Save As" the panel, load the panel, create the script again with the same name, It opens up in the editor as "Nil". In fact, any new method I create opens as "Nil". I’m getting all sorts of weirdness here.
**EDIT**
[b:3tksbtch]After you’ve created a method, don’t edit the script and change the name of the function.[/b:3tksbtch]
New updates to the panel :
v1.90
– Added Bank and Program Change selection
– Added Program Dump Request Button
– Added LUA scripts to update panel after Program Dump requestHere’s an active forum with actual Programmers from DSI :
I’m looking around here for more answers :Here’s what happens when I use the soundtower editor. Let me know if there’s a different step I should take or show some different output.
My Poly Rack OS versions are :Main : 2.1 , Voice : 2.2, DSP : 3.5
Select Combo :
[code:3pbxqlog] TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
000B5406 13 — F0 Buffer: 6 Bytes System Exclusive
SYSX: F0 7E 7F 06 01 F7
000B5481 13 — F0 Buffer: 6 Bytes System Exclusive
SYSX: F0 01 20 01 31 F7[/code:3pbxqlog]Select A001 combo :
[code:3pbxqlog]
TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
000C0296 13 — F0 Buffer: 6 Bytes System Exclusive
SYSX: F0 7E 7F 06 01 F7
000C0298 13 — F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 01 20 01 09 11 00 00 F7
000C0299 13 — F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 01 20 01 09 10 00 00 F7
000C02FD 13 — F0 Buffer: 8 Bytes System Exclusive
SYSX: F0 01 20 01 21 00 00 F7[/code:3pbxqlog]Edit Button :
[code:3pbxqlog] TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
000C740D 13 — F0 Buffer: 6 Bytes System Exclusive
SYSX: F0 7E 7F 06 01 F7[/code:3pbxqlog]Select Voice 2 :
[code:3pbxqlog] TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
000E179C 13 — F0 Buffer: 6 Bytes System Exclusive
SYSX: F0 7E 7F 06 01 F7[/code:3pbxqlog]Select Program Bank A001
[code:3pbxqlog] TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
001240DD 13 — F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 01 20 01 2A 12 00 00 F7
001240DE 13 — F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 01 20 01 2A 11 00 00 F7
00124142 13 — F0 Buffer: 8 Bytes System Exclusive
SYSX: F0 01 20 01 05 00 00 F7
001241A9 13 — F0 Buffer: 8 Bytes System Exclusive
SYSX: F0 01 20 01 10 00 00 F7[/code:3pbxqlog]Damnit!!! I’m just about to wrap final version of the blofeld panel and I thought I’d get a break for a while. Now here’s more cool shit I’m going to have to do :-p
Nice! Does this mean we can do graphic envelopes with click and drag break points?
Changes in rev 640? ” title=”Smile” />
I’ll get on that today and check it out.
-
AuthorPosts