Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common JSON format for animations #145

Open
wI2L opened this issue Aug 3, 2016 · 0 comments
Open

Common JSON format for animations #145

wI2L opened this issue Aug 3, 2016 · 0 comments

Comments

@wI2L
Copy link

wI2L commented Aug 3, 2016

Hello

I am currently developping a full-featured go library for the BlinkyTape and i aim to implement animations. From PatternPaint, we can only export the animation to an Arduino C header file, and i would like to suggest to add a new export capability with a more common syntax, like JSON.

{
  "name": "cylon",
  "repeat": 666,
  "delay": 20,
  "frames": [
    [
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}}
    ],
    [
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}},
      {"color": {"r": 255, "g": 3, "b": 0}}
    ]
  ]
}

The structure is pretty straightforward, we have a key frames which is an array of frames, each frame is an array of pixels. A pixel have for now only the field color represented by three keys, but we may add more later, like brightness ?

The values of repeat and delay follow the syntax of the arduino export. name is for consistency/debug. Still, i think we should use speed as it is more human friendly (like in the PatternPaint GUI) and let the libraries do the math to get the delay between each frame.

The proposal does actually fit my library implementation, but i think it is representative and not too specific to be used by other libraries. I am open to any changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants