How to use Switches to change the bitmap of a CustomButton

Discuss problems and solutions.
Post Reply
Jeshua
Newbie
Posts: 15
Joined: 13 Jan 2012 06:38

How to use Switches to change the bitmap of a CustomButton

Post by Jeshua »

I have 4x2 switch object that I want to use to change a CustomButton's bitmap offstate to four different symbols according to which switch is on.

How would I make this script?

Thank you :)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: How to use Switches to change the bitmap of a CustomButt

Post by Softcore »

And what do you want to happen when no switch is on (out of the 4x2 ones) OR when more than two buttons are on?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: How to use Switches to change the bitmap of a CustomButt

Post by Softcore »

here's an example with the modifier switches set to radio.....The first one "resets" the custom button to display text, the rest set to a few example bitmaps (out of the 14 range)....
changingbitmaps.jzml
(2.78 KiB) Downloaded 112 times
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: How to use Switches to change the bitmap of a CustomButt

Post by Phil999 »

you call up the 'bitmap' attribute of the CustomButton. Something like this:

Code: Select all

decl i=firstof(Switches.x);

setattribute(CustomButton, 'bitmap', i);
Thanks for the idea, I wasn't aware of this bitmap attribute.

Ups, Softcore was faster. :D
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: How to use Switches to change the bitmap of a CustomButt

Post by Softcore »

Answering posts like this = the best exercise for learning Lemur! ;)

...or should I say:

On expression forum question, any

Code: Select all

decl learn, try;
try = make a sample project;

if (try==1) learn=1;
else learn=0;
lol lol lol lol lol lol
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: How to use Switches to change the bitmap of a CustomButt

Post by Macciza »

Hi
getattributelist(object) is a handy one to just chuck in a monitor to check whats possible whilst coding . .
Or print out the appendix bits from the guide as well . . .
I keep meaning to post my attribute lister thing . . .
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: How to use Switches to change the bitmap of a CustomButt

Post by Softcore »

I keep going back to the manual for the attributes - just followed your advice and made a Monitor module with the getattribute script to have ready to drop in future designs and get the attributes of an object fast!

Nice one!
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: How to use Switches to change the bitmap of a CustomButt

Post by Phil999 »

Macciza wrote:Hi
getattributelist(object) is a handy one to just chuck in a monitor to check whats possible whilst coding . .
I wasn't aware of that one either.

Cool stuff, thanks!
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Jeshua
Newbie
Posts: 15
Joined: 13 Jan 2012 06:38

Re: How to use Switches to change the bitmap of a CustomButt

Post by Jeshua »

Worked like a charm folks. I'll bring the questions if you guys supply such great answers ;) .
Post Reply