codingjoe / MusicBeam

MusicBeam is a multi plattform software to use a projector as a rgb laser.
https://www.musicbeam.org/
MIT License
270 stars 50 forks source link

The effect's list needs a scroll so more effects can be added (w/ suggestion code) #58

Open LuisMQuinones opened 6 years ago

LuisMQuinones commented 6 years ago

We can't add any new effects to the Effect effectsArray, or better; anymore toggles to RadioButton activeEffect, because the additional toggles are rendered off screen.

I looked for ways to wrap the activeEffect into one of the scroll controllers like ListBox or ScrollableList. I think we may need to drop RadioButton activeEffect in favor of a ScrollableList with no visible bar.

I wrote some short code to test it out:

screen shot 2018-05-15 at 7 01 37 pm

cp5 = new ControlP5(this);
scroll = cp5.addScrollableList("scroll")
     .setType(ScrollableList.LIST)       
      .setBarHeight(0)
      .setSize(150,150)
      .setItemHeight(20)
      .setBarVisible(false)
      .setPosition(width/2-75,height/2-75) ;
void scroll(int i){
     //println(i, cp5.get(ScrollableList.class, "scroll").getItem(i));
     Effect effect = (Effect)cp5.get(ScrollableList.class, "scroll").getItem(i).get("value");
     println("id",effect.val,"name",effect.name,"was chosen");
   }

I think it looks like the original implementation with an added scrollbar. @codingjoe I'll love to hear what you think.

codingjoe commented 6 years ago

@LuisMQuinones thanks for the research good work. I agree this looks like the best solution. We should probably define a frame size, that works on most screens. I would not keep the current one, I would like the bottom button to be only half in the viewport by default. That way it's visually identifiable that the frame can scrolled.

codingjoe commented 6 years ago

That being said, I can't wait for your PR! Whats the new effect you are working on?

LuisMQuinones commented 6 years ago

I plan on making quite a few effects; if you don't mind.

The one that I plan on PR first is called LightBugs_Effect. It "simulates" bugs crawling across the screen. One set of beat dictates the spawn rate of the bugs, and another set of beats dictates the size of the bug. The bugs get bigger as beat detects, and they get smaller as time passes.

I have to keep tweaking it a bit, and I need to add the customization aspect to the effect. I don't have a projector to test out the effect, so I'm also waiting on that. I created a tool to help me imagine the effects though. I posted screenshots of the tool as issue: #59.

lightbugsscreenshot

codingjoe commented 6 years ago

That's so cool. Where do you live? Maybe I can hook you up with a projector...

LuisMQuinones commented 6 years ago

Thank you so much! I was actually nervous for my first contributions.

I live in MA, USA, so I don't think that is convenient. I really appreciate the amazingly kind gesture!

Do you know how well a cheap sub $100 Amazon projector works? At least development purposes? I found a few with 2000 Lumen and a 1000:1 Contrast.

lh84 commented 2 years ago

I plan on making quite a few effects; if you don't mind.

The one that I plan on PR first is called LightBugs_Effect. It "simulates" bugs crawling across the screen. One set of beat dictates the spawn rate of the bugs, and another set of beats dictates the size of the bug. The bugs get bigger as beat detects, and they get smaller as time passes.

I have to keep tweaking it a bit, and I need to add the customization aspect to the effect. I don't have a projector to test out the effect, so I'm also waiting on that. I created a tool to help me imagine the effects though. I posted screenshots of the tool as issue: #59.

lightbugsscreenshot

Hi do you want to share your bugs effect with us?