Would anyone know the way to have the background color (knob 5), change when an input trigger is received? thank you in advance.
background colour is changed with
you can instead use etc.bg_color= color(r,g,b), if you don’t want to use the ‘normal’ colours select by knob5.
btw: handy tip, colour_picker_bg() returns the colour selected… useful for storing…
a trig is detected, by looking for
so using these, you could do something like use a different colour when the trig is received.
iirc, (i.e. need to go boot my eyesy ) the knob5 to bg colour selection is done in each individual mode… so you have to change in each mode you want to have this happen.
@oweno have you got a repo for the eyesy modes?
there are some differences from the ETC_Modes repo e.g. for knob5.
(i sometimes use the repos, when I just want to check a patch without booting up a machine )
Yes, the modes are now organized in their on repository:
I am new at this, I know some code, still becoming familiar with python, so I am editing the slideshow mode and I put the trigger into the source of where the (knob5) was and i can get the colors to trigger, But only black and white. can I get it to filter though the colors available?
def draw(screen, etc) :
global images, image_index, last_screen, nest, bgi, bgi2, trigger, xr, yr
trigger = False
if you look at the modes code, you will find the ‘normal’ implementation is
etc.knob5 returns 0 to 1.0
this is a actually a continuous set of colours, moving thru an RGB palette, rather than a sequence you could ‘step thru’…
but as an example you could do something like (pseudo code, only!)
if etc.audio_trig > 0 : bg_colour = bg_colour + 0.1 if bg_colour > 1.0 : bg_colour = 0.0 etc.color_picker_bg(bg_colour)
this would then cycle thru 10 colours ( 1.0/0.1 = 10 )
if you wanted to cycle thru a known set of colours (e.g. specified by rgb values) , you could store these in an array, and then cycle thru that array each time audio trig was received.
note: you also might want to do a more ‘elaborate’ code , such the colour only switch when a trig is received, and then waits for audio to drop below a threshold before it re-trigs. but I’ll leave that as an exercise for the reader