Setting BiblioPixel Animation Github to my own forked version?

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb

Hello Tom,
I appreciate the detailed response. I’m definitely interested in doing my own Github. Currently I only have BiblioPixel installed on the pi and forked the PiPixel repo, so that I could edit the ws2812b demo file to play other default animations. So in terms of it being setup as a project I don’t believe it is. I would love to learn how I should go about setting it uo as a project and then linking the animations to github so that i can quickly edit what is on my Pi. As I use my pi in headless mode most of the time. Since I use Raspbian Lite on my Pi.

Thanks,

Caleb

···

On Thursday, January 25, 2018 at 12:22:21 PM UTC-5, Tom Swirly wrote:

[SO annoying - sent while trying to dismiss an unwanted notification. CORRECT version follows.]

First, that’s a naturally good instinct, to fork your own version of BiblioPixelAnimations, and I applaud you for it. It’s easy to do what you ask and I do it all the time…

…but I think you can do even better for yourself!

Instead of a fork, why not just start your own completely independent project on github with its own name under your github account?

There are big advantages!

  • You can push your own code the instant it’s done - no waiting for us!
  • It doesn’t get lost in all the other created code in BPA.
  • It’s all your own and you can use your own coding standards, add dependencies, all that [stuff].
  • You can even accept other people’s patches to your code!
  • Other people can directly use your code in their Projects.
  • You’d be the first person doing this - so we’d set up a page with “contributors” and your name would be the first on the list. :smiley:
    So I’m going to push you to do it this way. I’m really hoping to get everyone to do this!

Now the question is - how do you use your code in your shiny new repo?

First question - are you using a Project to run your code? If not, we should get you moved over to doing that.

A Project is a .json file that lets you represent all the parts of a BiblioPixel project. It has a lot of advantages over writing Python code - namely, it’s clear, and concise, and makes animations that have dozens or even hundreds of smaller moving parts a real possibility.

In your case, it gives you the ability to use your own code.

The simplest way to use your own code is to have the project file and the Python file in the same directory, like this

Project file project.json:

{
“animation”: “Caleba.py”,
“run”: {“fps”: 60}

}

Project file project2.json:

{
“animation”: {
“typename”: “Caleba.py”,
“something”: “abc”,
“another”: 20
},
“run”: {“fps”: 60}

}

Python file Caleba.py:

from bibliopixel.animation import BaseStripAnim

class Caleba(BaseStringAnim):
def init(self, *args, something=None, another=12, **kwds):
super().init(*args, **kwds)
# Go wild constructing the animation.

def step(self, amt=1):
    # This gets called each frame - here is where you change the LED values.
    # Go wild animation here!

Now, if you don’t want your project in the same directory as your Python source, there are several great ways to do this! But let’s start with that and see how it works for you, and then when your project gets big, we can show you ways to restructure it pretty well any way you feel like.

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb


