Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Animation language for LED controller  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Animation language for LED controller
« on: June 06, 2005, 09:20:33 pm »
Hello,

The wife is out of town, so I have been making some good progress on creating animations for my new LED controller.

I would like to open the floor to any suggestions that people might have.

An animation "primitive" is defined to be an open brace, a duration (in milliseconds), a starting port number on the controller, and a series of space-delimited percentages, or a + being 100%, then a close brace.

Here are some examples of animation primitives:
{ 50 1 0 0 0 0 0 0 0 0 0 } turn off 9 lights starting at port 1, for 50 ms.
{ 100 21 + + + } turn on 3 lights full starting at port 21 for 100 ms.

So, to develop animations all you have to do is string together sequences
of these primitives. Here's a sequence that successively turns on port 9
thru 16, starting at port 11:
{ 50 9 0 0 0 0 0 0 0 0 }
{ 50 11 + }
{ 50 11 0 + }
{ 50 12 0 + }
{ 50 13 0 + }
{ 50 14 0 + }
{ 50 15 0 + }
{ 50 9 + 0 0 0 0 0 0 0 }
{ 50 9 0 + }
{ 50 10 0 }

It can get to a bit tedious stringing all these primitives together, so I have defined some "macros".

The macros are: "include", "repeat", and "multiplex".

Include just reads in a different animation file, so you can use a sequence of primitives in multiple places.

Repeat simply repeats the following sequence of primitives a specified number of times. So to flash some lights you would do something like:

repeat 10
{
  { 50 9 + + + + + + + + }
  { 50 9 0 0 0 0 0 0 0 0 }
}

Multiplex takes two sequences of primitives and threads them together so that they happen at the same time.

multiplex
{
   include "foo.txt"
   include "bar.txt"
   repeat 10
   {
      { 50 9 + + + + + + + + }
      { 50 9 0 0 0 0 0 0 0 0 }
   }
}

This would run three sequences at the same time, the ones defined in "foo.txt" and "bar.txt", and the repeated flashing. A multiplex operation will only end when the longest of its constituent sequences ends. So if
"bar.txt" takes a lot longer to complete, then the other two won't do anything until it does.

I would appreciate any ideas you guys might have on different helper macros that I can implement.

Regards,
Buddabing
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Veinman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 537
  • Last login:June 11, 2014, 02:40:27 pm
  • "Done" with The Legend of Mame
    • The Gelatinous Cube
Re: Animation language for LED controller
« Reply #1 on: June 07, 2005, 11:49:52 am »
I haven't really followed this project so forgive me if I'm retreading things here. I like your idea of a "scripting language", that's very cool.

How many degrees of brightness are there?

Is a port the equivalent of an individual LED?

It would be cool to have a macro/command to implement a degree of randomness. For example, with one command you could turn the LED board into a random, seizure-inducing mess. Could be neat if done in a certain way, I guess I'm thinking more along the lines of the Visualizations in Windows Media Player.

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re: Animation language for LED controller
« Reply #2 on: June 07, 2005, 12:19:15 pm »
I had to read it a couple times and really think it over, but I think I understand.

I have a couple questions though.

1) As Veinman asked, how many degrees of brightness are there?  Is this is hardware-related and/or dependant on the type of bulbs used?

2) There's 1 LED per port, correct?

3) To me the "macro" concept means "putting a whole bunch of commands in one easy-to-use statement".  I understand how the include and repeat macros work, but how does the multiplex macro work? I mean, if there were no multiplex "macro" how would you build your primitives?  Or is the ,multiplex macro a "special case"?

  If I have (I assume the port numbers are 1-based, not 0-based?)

Code: [Select]
multiplex
{
{ 100 1 0 0 0 0 0 0 }
{ 100 1 + + + + + + }
}

  ...what would happen?

Great work, Buddabing!  I can't wait to really see this in action!

It would be cool to have a macro/command to implement a degree of randomness. For example, with one command you could turn the LED board into a random, seizure-inducing mess. Could be neat if done in a certain way, I guess I'm thinking more along the lines of the Visualizations in Windows Media Player.

  The "random macro" is a good idea! I want a seizure-inducing blink-fest to happen on my control panel when I make the next letter in Moon Patrol.. Or uncover an "elbow" in Gal's Panic!

-sab

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: Animation language for LED controller
« Reply #3 on: June 07, 2005, 12:49:55 pm »
I had to read it a couple times and really think it over, but I think I understand.

I have a couple questions though.

1) As Veinman asked, how many degrees of brightness are there?
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re: Animation language for LED controller
« Reply #4 on: June 07, 2005, 01:05:01 pm »
Quote
2) There's 1 LED per port, correct?

Yes, unless the user has two or more LEDs in series.

  In which case your board would control both/all of them at the same time (it can't distinguish between them if the bulbs are connected directly to each other).  I just want to be clear.

The multiplex macro runs two or more primitives at the same time. In your case, the second primitive would probably overwrite the first one. I should probably check for that.

  Okay, so take your example:

Code: [Select]
multiplex
{
   include "foo.txt"
   include "bar.txt"
   repeat 10
   {
      { 50 9 + + + + + + + + }
      { 50 9 0 0 0 0 0 0 0 0 }
   }
}

  The "multiplex" part only counts for the next level deep, right? Otherwise it would render the repeat meaningless (since either it wouldn't be "repeating" if each iteration ran at the same time, or if it did repeat and since it's muliplexing, it would repeat the second primative, { 50 9 0 0 0 0 0 0 0 0 }, 10 times).  Do you know what I mean? Which scenario would play out?

   Again, I just want to be clear..  Sorry for all the questions.

-sab

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: Animation language for LED controller
« Reply #5 on: June 07, 2005, 01:51:44 pm »

The multiplex macro runs two or more primitives at the same time. In your case, the second primitive would probably overwrite the first one. I should probably check for that.

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

MrTroy

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 241
  • Last login:August 14, 2012, 12:13:12 am
  • Working on 4 projects
    • TDP.com
Re: Animation language for LED controller
« Reply #6 on: June 07, 2005, 03:16:12 pm »
Ok ok ok

I'm not going say what I think this does. So tell me what it does and I'll be like "Oh yeah, that's what I ment"

{ 50 1 50 0 0 0 0 0}
{ 50 1 100 50 }
{ 50 1 50 100 50}
{ 50 1 0 50 100 }
{ 50 1 0 0 50 }
{ 50 1 0 0 0 }

I'm a little slow... :)
Lounge Room Arcade finished 12/08/2005

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re: Animation language for LED controller
« Reply #7 on: June 07, 2005, 03:42:53 pm »
{ 50 1 50 0 0 0 0 0}
{ 50 1 100 50 }
{ 50 1 50 100 50}
{ 50 1 0 50 100 }
{ 50 1 0 0 50 }
{ 50 1 0 0 0 }


                LED
B      1      2      3       4      5      6
R     50      0      0       0      0      0
I     100    50      0       0      0      0
G     50     100    50       0      0      0
H      0     50    100       0      0      0
T      0      0     50       0      0      0
N      0      0      0       0      0      0
E
S
S


  Are you building a Knight Rider cab? :)

-sab

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re: Animation language for LED controller
« Reply #8 on: June 07, 2005, 03:43:57 pm »
Or for the kiddies   :laugh:

{ 50 1 0 0 0 0 0 }
{ 100 3 + }
{ 100 2 + 0 }
{ 100 1 + 0 }
{ 100 2 + 0 }
{ 100 2 0 + }
{ 30 3 0 }
{ 100 3 + }
{ 30 3 0 }
{ 100 3 + }

{ 100 2 + 0 }
{ 30 2 0 }
{ 100 2 + }
{ 30 2 0 }
{ 100 2 + }

{ 100 2 0 + }
{ 100 3 0 0 + }
{ 30 5 0 }
{ 100 5 + }
{ 130 5 0 }

{ 100 3 + }
{ 100 2 + 0 }
{ 100 1 + 0 }
{ 100 2 + 0 }
{ 100 2 0 + }
{ 30 3 0 }
{ 100 3 + }
{ 30 3 0 }
{ 100 3 + }

{ 100 2 + 0 }
{ 30 2 0 }
{ 100 2 + }
{ 100 2 0 0 + }
{ 100 2 + 0 0 }
{ 150 1 + 0 }

-sab

Chris

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4574
  • Last login:September 21, 2019, 04:59:49 pm
    • Chris's MAME Cabinet
Re: Animation language for LED controller
« Reply #9 on: June 07, 2005, 04:32:30 pm »
So how would I send these commands from a program like DOSCab or WinCab Jukebox?

--Chris
--Chris
DOSCab/WinCab Jukebox: http://www.dwjukebox.com

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: Animation language for LED controller
« Reply #10 on: June 07, 2005, 05:01:02 pm »
So how would I send these commands from a program like DOSCab or WinCab Jukebox?

--Chris

The application interface is still a WIP. I can't complete it until after my prototype PCB is produced and assembled. I'll post it as soon as it is finalized.

If you like, PM me and I'll email you what I have.

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Chris

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4574
  • Last login:September 21, 2019, 04:59:49 pm
    • Chris's MAME Cabinet
Re: Animation language for LED controller
« Reply #11 on: June 07, 2005, 05:55:32 pm »
So how would I send these commands from a program like DOSCab or WinCab Jukebox?

--Chris

The application interface is still a WIP. I can't complete it until after my prototype PCB is produced and assembled. I'll post it as soon as it is finalized.

If you like, PM me and I'll email you what I have.
That's okay, it doesn't matter until I can get my hands on a PCB... I've learned my lesson about trying to code for hardware I don't have...
--Chris
DOSCab/WinCab Jukebox: http://www.dwjukebox.com

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: Animation language for LED controller
« Reply #12 on: June 08, 2005, 10:53:29 am »
I've made a couple of changes in the animation language.

The first change was to change the braces around the primitives to parentheses. This was done to simplify the parsing.

The second change was done to address a problem with the multiplex.

For example, for the following animation:

[code]multiplex
{
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re: Animation language for LED controller
« Reply #13 on: June 08, 2005, 02:18:06 pm »
Hmm.  Can you at least tell me if my thing "plays" Mary Had A Little Lamb? :)

-sab

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: Animation language for LED controller
« Reply #15 on: June 30, 2005, 03:51:32 pm »
I've added three more constructs to my animation language:

Code: [Select]
clear
This causes all LEDs to be turned off. Easy enough.

[code]ramp
{
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!