Jump to content
C4 Forums | Control4

How to program button to scroll available Audio sources?


Letran

Recommended Posts

I've got 6-button keypads on each room to control audio for each room.

This is how I would like to program each 6-button keypad.

Button1 - Scroll through available audio sources e.g. Press 1= ipod, next press, FM radio, next press AM, next press etc then it cycles through. I have about 8 audio sources for some rooms.

Button2 - Volume Up (I've figured this one out Press -START Volume UP, Release STOP Volume Up)

Button3 - Volume Down (I've figured this one out Press -START Volume Down, Release STOP Volume Down, Room OFF)

Button4 - Toggle between Pause & Play ( i do not know how to program it to simply toggle. Need Help)

Button5 - Next ( How do I program 2-tap to go at the end of the list)

Button6 - Back( How do I program 2-tap to go at the beginning of the list)

Does any body else have the same setup and can suggest how to utilise the keypads to control audio or even video? Thanks in advance

Link to comment
Share on other sites


I've looked there and here. C4diy has *multi-tap* programming and *Tracking* what source is playing but not to choose via SCROLL

I know I can assign a number of taps for each audio source but that will be too cumbersome (e.g. 1 tap for ipod 8 taps for xm.) I want to program that each successive press changes the source selection may even play a wave file to confirm selection.

How about...

Button4 - Toggle between Pause & Play ( i do not know how to program it to simply toggle. Need Help)

Button5 - Next ( How do I program 2-tap to go at the end of the list)

Button6 - Back( How do I program 2-tap to go at the beginning of the list)

1.8.2 is easy to program up 3 taps that is not the problem it is programming *end of playlist & beginning of playlist*

Ryan sorry for borrowing your *.*. Thanks again

Link to comment
Share on other sites

I've done this to toggle between 3 sources (FM Radio, DVD, Digital Audio)

Rather than use a timer for multi-tap functions, just use a variable to act as a counter:

I created a number variable called 'PatioAudioCounter'

Each time the button is clicked it increments the counter, with additional code to say if = 4 then set it back to 0

Then on change on variable I say:

If PatioAudioCounter = 0 then room off, led colour = red

If PatioAudioCounter = 1 then room source = fm radio, led colour = green

etc....

This variable is also handy for any other programming required, as you know what source is playing.

Only gotcha I found was changing source or turning the room off from another interface - as it will not reset the counter variable unless you program it to do so.

Link to comment
Share on other sites

*Reserved*

Edit: too long to type accurately on my phone. Inmost from the computer tonight with how to do what you're after. I utilize several 6 burton keypads in a similar way.

Edit 2: See my post below...I forgot to edit this one. Oops.

Link to comment
Share on other sites

Yep, do the play/pause toggle the same way.

Just remember if you use an 'all off' function from somewhere else in the house - it is handy to have 'all off' set all your variables back to 0, that way next time you use the room, the 6 button is displaying correctly and will start at source 1.

I have never tried to skip to start or end of playlist.

Off the top of my head I can't think of any way to do this in programming

I wonder if there is a 'total count' and 'current position' property of a playlist - this would allow you do a loop to click next a given amount of times - could be quite slow though....

Alternatively you could program the 'go to end of list' button to do a 'stop' -> 'play' -> 'Prev' to take you to last song of list.

Hopefully someone else has looked at this and can answer, else I will have a play next time I'm working at home.

Link to comment
Share on other sites

*Suspense* Cool, look forward to it. All 6-buttons? Please (if possible)

I'm new to programmng so I figured people are already using the 6-button keypads this way, just programmed better and simpler.

Merci

Link to comment
Share on other sites

I dont think there's any playlist functionality programming like you're looking for (go to the end).

If you stop playing a playlist, and start playing it again, IIRC it will start at the first song again.

I've done what you're looking for in button 1 and it's a pain to setup with audio announcements and color changes, but works.

Link to comment
Share on other sites

I've got 6-button keypads on each room to control audio for each room.

This is how I would like to program each 6-button keypad.

Button1 - Scroll through available audio sources e.g. Press 1= ipod, next press, FM radio, next press AM, next press etc then it cycles through. I have about 8 audio sources for some rooms.

This is easy. Just do a conditional for each of those sources. Something like this:

When Button1 is released:

IF - Room is Off, Select iPod as audio source in ROOM

STOP

IF - Audio Source in ROOM is iPod, Select FM Radio as source in ROOM

STOP

IF - Audio Source in ROOM is FM Radio, select AM Radio as source in ROOM

STOP

etc...

Button2 - Volume Up (I've figured this one out Press -START Volume UP, Release STOP Volume Up)

Button3 - Volume Down (I've figured this one out Press -START Volume Down, Release STOP Volume Down, Room OFF)

You are correct in how to do this. I do this all the time and it works great.

Button4 - Toggle between Pause & Play ( i do not know how to program it to simply toggle. Need Help)

What I would do here is create a boolean variable called "PAUSE MUSIC" (or play, doesn't really matter). I would then set the keypad to toggle that variable on button release. Go into the programming for when the variable changes and say:

When Variable PAUSE MUSIC changes

IF variable = TRUE

send command PAUSE to ROOM

IF variable = FALSE

send command PLAY to ROOM

Button5 - Next ( How do I program 2-tap to go at the end of the list)

Button6 - Back( How do I program 2-tap to go at the beginning of the list)

What you're looking for here (on the single taps) is PULSE SKIP BACK command and PULSE SKIP FORWARD command.

About teh double taps, I'm pretty sure that isn't possible. Sorry.

Does any body else have the same setup and can suggest how to utilise the keypads to control audio or even video? Thanks in advance

I use keypads like this all over the house, and I use them as I described above. Hopefully that saves you some trial and error time.

D

Link to comment
Share on other sites

Letran.

Something else you may want to try is to have the LED on the source button change to a different color depending on which source is active. I have done this before and it is really good as it lets you know what you are listening to. It does take a fair amount of logic, but once you have it setup it works great.

Link to comment
Share on other sites

When Button1 is released:

IF - Room is Off, Select iPod as audio source in ROOM

STOP

IF - Audio Source in ROOM is iPod, Select FM Radio as source in ROOM

STOP

IF - Audio Source in ROOM is FM Radio, select AM Radio as source in ROOM

STOP

etc...

What I would do here is create a boolean variable called "PAUSE MUSIC" (or play, doesn't really matter). I would then set the keypad to toggle that variable on button release. Go into the programming for when the variable changes and say:

When Variable PAUSE MUSIC changes

IF variable = TRUE

send command PAUSE to ROOM

IF variable = FALSE

send command PLAY to ROOM

It WORKS, the programming was sound and functional. I just tied in a loop at the end so it will scroll back to the first selection.

Thanks Dan and everyone elses input.

Now if I can just get this damn multi-tuner a clearer signal i'll be set :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.