You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.
To post to this group, send email to maniacal-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com1

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Caleb, assuming you are talking about this: https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json
That is a project already.
You can even run sudo bp run [https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json](https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json`) and it will work.
If you are, in fact using WS2812 with the PiPixel, however, please be sure to install the required C driver: https://github.com/ManiacalLabs/BiblioPixel/wiki/PiWS281X

···

On Thu, Jan 25, 2018 at 4:08 PM, Caleb B burnoskyt@gmail.com wrote:

Hello Tom,
I appreciate the detailed response. I’m definitely interested in doing my own Github. Currently I only have BiblioPixel installed on the pi and forked the PiPixel repo, so that I could edit the ws2812b demo file to play other default animations. So in terms of it being setup as a project I don’t believe it is. I would love to learn how I should go about setting it uo as a project and then linking the animations to github so that i can quickly edit what is on my Pi. As I use my pi in headless mode most of the time. Since I use Raspbian Lite on my Pi.

Thanks,

Caleb

On Thursday, January 25, 2018 at 12:22:21 PM UTC-5, Tom Swirly wrote:

[SO annoying - sent while trying to dismiss an unwanted notification. CORRECT version follows.]

First, that’s a naturally good instinct, to fork your own version of BiblioPixelAnimations, and I applaud you for it. It’s easy to do what you ask and I do it all the time…

…but I think you can do even better for yourself!

Instead of a fork, why not just start your own completely independent project on github with its own name under your github account?

There are big advantages!

  • You can push your own code the instant it’s done - no waiting for us!
  • It doesn’t get lost in all the other created code in BPA.
  • It’s all your own and you can use your own coding standards, add dependencies, all that [stuff].
  • You can even accept other people’s patches to your code!
  • Other people can directly use your code in their Projects.
  • You’d be the first person doing this - so we’d set up a page with “contributors” and your name would be the first on the list. :smiley:
    So I’m going to push you to do it this way. I’m really hoping to get everyone to do this!

Now the question is - how do you use your code in your shiny new repo?

First question - are you using a Project to run your code? If not, we should get you moved over to doing that.

A Project is a .json file that lets you represent all the parts of a BiblioPixel project. It has a lot of advantages over writing Python code - namely, it’s clear, and concise, and makes animations that have dozens or even hundreds of smaller moving parts a real possibility.

In your case, it gives you the ability to use your own code.

The simplest way to use your own code is to have the project file and the Python file in the same directory, like this

Project file project.json:

{
“animation”: “Caleba.py”,
“run”: {“fps”: 60}

}

Project file project2.json:

{
“animation”: {
“typename”: “Caleba.py”,
“something”: “abc”,
“another”: 20
},
“run”: {“fps”: 60}

}

Python file Caleba.py:

from bibliopixel.animation import BaseStripAnim

class Caleba(BaseStringAnim):
def init(self, *args, something=None, another=12, **kwds):
super().init(*args, **kwds)
# Go wild constructing the animation.

def step(self, amt=1):
    # This gets called each frame - here is where you change the LED values.
    # Go wild animation here!

Now, if you don’t want your project in the same directory as your Python source, there are several great ways to do this! But let’s start with that and see how it works for you, and then when your project gets big, we can show you ways to restructure it pretty well any way you feel like.

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb


You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.
To post to this group, send email to maniacal-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com1

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/e10b469a-7a6a-4c1d-a66e-f48e0c5bd89a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hello Adam,
That’s exactly what I was referring to. That’s also the command that I’ve been using to run the ws2812.json. Required C driver? I installed an updated python, BiblioPixel, and the necessary item to allow for driver creation. Don’t recall one called C driver. But the project runs fine using this command.

···

On Thursday, January 25, 2018 at 4:36:55 PM UTC-5, Adam Haile wrote:

Caleb, assuming you are talking about this: https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json
That is a project already.
You can even run sudo bp run [https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json](https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json) and it will work.
If you are, in fact using WS2812 with the PiPixel, however, please be sure to install the required C driver: https://github.com/ManiacalLabs/BiblioPixel/wiki/PiWS281X

On Thu, Jan 25, 2018 at 4:08 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
I appreciate the detailed response. I’m definitely interested in doing my own Github. Currently I only have BiblioPixel installed on the pi and forked the PiPixel repo, so that I could edit the ws2812b demo file to play other default animations. So in terms of it being setup as a project I don’t believe it is. I would love to learn how I should go about setting it uo as a project and then linking the animations to github so that i can quickly edit what is on my Pi. As I use my pi in headless mode most of the time. Since I use Raspbian Lite on my Pi.

Thanks,

Caleb

On Thursday, January 25, 2018 at 12:22:21 PM UTC-5, Tom Swirly wrote:

[SO annoying - sent while trying to dismiss an unwanted notification. CORRECT version follows.]

First, that’s a naturally good instinct, to fork your own version of BiblioPixelAnimations, and I applaud you for it. It’s easy to do what you ask and I do it all the time…

…but I think you can do even better for yourself!

Instead of a fork, why not just start your own completely independent project on github with its own name under your github account?

There are big advantages!

  • You can push your own code the instant it’s done - no waiting for us!
  • It doesn’t get lost in all the other created code in BPA.
  • It’s all your own and you can use your own coding standards, add dependencies, all that [stuff].
  • You can even accept other people’s patches to your code!
  • Other people can directly use your code in their Projects.
  • You’d be the first person doing this - so we’d set up a page with “contributors” and your name would be the first on the list. :smiley:
    So I’m going to push you to do it this way. I’m really hoping to get everyone to do this!

Now the question is - how do you use your code in your shiny new repo?

First question - are you using a Project to run your code? If not, we should get you moved over to doing that.

A Project is a .json file that lets you represent all the parts of a BiblioPixel project. It has a lot of advantages over writing Python code - namely, it’s clear, and concise, and makes animations that have dozens or even hundreds of smaller moving parts a real possibility.

In your case, it gives you the ability to use your own code.

The simplest way to use your own code is to have the project file and the Python file in the same directory, like this

Project file project.json:

{
“animation”: “Caleba.py”,
“run”: {“fps”: 60}

}

Project file project2.json:

{
“animation”: {
“typename”: “Caleba.py”,
“something”: “abc”,
“another”: 20
},
“run”: {“fps”: 60}

}

Python file Caleba.py:

from bibliopixel.animation import BaseStripAnim

class Caleba(BaseStringAnim):
def init(self, *args, something=None, another=12, **kwds):
super().init(*args, **kwds)
# Go wild constructing the animation.

def step(self, amt=1):
    # This gets called each frame - here is where you change the LED values.
    # Go wild animation here!

Now, if you don’t want your project in the same directory as your Python source, there are several great ways to do this! But let’s start with that and see how it works for you, and then when your project gets big, we can show you ways to restructure it pretty well any way you feel like.

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb


You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.
To post to this group, send email to maniacal-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com1

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/e10b469a-7a6a-4c1d-a66e-f48e0c5bd89a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I just meant that you need to install rpi_ws281x (which is a C library) to make that ws2812.json file to work.

···

On Thu, Jan 25, 2018 at 4:48 PM, Caleb B burnoskyt@gmail.com wrote:

Hello Adam,
That’s exactly what I was referring to. That’s also the command that I’ve been using to run the ws2812.json. Required C driver? I installed an updated python, BiblioPixel, and the necessary item to allow for driver creation. Don’t recall one called C driver. But the project runs fine using this command.

On Thursday, January 25, 2018 at 4:36:55 PM UTC-5, Adam Haile wrote:

Caleb, assuming you are talking about this: https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json
That is a project already.
You can even run sudo bp run [https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json](https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json) and it will work.
If you are, in fact using WS2812 with the PiPixel, however, please be sure to install the required C driver: https://github.com/ManiacalLabs/BiblioPixel/wiki/PiWS281X

On Thu, Jan 25, 2018 at 4:08 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
I appreciate the detailed response. I’m definitely interested in doing my own Github. Currently I only have BiblioPixel installed on the pi and forked the PiPixel repo, so that I could edit the ws2812b demo file to play other default animations. So in terms of it being setup as a project I don’t believe it is. I would love to learn how I should go about setting it uo as a project and then linking the animations to github so that i can quickly edit what is on my Pi. As I use my pi in headless mode most of the time. Since I use Raspbian Lite on my Pi.

Thanks,

Caleb

On Thursday, January 25, 2018 at 12:22:21 PM UTC-5, Tom Swirly wrote:

[SO annoying - sent while trying to dismiss an unwanted notification. CORRECT version follows.]

First, that’s a naturally good instinct, to fork your own version of BiblioPixelAnimations, and I applaud you for it. It’s easy to do what you ask and I do it all the time…

…but I think you can do even better for yourself!

Instead of a fork, why not just start your own completely independent project on github with its own name under your github account?

There are big advantages!

  • You can push your own code the instant it’s done - no waiting for us!
  • It doesn’t get lost in all the other created code in BPA.
  • It’s all your own and you can use your own coding standards, add dependencies, all that [stuff].
  • You can even accept other people’s patches to your code!
  • Other people can directly use your code in their Projects.
  • You’d be the first person doing this - so we’d set up a page with “contributors” and your name would be the first on the list. :smiley:
    So I’m going to push you to do it this way. I’m really hoping to get everyone to do this!

Now the question is - how do you use your code in your shiny new repo?

First question - are you using a Project to run your code? If not, we should get you moved over to doing that.

A Project is a .json file that lets you represent all the parts of a BiblioPixel project. It has a lot of advantages over writing Python code - namely, it’s clear, and concise, and makes animations that have dozens or even hundreds of smaller moving parts a real possibility.

In your case, it gives you the ability to use your own code.

The simplest way to use your own code is to have the project file and the Python file in the same directory, like this

Project file project.json:

{
“animation”: “Caleba.py”,
“run”: {“fps”: 60}

}

Project file project2.json:

{
“animation”: {
“typename”: “Caleba.py”,
“something”: “abc”,
“another”: 20
},
“run”: {“fps”: 60}

}

Python file Caleba.py:

from bibliopixel.animation import BaseStripAnim

class Caleba(BaseStringAnim):
def init(self, *args, something=None, another=12, **kwds):
super().init(*args, **kwds)
# Go wild constructing the animation.

def step(self, amt=1):
    # This gets called each frame - here is where you change the LED values.
    # Go wild animation here!

Now, if you don’t want your project in the same directory as your Python source, there are several great ways to do this! But let’s start with that and see how it works for you, and then when your project gets big, we can show you ways to restructure it pretty well any way you feel like.

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb


You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.
To post to this group, send email to maniacal-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com1

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/e10b469a-7a6a-4c1d-a66e-f48e0c5bd89a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/f7a3cd8b-f80e-4e89-a96c-a176706ea510%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ah, yes I did indeed install rpi_ws281x

···

On Thursday, January 25, 2018 at 4:50:30 PM UTC-5, Adam Haile wrote:

I just meant that you need to install rpi_ws281x (which is a C library) to make that ws2812.json file to work.

On Thu, Jan 25, 2018 at 4:48 PM, Caleb B burn...@gmail.com wrote:

Hello Adam,
That’s exactly what I was referring to. That’s also the command that I’ve been using to run the ws2812.json. Required C driver? I installed an updated python, BiblioPixel, and the necessary item to allow for driver creation. Don’t recall one called C driver. But the project runs fine using this command.

On Thursday, January 25, 2018 at 4:36:55 PM UTC-5, Adam Haile wrote:

Caleb, assuming you are talking about this: https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json
That is a project already.
You can even run sudo bp run [https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json](https://github.com/ManiacalLabs/PiPixel/blob/master/Demos/ws2812.json) and it will work.
If you are, in fact using WS2812 with the PiPixel, however, please be sure to install the required C driver: https://github.com/ManiacalLabs/BiblioPixel/wiki/PiWS281X

On Thu, Jan 25, 2018 at 4:08 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
I appreciate the detailed response. I’m definitely interested in doing my own Github. Currently I only have BiblioPixel installed on the pi and forked the PiPixel repo, so that I could edit the ws2812b demo file to play other default animations. So in terms of it being setup as a project I don’t believe it is. I would love to learn how I should go about setting it uo as a project and then linking the animations to github so that i can quickly edit what is on my Pi. As I use my pi in headless mode most of the time. Since I use Raspbian Lite on my Pi.

Thanks,

Caleb

On Thursday, January 25, 2018 at 12:22:21 PM UTC-5, Tom Swirly wrote:

[SO annoying - sent while trying to dismiss an unwanted notification. CORRECT version follows.]

First, that’s a naturally good instinct, to fork your own version of BiblioPixelAnimations, and I applaud you for it. It’s easy to do what you ask and I do it all the time…

…but I think you can do even better for yourself!

Instead of a fork, why not just start your own completely independent project on github with its own name under your github account?

There are big advantages!

  • You can push your own code the instant it’s done - no waiting for us!
  • It doesn’t get lost in all the other created code in BPA.
  • It’s all your own and you can use your own coding standards, add dependencies, all that [stuff].
  • You can even accept other people’s patches to your code!
  • Other people can directly use your code in their Projects.
  • You’d be the first person doing this - so we’d set up a page with “contributors” and your name would be the first on the list. :smiley:
    So I’m going to push you to do it this way. I’m really hoping to get everyone to do this!

Now the question is - how do you use your code in your shiny new repo?

First question - are you using a Project to run your code? If not, we should get you moved over to doing that.

A Project is a .json file that lets you represent all the parts of a BiblioPixel project. It has a lot of advantages over writing Python code - namely, it’s clear, and concise, and makes animations that have dozens or even hundreds of smaller moving parts a real possibility.

In your case, it gives you the ability to use your own code.

The simplest way to use your own code is to have the project file and the Python file in the same directory, like this

Project file project.json:

{
“animation”: “Caleba.py”,
“run”: {“fps”: 60}

}

Project file project2.json:

{
“animation”: {
“typename”: “Caleba.py”,
“something”: “abc”,
“another”: 20
},
“run”: {“fps”: 60}

}

Python file Caleba.py:

from bibliopixel.animation import BaseStripAnim

class Caleba(BaseStringAnim):
def init(self, *args, something=None, another=12, **kwds):
super().init(*args, **kwds)
# Go wild constructing the animation.

def step(self, amt=1):
    # This gets called each frame - here is where you change the LED values.
    # Go wild animation here!

Now, if you don’t want your project in the same directory as your Python source, there are several great ways to do this! But let’s start with that and see how it works for you, and then when your project gets big, we can show you ways to restructure it pretty well any way you feel like.

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb


You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.
To post to this group, send email to maniacal-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com1

On Thu, Jan 25, 2018 at 5:52 PM, Caleb B burn...@gmail.com wrote:

Hello,
I recently got a PiPixel. I love it so far, however I’m interested in adding my own animations. I’m hoping I will be able to use my own forked version of BiblioPixel Animation Github.

Thanks in advance,

Caleb

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/4501189a-086c-43ec-8dab-b5e1ba264f11%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/e10b469a-7a6a-4c1d-a66e-f48e0c5bd89a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/f7a3cd8b-f80e-4e89-a96c-a176706ea510%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

···

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?
As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.
Thanks,

Caleb

···

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

···

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

···

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c642c33-835d-409b-8d22-4ecf6f24f94a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

···

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burnoskyt@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c642c33-835d-409b-8d22-4ecf6f24f94a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/c63f7c03-de6e-4b3c-b76a-0c9315ff0b9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

···

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c642c33-835d-409b-8d22-4ecf6f24f94a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/c63f7c03-de6e-4b3c-b76a-0c9315ff0b9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAG8g-TZ6SrsbzdV1d-xFGV%3DkDgnmyRMwrrTYGO0jpVig7AtvTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed

···

ERROR - run - When reading file BlueSparkle.json:

{

"animation": {

    "animations": [

        "CustomAnimations.Fade"

    ],

    "typename": "sequence"

},

"driver": {

    "c_order": "RGB",

    "num": 150,

    "typename": "simpixel"

},

"layout": {

    "brightness": 256,

    "typename": "strip"

},

"run": {

    "fps": 30

}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c642c33-835d-409b-8d22-4ecf6f24f94a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/c63f7c03-de6e-4b3c-b76a-0c9315ff0b9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAG8g-TZ6SrsbzdV1d-xFGV%3DkDgnmyRMwrrTYGO0jpVig7AtvTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c862eb8-690e-4922-9636-475624c2b1e8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

···

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c642c33-835d-409b-8d22-4ecf6f24f94a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/c63f7c03-de6e-4b3c-b76a-0c9315ff0b9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAG8g-TZ6SrsbzdV1d-xFGV%3DkDgnmyRMwrrTYGO0jpVig7AtvTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c862eb8-690e-4922-9636-475624c2b1e8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/fb0681cf-7d81-49eb-82d9-51ef520e78d6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com


/t

https://tom.ritchford.com

https://tom.swirly.com

https://github.com/bacu12/AccentLighting

I’m also in the Direct_Commands directory calling BlueSparkle.json using the command
bp -s --dim=100 BlueSparkle.json

···

On Saturday, February 3, 2018 at 1:18:58 PM UTC-5, Tom Swirly wrote:

Can you send me the github URL again? I know you sent it before, but I can’t seem to find it on this thread.

Based on your description, you can probably just replace “CustomAnimations.Fade” with “Fade” and it will all work.

Let me explain how the naming works: it works just like Python’s names do, only a bit more forgiving.

The dots (.) separate a name into parts:

  1. zero or more subdirectories
  2. one Python file
  3. an optional classname.

So if you have a file in your directory called Fade.py and it contains a class called Fast, then its name is Fade.Fast.

If you have submodules (here’s how to do that), then if you have a class Fade in file foo/bar/Baz.py its name is foo.bar.Baz.Fade.

Very often, you don’t have to put in the classname because bp is smart enough to figure it out:

  1. If the name of the file and the classname are “approximately the same” - so if the file is file fast_fade.py, then the class FastFade will match.
  2. If there is only one possible name in the file (i.e. your file contains exactly one Animation class at the top level)

On Sat, Feb 3, 2018 at 6:52 PM, Caleb B burn...@gmail.com wrote:

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/1c642c33-835d-409b-8d22-4ecf6f24f94a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/c63f7c03-de6e-4b3c-b76a-0c9315ff0b9c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAG8g-TZ6SrsbzdV1d-xFGV%3DkDgnmyRMwrrTYGO0jpVig7AtvTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

<font color="#0000ee

Thanks for Simplifying things. I tried the new changes. It gave “No Module Named numpy” when running from the root directory AccentLighting

···

On Saturday, February 3, 2018 at 5:49:50 PM UTC-5, Tom Swirly wrote:

I just added comments to the pull request. It’s getting late here, so I might not be up for any reply.

If you like it, you can just pull it into your repository from the pull request (I suggest using the Rebase And Merge option), and then in your local repository, type

git pull

On Sat, Feb 3, 2018 at 11:38 PM, Tom Swirly t...@swirly.com wrote:

OK! This is very exciting to see someone using this stuff. :slight_smile:


First, by sitting in a subdirectory, you make it impossible for the program to automatically find the Python code (without adding a --path argument or a “path” section or a few other tricks).

For simplicity’s sake, I always do all my work from the root directory of the project. This is true for C++ or Java or pretty well everywhere else - you can always do it and if you always do it, you have one less thing to think about

So that means your command now should be:

bp -s --dim=100 Direct_Commands/BlueSparkle.json


As for the rest - I sent you a pull request with fixes! Ah, git.

https://github.com/bacu12/AccentLighting/pull/1 for anyone else reading.

I’ll now explain what each commit does as comments attached to the pull request… :smiley:

On Sat, Feb 3, 2018 at 8:31 PM, Caleb B burn...@gmail.com wrote:

https://github.com/bacu12/AccentLighting

I’m also in the Direct_Commands directory calling BlueSparkle.json using the command
bp -s --dim=100 BlueSparkle.json

On Saturday, February 3, 2018 at 1:18:58 PM UTC-5, Tom Swirly wrote:

Can you send me the github URL again? I know you sent it before, but I can’t seem to find it on this thread.

Based on your description, you can probably just replace “CustomAnimations.Fade” with “Fade” and it will all work.

Let me explain how the naming works: it works just like Python’s names do, only a bit more forgiving.

The dots (.) separate a name into parts:

  1. zero or more subdirectories
  2. one Python file
  3. an optional classname.

So if you have a file in your directory called Fade.py and it contains a class called Fast, then its name is Fade.Fast.

If you have submodules (here’s how to do that), then if you have a class Fade in file foo/bar/Baz.py its name is foo.bar.Baz.Fade.

Very often, you don’t have to put in the classname because bp is smart enough to figure it out:

  1. If the name of the file and the classname are “approximately the same” - so if the file is file fast_fade.py, then the class FastFade will match.
  2. If there is only one possible name in the file (i.e. your file contains exactly one Animation class at the top level)

On Sat, Feb 3, 2018 at 6:52 PM, Caleb B burn...@gmail.com wrote:

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.
I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.
Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/545a4469-92a9-4de9-bf55-63a80ac967b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

</di

Installed Numpy for python3. Now it runs. But returns this

Calebs-MacBook-Pro-2:AccentLighting caleb$ bp -s --dim=100 Direct_Commands/BlueSparkle.json

INFO - websocket - Starting WebSocket server thread…

[array([255, 255, 255]), array([252, 252, 252]), array([249, 249, 249]), array([247, 247, 247]), array([244, 244, 244]), array([242, 242, 242]), array([239, 239, 239]), array([237, 237, 237]), array([234, 234, 234]), array([232, 232, 232]), array([229, 229, 229]), array([226, 226, 226]), array([224, 224, 224]), array([221, 221, 221]), array([219, 219, 219]), array([216, 216, 216]), array([214, 214, 214]), array([211, 211, 211]), array([209, 209, 209]), array([206, 206, 206]), array([204, 204, 204]), array([201, 201, 201]), array([198, 198, 198]), array([196, 196, 196]), array([193, 193, 193]), array([191, 191, 191]), array([188, 188, 188]), array([186, 186, 186]), array([183, 183, 183]), array([181, 181, 181]), array([178, 178, 178]), array([175, 175, 175]), array([173, 173, 173]), array([170, 170, 170]), array([168, 168, 168]), array([165, 165, 165]), array([163, 163, 163]), array([160, 160, 160]), array([158, 158, 158]), array([155, 155, 155]), array([153, 153, 153]), array([150, 150, 150]), array([147, 147, 147]), array([145, 145, 145]), array([142, 142, 142]), array([140, 140, 140]), array([137, 137, 137]), array([135, 135, 135]), array([132, 132, 132]), array([130, 130, 130]), array([127, 127, 127]), array([124, 124, 124]), array([122, 122, 122]), array([119, 119, 119]), array([117, 117, 117]), array([114, 114, 114]), array([112, 112, 112]), array([109, 109, 109]), array([107, 107, 107]), array([104, 104, 104]), array([102, 102, 102]), array([99, 99, 99]), array([96, 96, 96]), array([94, 94, 94]), array([91, 91, 91]), array([89, 89, 89]), array([86, 86, 86]), array([84, 84, 84]), array([81, 81, 81]), array([79, 79, 79]), array([76, 76, 76]), array([73, 73, 73]), array([71, 71, 71]), array([68, 68, 68]), array([66, 66, 66]), array([63, 63, 63]), array([61, 61, 61]), array([58, 58, 58]), array([56, 56, 56]), array([53, 53, 53]), array([51, 51, 51]), array([48, 48, 48]), array([45, 45, 45]), array([43, 43, 43]), array([40, 40, 40]), array([38, 38, 38]), array([35, 35, 35]), array([33, 33, 33]), array([30, 30, 30]), array([28, 28, 28]), array([25, 25, 25]), array([22, 22, 22]), array([20, 20, 20]), array([17, 17, 17]), array([15, 15, 15]), array([12, 12, 12]), array([10, 10, 10]), array([7, 7, 7]), array([5, 5, 5]), array([2, 2, 2])]

ERROR: Base class step() called. This shouldn’t happen

···

On Saturday, February 3, 2018 at 7:05:20 PM UTC-5, Tom Swirly wrote:

Much progress.

We need to make sure there’s a better error message here that tells you what to do better,

You need to install numpy, because you’re using a numpy feature: from the command line":

pip install numpy

On Sun, Feb 4, 2018 at 12:36 AM, Caleb B burn...@gmail.com wrote:

Thanks for Simplifying things. I tried the new changes. It gave “No Module Named numpy” when running from the root directory AccentLighting

On Saturday, February 3, 2018 at 5:49:50 PM UTC-5, Tom Swirly wrote:

I just added comments to the pull request. It’s getting late here, so I might not be up for any reply.

If you like it, you can just pull it into your repository from the pull request (I suggest using the Rebase And Merge option), and then in your local repository, type

git pull

On Sat, Feb 3, 2018 at 11:38 PM, Tom Swirly t...@swirly.com wrote:

OK! This is very exciting to see someone using this stuff. :slight_smile:


First, by sitting in a subdirectory, you make it impossible for the program to automatically find the Python code (without adding a --path argument or a “path” section or a few other tricks).

For simplicity’s sake, I always do all my work from the root directory of the project. This is true for C++ or Java or pretty well everywhere else - you can always do it and if you always do it, you have one less thing to think about

So that means your command now should be:

bp -s --dim=100 Direct_Commands/BlueSparkle.json


As for the rest - I sent you a pull request with fixes! Ah, git.

https://github.com/bacu12/AccentLighting/pull/1 for anyone else reading.

I’ll now explain what each commit does as comments attached to the pull request… :smiley:

On Sat, Feb 3, 2018 at 8:31 PM, Caleb B burn...@gmail.com wrote:

https://github.com/bacu12/AccentLighting

I’m also in the Direct_Commands directory calling BlueSparkle.json using the command
bp -s --dim=100 BlueSparkle.json

On Saturday, February 3, 2018 at 1:18:58 PM UTC-5, Tom Swirly wrote:

Can you send me the github URL again? I know you sent it before, but I can’t seem to find it on this thread.

Based on your description, you can probably just replace “CustomAnimations.Fade” with “Fade” and it will all work.

Let me explain how the naming works: it works just like Python’s names do, only a bit more forgiving.

The dots (.) separate a name into parts:

  1. zero or more subdirectories
  2. one Python file
  3. an optional classname.

So if you have a file in your directory called Fade.py and it contains a class called Fast, then its name is Fade.Fast.

If you have submodules (here’s how to do that), then if you have a class Fade in file foo/bar/Baz.py its name is foo.bar.Baz.Fade.

Very often, you don’t have to put in the classname because bp is smart enough to figure it out:

  1. If the name of the file and the classname are “approximately the same” - so if the file is file fast_fade.py, then the class FastFade will match.
  2. If there is only one possible name in the file (i.e. your file contains exactly one Animation class at the top level)

On Sat, Feb 3, 2018 at 6:52 PM, Caleb B burn...@gmail.com wrote:

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.

I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.

Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp projects/christmas.json -vs -d base.json -d simpixel.json --dim=160

Run the project on the actual hardware

bp projects/christmas.json -vs -d base.json -d strips.json --dim=160

Writing a Project.

Here’s a document on how it’s done. Let us know how it goes!

Projects are particularly useful if you are building big things with lots of different animations.

You can for example prepare individual animations in individual project files, test each one individually, and then have one large project file including all the other small projects. It’s great if you like to tinker a lot and swap things in and out while you’re making your mind up…

On starting a git repo

Let me know if you want to start your own project, and I’ll walk you through that, or even write a document for it.

It’s a very small number of steps and easy, if you already know how.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/b82c4468-6a9e-45c9-a5be-8c97de728ef6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups

When I ran Upgrade it says already up-to-date.

···

On Saturday, February 3, 2018 at 7:20:14 PM UTC-5, Tom Swirly wrote:

Ah, sorry, you’re one release behind on bp.

pip install --upgrade bibliopixel

But also - let me make this small pull request too…

On Sun, Feb 4, 2018 at 1:08 AM, Caleb B burn...@gmail.com wrote:

Installed Numpy for python3. Now it runs. But returns this

Calebs-MacBook-Pro-2:AccentLighting caleb$ bp -s --dim=100 Direct_Commands/BlueSparkle.json

INFO - websocket - Starting WebSocket server thread…

[array([255, 255, 255]), array([252, 252, 252]), array([249, 249, 249]), array([247, 247, 247]), array([244, 244, 244]), array([242, 242, 242]), array([239, 239, 239]), array([237, 237, 237]), array([234, 234, 234]), array([232, 232, 232]), array([229, 229, 229]), array([226, 226, 226]), array([224, 224, 224]), array([221, 221, 221]), array([219, 219, 219]), array([216, 216, 216]), array([214, 214, 214]), array([211, 211, 211]), array([209, 209, 209]), array([206, 206, 206]), array([204, 204, 204]), array([201, 201, 201]), array([198, 198, 198]), array([196, 196, 196]), array([193, 193, 193]), array([191, 191, 191]), array([188, 188, 188]), array([186, 186, 186]), array([183, 183, 183]), array([181, 181, 181]), array([178, 178, 178]), array([175, 175, 175]), array([173, 173, 173]), array([170, 170, 170]), array([168, 168, 168]), array([165, 165, 165]), array([163, 163, 163]), array([160, 160, 160]), array([158, 158, 158]), array([155, 155, 155]), array([153, 153, 153]), array([150, 150, 150]), array([147, 147, 147]), array([145, 145, 145]), array([142, 142, 142]), array([140, 140, 140]), array([137, 137, 137]), array([135, 135, 135]), array([132, 132, 132]), array([130, 130, 130]), array([127, 127, 127]), array([124, 124, 124]), array([122, 122, 122]), array([119, 119, 119]), array([117, 117, 117]), array([114, 114, 114]), array([112, 112, 112]), array([109, 109, 109]), array([107, 107, 107]), array([104, 104, 104]), array([102, 102, 102]), array([99, 99, 99]), array([96, 96, 96]), array([94, 94, 94]), array([91, 91, 91]), array([89, 89, 89]), array([86, 86, 86]), array([84, 84, 84]), array([81, 81, 81]), array([79, 79, 79]), array([76, 76, 76]), array([73, 73, 73]), array([71, 71, 71]), array([68, 68, 68]), array([66, 66, 66]), array([63, 63, 63]), array([61, 61, 61]), array([58, 58, 58]), array([56, 56, 56]), array([53, 53, 53]), array([51, 51, 51]), array([48, 48, 48]), array([45, 45, 45]), array([43, 43, 43]), array([40, 40, 40]), array([38, 38, 38]), array([35, 35, 35]), array([33, 33, 33]), array([30, 30, 30]), array([28, 28, 28]), array([25, 25, 25]), array([22, 22, 22]), array([20, 20, 20]), array([17, 17, 17]), array([15, 15, 15]), array([12, 12, 12]), array([10, 10, 10]), array([7, 7, 7]), array([5, 5, 5]), array([2, 2, 2])]

ERROR: Base class step() called. This shouldn’t happen

On Saturday, February 3, 2018 at 7:05:20 PM UTC-5, Tom Swirly wrote:

Much progress.

We need to make sure there’s a better error message here that tells you what to do better,

You need to install numpy, because you’re using a numpy feature: from the command line":

pip install numpy

On Sun, Feb 4, 2018 at 12:36 AM, Caleb B burn...@gmail.com wrote:

Thanks for Simplifying things. I tried the new changes. It gave “No Module Named numpy” when running from the root directory AccentLighting

On Saturday, February 3, 2018 at 5:49:50 PM UTC-5, Tom Swirly wrote:

I just added comments to the pull request. It’s getting late here, so I might not be up for any reply.

If you like it, you can just pull it into your repository from the pull request (I suggest using the Rebase And Merge option), and then in your local repository, type

git pull

On Sat, Feb 3, 2018 at 11:38 PM, Tom Swirly t...@swirly.com wrote:

OK! This is very exciting to see someone using this stuff. :slight_smile:


First, by sitting in a subdirectory, you make it impossible for the program to automatically find the Python code (without adding a --path argument or a “path” section or a few other tricks).

For simplicity’s sake, I always do all my work from the root directory of the project. This is true for C++ or Java or pretty well everywhere else - you can always do it and if you always do it, you have one less thing to think about

So that means your command now should be:

bp -s --dim=100 Direct_Commands/BlueSparkle.json


As for the rest - I sent you a pull request with fixes! Ah, git.

https://github.com/bacu12/AccentLighting/pull/1 for anyone else reading.

I’ll now explain what each commit does as comments attached to the pull request… :smiley:

On Sat, Feb 3, 2018 at 8:31 PM, Caleb B burn...@gmail.com wrote:

https://github.com/bacu12/AccentLighting

I’m also in the Direct_Commands directory calling BlueSparkle.json using the command
bp -s --dim=100 BlueSparkle.json

On Saturday, February 3, 2018 at 1:18:58 PM UTC-5, Tom Swirly wrote:

Can you send me the github URL again? I know you sent it before, but I can’t seem to find it on this thread.

Based on your description, you can probably just replace “CustomAnimations.Fade” with “Fade” and it will all work.

Let me explain how the naming works: it works just like Python’s names do, only a bit more forgiving.

The dots (.) separate a name into parts:

  1. zero or more subdirectories
  2. one Python file
  3. an optional classname.

So if you have a file in your directory called Fade.py and it contains a class called Fast, then its name is Fade.Fast.

If you have submodules (here’s how to do that), then if you have a class Fade in file foo/bar/Baz.py its name is foo.bar.Baz.Fade.

Very often, you don’t have to put in the classname because bp is smart enough to figure it out:

  1. If the name of the file and the classname are “approximately the same” - so if the file is file fast_fade.py, then the class FastFade will match.
  2. If there is only one possible name in the file (i.e. your file contains exactly one Animation class at the top level)

On Sat, Feb 3, 2018 at 6:52 PM, Caleb B burn...@gmail.com wrote:

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.

I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.

Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actual version.

Read-world workflow teaser!

Here’s how I’m developing one project! https://github.com/rec/christmas_lights

I’m not going to explain everything below, just show you what I’m doing to give you a taste. You can find help on all of this through bp --help and bp run --help

My command lines looks like this:

Test the project on the desktop with the simulator

bp projects/christmas.json --verbose --simpixel --defaults base.json --defaults simpixel.json --dimensions=160

Using short flags:

bp <a href="https://githu

Timestamp: 2018-02-04T00:33:49

Python version: 3.6.4

Platform: Darwin-17.3.0-x86_64-i386-64bit

bp path: /Library/Frameworks/Python.framework/Versions/3.6/bin/bp

Library path: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bibliopixel

Dependencies:

bibliopixel: version 3.4.3, git commit: (none), git tag (none)

BiblioPixelAnimations: version (none), git commit: (none), git tag (none)

loady: version 1.7.8, git commit: (none), git tag (none)

Calebs-MacBook-Pro-2:AccentLighting caleb$

···

On Saturday, February 3, 2018 at 7:33:07 PM UTC-5, Tom Swirly wrote:

Hmm, that’s a head-scratcher and I’m a bit dubious (not that you’re doing anything wrong), so let’s try two things.

(I do test it on my machine each time, so I’m seeing stuff happen!

I’ll make another pull request, and while that happens, can you please type:

bp info

at the command line and tell me what it says?

On Sun, Feb 4, 2018 at 1:28 AM, Caleb B burn...@gmail.com wrote:

When I ran Upgrade it says already up-to-date.

On Saturday, February 3, 2018 at 7:20:14 PM UTC-5, Tom Swirly wrote:

Ah, sorry, you’re one release behind on bp.

pip install --upgrade bibliopixel

But also - let me make this small pull request too…

On Sun, Feb 4, 2018 at 1:08 AM, Caleb B burn...@gmail.com wrote:

Installed Numpy for python3. Now it runs. But returns this

Calebs-MacBook-Pro-2:AccentLighting caleb$ bp -s --dim=100 Direct_Commands/BlueSparkle.json

INFO - websocket - Starting WebSocket server thread…

[array([255, 255, 255]), array([252, 252, 252]), array([249, 249, 249]), array([247, 247, 247]), array([244, 244, 244]), array([242, 242, 242]), array([239, 239, 239]), array([237, 237, 237]), array([234, 234, 234]), array([232, 232, 232]), array([229, 229, 229]), array([226, 226, 226]), array([224, 224, 224]), array([221, 221, 221]), array([219, 219, 219]), array([216, 216, 216]), array([214, 214, 214]), array([211, 211, 211]), array([209, 209, 209]), array([206, 206, 206]), array([204, 204, 204]), array([201, 201, 201]), array([198, 198, 198]), array([196, 196, 196]), array([193, 193, 193]), array([191, 191, 191]), array([188, 188, 188]), array([186, 186, 186]), array([183, 183, 183]), array([181, 181, 181]), array([178, 178, 178]), array([175, 175, 175]), array([173, 173, 173]), array([170, 170, 170]), array([168, 168, 168]), array([165, 165, 165]), array([163, 163, 163]), array([160, 160, 160]), array([158, 158, 158]), array([155, 155, 155]), array([153, 153, 153]), array([150, 150, 150]), array([147, 147, 147]), array([145, 145, 145]), array([142, 142, 142]), array([140, 140, 140]), array([137, 137, 137]), array([135, 135, 135]), array([132, 132, 132]), array([130, 130, 130]), array([127, 127, 127]), array([124, 124, 124]), array([122, 122, 122]), array([119, 119, 119]), array([117, 117, 117]), array([114, 114, 114]), array([112, 112, 112]), array([109, 109, 109]), array([107, 107, 107]), array([104, 104, 104]), array([102, 102, 102]), array([99, 99, 99]), array([96, 96, 96]), array([94, 94, 94]), array([91, 91, 91]), array([89, 89, 89]), array([86, 86, 86]), array([84, 84, 84]), array([81, 81, 81]), array([79, 79, 79]), array([76, 76, 76]), array([73, 73, 73]), array([71, 71, 71]), array([68, 68, 68]), array([66, 66, 66]), array([63, 63, 63]), array([61, 61, 61]), array([58, 58, 58]), array([56, 56, 56]), array([53, 53, 53]), array([51, 51, 51]), array([48, 48, 48]), array([45, 45, 45]), array([43, 43, 43]), array([40, 40, 40]), array([38, 38, 38]), array([35, 35, 35]), array([33, 33, 33]), array([30, 30, 30]), array([28, 28, 28]), array([25, 25, 25]), array([22, 22, 22]), array([20, 20, 20]), array([17, 17, 17]), array([15, 15, 15]), array([12, 12, 12]), array([10, 10, 10]), array([7, 7, 7]), array([5, 5, 5]), array([2, 2, 2])]

ERROR: Base class step() called. This shouldn’t happen

On Saturday, February 3, 2018 at 7:05:20 PM UTC-5, Tom Swirly wrote:

Much progress.

We need to make sure there’s a better error message here that tells you what to do better,

You need to install numpy, because you’re using a numpy feature: from the command line":

pip install numpy

On Sun, Feb 4, 2018 at 12:36 AM, Caleb B burn...@gmail.com wrote:

Thanks for Simplifying things. I tried the new changes. It gave “No Module Named numpy” when running from the root directory AccentLighting

On Saturday, February 3, 2018 at 5:49:50 PM UTC-5, Tom Swirly wrote:

I just added comments to the pull request. It’s getting late here, so I might not be up for any reply.

If you like it, you can just pull it into your repository from the pull request (I suggest using the Rebase And Merge option), and then in your local repository, type

git pull

On Sat, Feb 3, 2018 at 11:38 PM, Tom Swirly t...@swirly.com wrote:

OK! This is very exciting to see someone using this stuff. :slight_smile:


First, by sitting in a subdirectory, you make it impossible for the program to automatically find the Python code (without adding a --path argument or a “path” section or a few other tricks).

For simplicity’s sake, I always do all my work from the root directory of the project. This is true for C++ or Java or pretty well everywhere else - you can always do it and if you always do it, you have one less thing to think about

So that means your command now should be:

bp -s --dim=100 Direct_Commands/BlueSparkle.json


As for the rest - I sent you a pull request with fixes! Ah, git.

https://github.com/bacu12/AccentLighting/pull/1 for anyone else reading.

I’ll now explain what each commit does as comments attached to the pull request… :smiley:

On Sat, Feb 3, 2018 at 8:31 PM, Caleb B burn...@gmail.com wrote:

https://github.com/bacu12/AccentLighting

I’m also in the Direct_Commands directory calling BlueSparkle.json using the command
bp -s --dim=100 BlueSparkle.json

On Saturday, February 3, 2018 at 1:18:58 PM UTC-5, Tom Swirly wrote:

Can you send me the github URL again? I know you sent it before, but I can’t seem to find it on this thread.

Based on your description, you can probably just replace “CustomAnimations.Fade” with “Fade” and it will all work.

Let me explain how the naming works: it works just like Python’s names do, only a bit more forgiving.

The dots (.) separate a name into parts:

  1. zero or more subdirectories
  2. one Python file
  3. an optional classname.

So if you have a file in your directory called Fade.py and it contains a class called Fast, then its name is Fade.Fast.

If you have submodules (here’s how to do that), then if you have a class Fade in file foo/bar/Baz.py its name is foo.bar.Baz.Fade.

Very often, you don’t have to put in the classname because bp is smart enough to figure it out:

  1. If the name of the file and the classname are “approximately the same” - so if the file is file fast_fade.py, then the class FastFade will match.
  2. If there is only one possible name in the file (i.e. your file contains exactly one Animation class at the top level)

On Sat, Feb 3, 2018 at 6:52 PM, Caleb B burn...@gmail.com wrote:

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.

I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.

Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json

Project files are just a data file in JSON - here’s an example: https://github.com/rec/christmas_lights/blob/master/projects/christmas.json

The idea is that you should be able to make a complete BP project without ever writing Python - or if you do need to write Python, you only have to write the Animation and then you can combine your animations with other people’s…

On Sun, Jan 28, 2018 at 8:41 PM, Caleb B burn...@gmail.com wrote:

Hello Tom,
Thanks for such an in-depth reply. I created a Github Repo. I am slowly adding to it. Here’s the link https://github.com/bacu12/AccentLighting

On Friday, January 26, 2018 at 7:32:13 AM UTC-5, Tom Swirly wrote:

Back on this. :smiley:

Lots of progress here I see. Some comments!

Headless operation.

Everything we do is geared towards headless operation - just ssh’ing into your server and running from a command line. I do all my RPi work that way .

The one thing that doesn’t work that way is of course SimPixel - the OpenGL simulator which runs in a browser.

Typically, I work on a desktop, and I do all my development using SimPixel, and then when the animation is working, I check out the project on the RPi, and use a different driver.

This has worked flawlessly - the simulation has always been the same as the actu

It now provides a white fade in simpixel. The next thing would be how do I start to play with the colors? Thanks so much for your help!! I enjoy learning more about how this functions

···

On Saturday, February 3, 2018 at 7:38:49 PM UTC-5, Tom Swirly wrote:

My pull request should fix your issue.

You seem to be one version behind on BP. Let me see if I screwed up the release process. Sorry for using a cutting edge feature. :smiley:

On Sun, Feb 4, 2018 at 1:34 AM, Caleb B burn...@gmail.com wrote:

Timestamp: 2018-02-04T00:33:49

Python version: 3.6.4

Platform: Darwin-17.3.0-x86_64-i386-64bit

bp path: /Library/Frameworks/Python.framework/Versions/3.6/bin/bp

Library path: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bibliopixel

Dependencies:

bibliopixel: version 3.4.3, git commit: (none), git tag (none)
BiblioPixelAnimations: version (none), git commit: (none), git tag (none)
loady: version 1.7.8, git commit: (none), git tag (none)

Calebs-MacBook-Pro-2:AccentLighting caleb$

On Saturday, February 3, 2018 at 7:33:07 PM UTC-5, Tom Swirly wrote:

Hmm, that’s a head-scratcher and I’m a bit dubious (not that you’re doing anything wrong), so let’s try two things.

(I do test it on my machine each time, so I’m seeing stuff happen!

I’ll make another pull request, and while that happens, can you please type:

bp info

at the command line and tell me what it says?

On Sun, Feb 4, 2018 at 1:28 AM, Caleb B burn...@gmail.com wrote:

When I ran Upgrade it says already up-to-date.

On Saturday, February 3, 2018 at 7:20:14 PM UTC-5, Tom Swirly wrote:

Ah, sorry, you’re one release behind on bp.

pip install --upgrade bibliopixel

But also - let me make this small pull request too…

On Sun, Feb 4, 2018 at 1:08 AM, Caleb B burn...@gmail.com wrote:

Installed Numpy for python3. Now it runs. But returns this

Calebs-MacBook-Pro-2:AccentLighting caleb$ bp -s --dim=100 Direct_Commands/BlueSparkle.json

INFO - websocket - Starting WebSocket server thread…

[array([255, 255, 255]), array([252, 252, 252]), array([249, 249, 249]), array([247, 247, 247]), array([244, 244, 244]), array([242, 242, 242]), array([239, 239, 239]), array([237, 237, 237]), array([234, 234, 234]), array([232, 232, 232]), array([229, 229, 229]), array([226, 226, 226]), array([224, 224, 224]), array([221, 221, 221]), array([219, 219, 219]), array([216, 216, 216]), array([214, 214, 214]), array([211, 211, 211]), array([209, 209, 209]), array([206, 206, 206]), array([204, 204, 204]), array([201, 201, 201]), array([198, 198, 198]), array([196, 196, 196]), array([193, 193, 193]), array([191, 191, 191]), array([188, 188, 188]), array([186, 186, 186]), array([183, 183, 183]), array([181, 181, 181]), array([178, 178, 178]), array([175, 175, 175]), array([173, 173, 173]), array([170, 170, 170]), array([168, 168, 168]), array([165, 165, 165]), array([163, 163, 163]), array([160, 160, 160]), array([158, 158, 158]), array([155, 155, 155]), array([153, 153, 153]), array([150, 150, 150]), array([147, 147, 147]), array([145, 145, 145]), array([142, 142, 142]), array([140, 140, 140]), array([137, 137, 137]), array([135, 135, 135]), array([132, 132, 132]), array([130, 130, 130]), array([127, 127, 127]), array([124, 124, 124]), array([122, 122, 122]), array([119, 119, 119]), array([117, 117, 117]), array([114, 114, 114]), array([112, 112, 112]), array([109, 109, 109]), array([107, 107, 107]), array([104, 104, 104]), array([102, 102, 102]), array([99, 99, 99]), array([96, 96, 96]), array([94, 94, 94]), array([91, 91, 91]), array([89, 89, 89]), array([86, 86, 86]), array([84, 84, 84]), array([81, 81, 81]), array([79, 79, 79]), array([76, 76, 76]), array([73, 73, 73]), array([71, 71, 71]), array([68, 68, 68]), array([66, 66, 66]), array([63, 63, 63]), array([61, 61, 61]), array([58, 58, 58]), array([56, 56, 56]), array([53, 53, 53]), array([51, 51, 51]), array([48, 48, 48]), array([45, 45, 45]), array([43, 43, 43]), array([40, 40, 40]), array([38, 38, 38]), array([35, 35, 35]), array([33, 33, 33]), array([30, 30, 30]), array([28, 28, 28]), array([25, 25, 25]), array([22, 22, 22]), array([20, 20, 20]), array([17, 17, 17]), array([15, 15, 15]), array([12, 12, 12]), array([10, 10, 10]), array([7, 7, 7]), array([5, 5, 5]), array([2, 2, 2])]

ERROR: Base class step() called. This shouldn’t happen

On Saturday, February 3, 2018 at 7:05:20 PM UTC-5, Tom Swirly wrote:

Much progress.

We need to make sure there’s a better error message here that tells you what to do better,

You need to install numpy, because you’re using a numpy feature: from the command line":

pip install numpy

On Sun, Feb 4, 2018 at 12:36 AM, Caleb B burn...@gmail.com wrote:

Thanks for Simplifying things. I tried the new changes. It gave “No Module Named numpy” when running from the root directory AccentLighting

On Saturday, February 3, 2018 at 5:49:50 PM UTC-5, Tom Swirly wrote:

I just added comments to the pull request. It’s getting late here, so I might not be up for any reply.

If you like it, you can just pull it into your repository from the pull request (I suggest using the Rebase And Merge option), and then in your local repository, type

git pull

On Sat, Feb 3, 2018 at 11:38 PM, Tom Swirly t...@swirly.com wrote:

OK! This is very exciting to see someone using this stuff. :slight_smile:


First, by sitting in a subdirectory, you make it impossible for the program to automatically find the Python code (without adding a --path argument or a “path” section or a few other tricks).

For simplicity’s sake, I always do all my work from the root directory of the project. This is true for C++ or Java or pretty well everywhere else - you can always do it and if you always do it, you have one less thing to think about

So that means your command now should be:

bp -s --dim=100 Direct_Commands/BlueSparkle.json


As for the rest - I sent you a pull request with fixes! Ah, git.

https://github.com/bacu12/AccentLighting/pull/1 for anyone else reading.

I’ll now explain what each commit does as comments attached to the pull request… :smiley:

On Sat, Feb 3, 2018 at 8:31 PM, Caleb B burn...@gmail.com wrote:

https://github.com/bacu12/AccentLighting

I’m also in the Direct_Commands directory calling BlueSparkle.json using the command
bp -s --dim=100 BlueSparkle.json

On Saturday, February 3, 2018 at 1:18:58 PM UTC-5, Tom Swirly wrote:

Can you send me the github URL again? I know you sent it before, but I can’t seem to find it on this thread.

Based on your description, you can probably just replace “CustomAnimations.Fade” with “Fade” and it will all work.

Let me explain how the naming works: it works just like Python’s names do, only a bit more forgiving.

The dots (.) separate a name into parts:

  1. zero or more subdirectories
  2. one Python file
  3. an optional classname.

So if you have a file in your directory called Fade.py and it contains a class called Fast, then its name is Fade.Fast.

If you have submodules (here’s how to do that), then if you have a class Fade in file foo/bar/Baz.py its name is foo.bar.Baz.Fade.

Very often, you don’t have to put in the classname because bp is smart enough to figure it out:

  1. If the name of the file and the classname are “approximately the same” - so if the file is file fast_fade.py, then the class FastFade will match.
  2. If there is only one possible name in the file (i.e. your file contains exactly one Animation class at the top level)

On Sat, Feb 3, 2018 at 6:52 PM, Caleb B burn...@gmail.com wrote:

Thanks for checking into it. I synced my local directory to the Github so that you can see it. I thought CustomAnimations would point to the folder that I have Fade.py stored in. Which is called Custom Animations. I have BlueSparkle in Direct_Commands. So No, to answer your question there isn’t a CustomAnimations.py in my directory. The only .py I have is Fade.py. Thanks

On Saturday, February 3, 2018 at 12:38:51 PM UTC-5, Tom Swirly wrote:

So I just tested that bug, and I couldn’t make it happen.

I’d love to track down your problem - let me know the answers to the previous questions…!

On Fri, Feb 2, 2018 at 9:17 PM, Tom Swirly t...@swirly.com wrote:

  1. Is there a file called CustomAnimations.py in your directory? If not, there’s the issue.
  1. If so, then this might be a reappearance of a bug I thought I fixed - try adding the -p . to your bp command line, like this:

bp -s --dim=100 --path=. BlueSparkle.json

Let me know if that second one works, if which case I’ll reopen that bug…

On Fri, Feb 2, 2018 at 8:46 PM, Caleb B burn...@gmail.com wrote:

Calebs-MacBook-Pro-2:Direct_Commands caleb$ bp -s --dim=100 BlueSparkle.json

ERROR - run - 1 project failed


ERROR - run - When reading file BlueSparkle.json:

{

"animation": {
    "animations": [
        "CustomAnimations.Fade"
    ],
    "typename": "sequence"
},
"driver": {
    "c_order": "RGB",
    "num": 150,
    "typename": "simpixel"
},
"layout": {
    "brightness": 256,
    "typename": "strip"
},
"run": {
    "fps": 30
}

}

No module named ‘CustomAnimations’

ERROR: Run aborted

I thought the CustomAnimations.Fade would point to the folder that the Fade.json file is in.

Thanks for looking at it

On Friday, February 2, 2018 at 2:36:49 PM UTC-5, Tom Swirly wrote:

On Fri, Feb 2, 2018 at 7:52 PM, Caleb B burn...@gmail.com wrote:

So you can technically create an animation in Python that has variables that point to the parameters in the project?

Absolutely! In fact, it happens automatically - parameters in the project correspond to constructors to the animation.

Also I was trying to point a json file at running a python animation, but it always says "No module named (name here).

How were you exactly trying to do that? Send me the command line and I’ll see!

On Thursday, February 1, 2018 at 1:24:09 PM UTC-5, Tom Swirly wrote:

Adam is interpreting “defines” somewhat differently.

Many animations have colors hardcoded into them - you can’t change that from a project.

But any construction parameter can be set that way, in a Project.

On Thu, Feb 1, 2018 at 7:21 PM, Adam Haile adamm...@gmail.com wrote:

Caleb, you are right, anything that defines an animation itself (colors, timing, pattern, etc) is in Python. There’s no way to specify that in the json files now. You can provide parameters to an animation and control it that way, but the python code for that animation must understand those parameters, of course.

On Thu, Feb 1, 2018 at 12:50 PM, Caleb B burn...@gmail.com wrote:

Ok so the projects are more specifically focused on creating new animations. Now what about changing the colors. As I don’t see anywhere it talks about specifying what colors are actually in the animation. Unless that part is contained in the actual python animation file.

I think the Midi and DMX would be a cool option to have, and would probably create a larger range of projects that AllPixel can be used. But I truly think the DIY side is more fun :slight_smile:

On Tuesday, January 30, 2018 at 6:34:29 AM UTC-5, Tom Swirly wrote:

Yes, the documentation on the Wiki, while (as far as we know) still completely accurate, reflects the older, more primitive :smiley: way of doing things.

The current document about projects https://github.com/ManiacalLabs/BiblioPixel/wiki/Projects

As usual, it is correct but incomplete. I have added a ton of new features since then - you can now switch between fast floating point/integer and Python lists, there are “aliases” that save a great deal of cruft, and you can load project files from inside project files.

There will be more documentation coming quite soon… :slight_smile:

Actually bp run --help has a lot of documentation too.

Now, how do you adjust the animations in the json file without writing a new animation in python code?

You can’t write an entirely new animation algorithm without Python!

But what you can do in a project is to customize and combine existing animations in all sorts of different ways. If you need to code, you only have to write an Animation and drop it in! And there are a lot of existing algorithms, and they have a lot of customization, and hopefully people will write new ones and put them on their github projects. And there are mixers, splitters, sequencers and all sorts of other things in the near pipeline.

Other advantages to projects

I develop animations on my Mac using SimPixel - and then I deploy onto a Raspberry Pi. The physical LEDs are actually on a different floor to me - I can’t see them from where I code.

I work on one document, which I preview on SimPixel, and then when it works, I check in that document. On the RPi, I just pull that document from git, and restart the program - and I see the same patterns I saw on SimPixel, on the LEDs.

I do this with two project default files that I call simpixel.json and strips.json!

so when I’m on the Mac I do

bp --default=simpixel.json projects/christmas.json

and on the Rpi

bp --default=strips.json projects/christmas.json

The near future

Projects, as they are now, offer great advantages over writing Python code, but still doesn’t really let you do anything completely new. (Well… my claim is that being able to make much more complex things in short data files you can divide up is actually a new step, but w/e.)

“In my copious spare time” I am almost finished working on what I believe is the final piece of the puzzle - a system for controlling animations from external signals, like a typing keyboard, a MIDI device, DMX, the web, twitter - what I am calling controllers. (My development branch is here if you like to see really bleeding edge…)

Most of this code is already checked in with tests but it will likely be some months before it’s fully ready and relentlessly tested.

“Controllers” will allow you to use any control source to control any animation with no Python, even existing ones that do not know anything about “controllers” at all.

I hope a lot of people might invest in a $50 MIDI fader box and go nuts. We have “Mixer” and “Feedback” animation collections that, I feel, will really come to life with this technique.

At some point, I’ll write a controllers recorder so you can perform and then store performances and then run them automatically.

The other advantage is for homebrew people. You can just write your own Controller in Python for your homebrewed sensors, incoming feed or whatever source you like, and then you can use it just like any other controller - or give it to people as a driver if they make a copy of your board or sensor or feed.

On Mon, Jan 29, 2018 at 7:42 PM, Caleb B burn...@gmail.com wrote:

Not a problem at all!! I have one of the demo animations working in simpixel. Now, how do you adjust the animations in the json file without writing a new animation in python code? As the wiki seems to be in Python from what I can tell.

Thanks

On Monday, January 29, 2018 at 3:47:58 AM UTC-5, Tom Swirly wrote:

Sorry for the delay, I’m in Köln, Germany!

On Sun, Jan 28, 2018 at 11:19 PM, Caleb B burn...@gmail.com wrote:

Ok, I’ll start looking at making a Json Project. What’s the purpose of referencing “typename”: “christmas_lights.Searchlights” ?

It’s a way of loading Python code or JSON code. In this case it’s Python. The code can come from your local machine or someone else’s github (or gitlab, etc)

It’s a way of splitting up projects so that you can design and test small parts, and then re-use them without change in a much larger project - also to use other people’s code or to share your own?

As that seems to reference another .json file you have. Also I installed biblipixel on my Mac.

How do I use SimPixel? As when I look at the wiki for it’s in Python from what I can tell.

I also run on a Mac so I made sure it was easy. The easiest way to use SimPixel is to not have any “drivers” section in your project at all, and then just run your project like this:

bp -s --dim=160

where -s is short for --simpixel and 160 is the number of LEDs you have. A web page will just pop up in your browser with the LEDs animated on it!

Thanks,

Caleb

On Sunday, January 28, 2018 at 4:56:19 PM UTC-5, Tom Swirly wrote:

Ah, so you have gotten past being able to check in and all, but your project file is in Python!

<a href=“https://github.com/bacu12/AccentLighting/blob/master/Direct_Commands/BlueSparkle.json” rel="nofo