Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Trogs Knob (Bitmap)

Post any examples or modules that you want to share here

Trogs Knob (Bitmap)

Postby trogluddite » Fri Sep 20, 2013 12:26 am

Following on from this thread, where we noticed that the new FS animated knob works rather differently than the old SM one...

Here's a new one that I've just built that uses the same method of reading the bitmap as the old SM one - so should be compatible with all those Knobman stiprs that we've collected over the years.
It also sees the return of some old SM features that have gone missing from the FS stock knob, and a couple of new ones as well.
Better Knobs 005A Edit Box BugFix.fsm
(116.84 KiB) Downloaded 1576 times

(NB - Requires at least FS version 3.0.3 Raindrop)

Animation cells work like they used to - every frame gets used as the knob moves from min to max.
Here's a quick run-down of the features/properties...

Load bitmap - erm, loads a bitmap.
Cells - the number of cells - it works out from the bitmap dimensions whether they are arranged horizontally or vertically. To make it even easier to switch between strips, include the cell count in between square brackets in the filename, (e.g. [64]) - the number will then be automatically set.
Frames per sec - there's a redraw speed limiter in there to help keep the GDI CPU load down. This sets the maximum speed that the GUI will get updated.
Mouse sense - how fast the knob moves when you move the mouse. Hold SHIFT while dragging for extra fine control.

Default - the default value; CTRL-click the knob to quickly set the default.
Min, max - the range of the output value (NB - VST automation uses the correct 0..1 range)
Steps, No. Steps - give the knob 'click stops' at regularly spaced values.

Midi - turns Midi Control on. It will respond to whichever controller is set in the CC Number box, on any MIDI channel.
Catchup - enables 'Midi catchup' where you have to move your controller past the current value if iyour hardware starts out pointing in the wrong direction.

Preset name
- must be unique!! Also has a wireless String input called 'Preset', so that you can easily prefix the name of a parent module.
Preset, Automate - turn on VST preset memory and/or automation.

Label - a GUI name for the knob. Double click the label to set a new knob value by typing it in. If you leave the label property blank, all the the label related features get disabled to save CPU.
Font & colour for the label.
Position - where the label appears relative to the knob.

Units, Places - if you have set a label, moving the knob or sending Midi will show the current value for a moment in the label area. These properties set the number of decimal places to show and units to follow the number These settings are also sent to the VST 'display' input, so your host can show meaningful values.

Although the Ruby code looks quite long, it's designed so that as little as possible is processed when the value changes - so there should only be the redraws and output triggers that are absolutely necessary. Most of the code is just memorising a load of calculations that happen when the properties or bitmap are changed.
The little 'REFRESH BITMAPS' module will connect wirelessly to as many knobs as you like - a quick way to refresh the graphics if you've edited the image files (so long as you keep the same filenames!).

NB) Something not mentioned in the manual that was catching me out...

In the Ruby section about 'Mouse capture and dragging', there's an example to show how you use the 'mouseCapture' and 'releaseMouse' commands - and it isn't quite right.
It shows 'releaseMouse' used inside the 'MouseLUp' method - but this doesn't work properly, because mouseLUp only gets called if the mouse is actually over the current mouse area. If you drag outside that area and then release the mouse, 'mouseLUp' doesn't happen
The correct method to use is 'mouseLUpCaptured(x,y)' - that one WILL get called no matter where you are on screen when the drag ends!
Last edited by trogluddite on Wed Oct 02, 2013 7:42 pm, edited 4 times in total.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Trogs Knob (Bitmap)

Postby RJHollins » Fri Sep 20, 2013 1:30 am

OK ... checking out 'Trogs Knob' ... man, that just does NOT sound right :shock: :roll:
:lol:

Running into a couple issue ... the main one. I've imported my own bitmap as a test. Was able to edit
the properties. However, afterward, a 2nd attempt at editing would not allow data entry. I had to click the
'Refresh Bitmap' button ... then I could edit.

Another point ... I thought that [CNTRL-Click]as the default action to reset the knob to 'Default' position. I've gotten kinda use to doing it that way. The [SHIFT] was for fine-tuning. Anyway, I need to look at RUBY to see if I have the skill to make this type of change.

Last 'question' [cause I need to look closer], are the 'Sweep Angle' like the old SM version ? I did get the FS version to finally react properly [a bit of a guessing match, but it worked] ... just wondering.

As always ... TROG to the rescue with critical components !!!

Big THANKS!
:D
RJHollins
 
Posts: 1568
Joined: Thu Mar 08, 2012 7:58 pm

Re: Trogs Knob (Bitmap)

Postby billv » Fri Sep 20, 2013 2:06 am

Wicked...look forward to getting home for a look..
Was struggling last night to change draw to
v.width, v.height.......fine tuning is needed here...cant get
graphic to line up correctly in fsm.
Hopefully trog you have sneaked that fix in...
tricky the way its drawing to grid....beyond my understanding. .. :?
billv
 
Posts: 1145
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Trogs Knob (Bitmap)

Postby billv » Fri Sep 20, 2013 7:59 am

Got it now Trog......looks awesome..
will open doors for lots of people... ;)
Will have a great weekend exploring this... :D
thanks again mate.....
billv
 
Posts: 1145
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Trogs Knob (Bitmap)

Postby trogluddite » Fri Sep 20, 2013 9:17 am

Cheers guys :D

RJHollins wrote:OK ... checking out 'Trogs Knob' ... man, that just does NOT sound right :shock: :roll:

Hee hee :lol:
Reminds me of a funny thing that happened at work.. I do a lot of component sourcing for electronic gadgets, so there are quite often times that I have to search for knobs. Naturally, I go through the suppliers' own search engine to avoid the obvious 'NSW' problem if I used Google etc.
But imagine my surprise when I typed 'knob' into one of our supplier's search box, to find that the first item found was, erm,... ...a big cock! It's a dildo and condom kit that they sell for sex education classes - how to put a condom on lessons. Obviously, the word 'knob' doesn't appear anywhere in the official product description on a 'serious' site like that, so whoever configured the search engine must enjoy a little bit of trollling!

RJHollins wrote:Running into a couple issue ... the main one. I've imported my own bitmap as a test. Was able to edit
the properties. However, afterward, a 2nd attempt at editing would not allow data entry. I had to click the
'Refresh Bitmap' button ... then I could edit.

Aaah - this sounds like it might be a little bug that I reported to Malc a while back - but he couldn't reproduce it. I sometimes get a problem where, after a bit of editing in FS, suddenly I can't enter data into text boxes. It's a real pain because it even locks out float and integer primitives - and it seems that forcing a redraw of certain things (e.g. a code box) sorts out the problem (for a while!).
If you have the problem again, let me know if it also locks out data entry on any other components, that will be a good clue that it is a FS problem. Another symptom is that trying to edit a component/connector label makes the edit box appear in the wrong place (usually top left of the workspace).
I'll check my code as well, because there is an edit box inside the label that might be the cause if I'm not shutting it down properly - but it's the first time I've seen anyone else report the anything similar to the 'data entry' bug that I've been having. If this schematic is provoking the problem, then at least I have something I can e-mail to Malc to have a look at.

Re CTRL - SHIFT
Guess you can tell I hardly ever use those functions! That will be easy to fix - I'll post up an update in a little while after I've had some time to look into that 'frozen' properties bug.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Trogs Knob (Bitmap)

Postby billv » Fri Sep 20, 2013 11:52 am

RJHollins wrote:would not allow data entry

I got this as well Trog.
First in properties panel, tried to change the minimum to ' 0 '...locked up...
Go into module...int's are locked up as well...going back to prop panel...ok again....
trogluddite wrote: I sometimes get a problem where, after a bit of editing in FS,
suddenly I can't enter data into text boxes

I had same problem a few weeks back....real bad...when building ruby selector....
....strings I could enter in...but not int's, floats..
i think that bug might have been the 'redraw' in the 'draw v' section bug that nubeat7
solved for me.....not sure....
So yeah..first thing i did was to check your code for any redrawing in the 'draw v'...
but don't understand your code fully as yet....
trogluddite wrote:reported to Malc a while back - but he couldn't reproduce it

I may have kept an fsm...will take a look....
If its important, i can have a go at reproducing it..I remember the circumstances,
just need to find the right "dodgy" selector....
billv
 
Posts: 1145
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Trogs Knob (Bitmap)

Postby trogluddite » Fri Sep 20, 2013 12:30 pm

Cheers, billy - it's good to know that it's not just me seeing this.

It does seem related to the Ruby redraws somehow - as if it won't open a new edit box because an older one hasn't been shut down properly. I seem to get it a lot if I've been editing long Ruby code boxes.
I haven't noticed it in VST or .exe exports, either - so it seems like it's the redraws of the FS workspace that are somehow interfering with our own redraw commands.
I'll try trimming back my code to see if I can isolate it in something more simple, and get a report off to Malc.

EDIT) Something else weird - even when the int/float box editing becomes locked out, the coded edit box under the knob label always works just fine. So it seems that only "FS workspace" edit boxes are affected. That's probably why exports don't seem to have a problem.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Trogs Knob (Bitmap)

Postby trogluddite » Fri Sep 20, 2013 8:12 pm

Quick update.
Malc has just got back to me to say that he can reproduce the "edit lock up" on his machine using my schematic - I'll keep you posted if there's any more news.

@billy - if you can find that schematic of yours that had the problem, can you send it to DSPr - having another one that does the same thing might help him to find the problem a bit more easily.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Trogs Knob (Bitmap)

Postby RJHollins » Fri Sep 20, 2013 8:36 pm

Thanks for following up on this, TROG ! 8-)

So that I'm clear ... Is this problem only within FS ? The exported .EXE and .VST work ?

This has not really been an issue for any project I've got going. In fact, I think I ported my SM knob into FS at the early stage of migration.

NuBeat had done considerable work on a Knob and 'Guage' display. So I use a type of hybrid design.

In the long run, this being such a fundamental component, a clean, flexible, knob design is most desired. :)

Thanks again TROG !!
RJHollins
 
Posts: 1568
Joined: Thu Mar 08, 2012 7:58 pm

Re: Trogs Knob (Bitmap)

Postby billv » Sat Sep 21, 2013 12:28 am

trogluddite wrote:Malc has just got back to me to say that he can reproduce the "edit lock up" on his machine using my schematic

It's good example for malc... knob gets the "edit lock up" happening on any schematic here...
billv
 
Posts: 1145
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Next

Return to User Examples

Who is online

Users browsing this forum: No registered users and 27 guests