Documentation, version 4, etc

Hi all –

I discovered the allpixel and bibliopixel last year when I was programming some chandeliers for a Burning Man project – ran into some issues as I’m a ruby and JS dev by day and learning my way around the python2 and python3 ecosystem was a bit daunting at first. Got it sorted though :slight_smile: Didn’t use project files much, just programmed various animations by hand and actually triggered them from a ruby program based on various sensors, etc.

Did run into issues last year with documentation being pretty sparse or outdated with the switch from 2 to 3, and now it looks like there is so much development going on that the bibliopixel 3 documentation is becoming outdated in some places. I know you’re working towards bibliopixel 4, and I know open source project deadlines are /really/ hard to predict, but didn’t know if you had any idea when it was going to be out?

In the meantime, I was wondering if there was a good page anywhere that basically showed every single parameter that can go into a JSON project file, and what values it can take, and what the defaults are. For instance, how do I pass in colors as arguments to an animation I wrote? Can you run different animations at different FPS settings? Can you use a runner file that uses various interrupts to load different animations, etc. What does the “run” key do? What about the “typename” key?

I know documentation is hard, especially when you are writing lots of new exciting code, not upset at all. I can work things out as I go, but wondering what is out there?

Also sorry about the tagging, for some reason google won’t accept bibliopixel as a tag whether I click on it or enter it manually.

Well, I’ve figured out answers to /most/ of my questions just by poking around in code and examples, I still wonder if it would be helpful to have a canonical project file somewhere that shows most everything.

I even got a midi controller working with the new control functionality triggering different animations.

I’m wondering now if there is a way to use a controller not to trigger the router (which is good for a few messages), but to pass in continuous values to a running animation. For example, allowing a CC to adjust the color of an entire animation. Obviously I could write the actual animation grabbing the midi value in the step function and using that, and I’m playing with that now, but it seems like you are moving towards doing almost all “composition” in the JSON files.

Also, with the midi value, I’m wondering why we have to match on “10/127” instead of just “10”?

Oh, and I see there is some sort of pre_router functionality that could pipe the messages to standard out somehow, but not sure quite how (at the moment I’m just running bibliopixel monitor midi in another terminal window).

Sorry for python newbishness, code is a little hard for me to grok at times due to different types of objects and initialization than I’m used to

Cheers!

So close now!

So first off, if I use normalizers: None, I get the following error

File “/Users/estiens/projects/oracle_lights/lib/python3.6/site-packages/bibliopixel/control/extractor.py”, line 72, in normal
normalizer = self.normalizers.get(key, lambda x: x)
AttributeError: ‘str’ object has no attribute ‘get’

``

I assume because it is passing “None” as a string and not parsing it

If I don’t use normalizers: none and I use

controls:
typename: midi
verbose: true
extractor:
accept:
type: control_change
channel: 8
omit:
- port
- channel
- velocity
routing:
‘77’: animation._c_num

``

(Right now I am just printing out c_num in the step function to see what is going on, will transform it to a color value eventually)
I still get

OrderedDict([(‘control’, 77), (‘value’, Fraction(89, 127))])
INFO - control - Routed message 77.89/127 (OrderedDict([(‘value’, Fraction(89, 127))])) to <bibliopixel.control.action.ActionList object at 0x105869358>
89/127
ERROR: list indices must be integers or slices, not Fraction

``

This is why I was wondering about the normalization – it seems value should be normalized here to 89 not `Fraction(89, 127)

`

Also, I’m actually in Minneapolis, MN USA, but my wife lived in Den Haag for a few years :slight_smile:

One last note –

If I edit the bibliopixel library directly and remove the line

‘value’: lambda x: fractions.Fraction(x) / 127

from the normalizers, I don’t get an error about passing a fraction, and I get the integer value of the CC message in my animation as I would expect!

Tom –

Donked around today and coverted the Fireflies demo to be MIDI controllable

You can control the color with either one slider or three knobs, the color level, the count and width, as well as slow down the animation

Little simpixel movie in the repo, unfortunately don’t have a camera to show the midi controller in the screen!

Thanks for all the work on this. Took some experimenting, but once I figured it out it was really easy!

Next up, building a basic controller for sound input (either by mic or by line) so you can react to volume and frequency.

https://github.com/estiens/bibliopixel_projects/tree/master/midi/fireflies

Normalization

Normalized signals range from 0 to 1 if they are “unipolar” (never negative, like velocity and CC) and from -1 to 1 if they are bipolar (like pitch bend).

A continuous controller is unipolar so its values range from 0 / 127 to 127 / 127 = 1. So Fraction(89, 127) looks like the right value. You shouldn’t be using this as a slice. :smiley:

Turning off normalization should work to get the raw integer value though.

Fireflies

I could review your code for that if you liked. :smiley:

Sure, I mean you don’t need to do it for me, it works which is always the most important thing. :slight_smile: But if you want to look at it and suggest other ways things could be accomplished or if it was what you had in mind for the use of controls, that would be great. Having tangible alternatives or better alternatives to the way I’m currently doing something would be great for learning more about how bibliopixel works now and in the future. Like for instance, not sure what is meant by not using something as a slice – how to pass it in with the normalizer function on without getting the error about passing a fraction.

What are you going to use for sound input levels? I’ve been wanting to do a frequency level sensitive thing for a graphic EQ.

Not totally sure yet because not super familiar with the python ecosystem, but I think pyaudio will work for opening up a stream of audio data, feeding it in chunks to some fft functions or similar in numpy, and then outputting values every x amount of time (250 ms?) of integers that correspond to bass/mids/treble/loudness that could be used to control parameters in an animation. Prob will start out simple and then allow the ability to customize things like filter cutoffs, choose different inputs, etc.

For me I think the hard part will be looking into more about how python does threading, the stream() function, etc, but it looks like there are examples to work from a bibliopiel itself looks like it does a good job of managing a lot of that stuff.

Eric,

This has worked well for capturing audio using pyaudio: https://github.com/ManiacalLabs/BiblioPixelAnimations/blob/master/BiblioPixelAnimations/matrix/spectrum/system_eq.py#L45

···

On Sat, May 26, 2018 at 3:04 PM Eric Stiens estiens@gmail.com wrote:

Normalization

Normalized signals range from 0 to 1 if they are “unipolar” (never negative, like velocity and CC) and from -1 to 1 if they are bipolar (like pitch bend).

A continuous controller is unipolar so its values range from 0 / 127 to 127 / 127 = 1. So Fraction(89, 127) looks like the right value. You shouldn’t be using this as a slice. :smiley:

Turning off normalization should work to get the raw integer value though.

Fireflies

I could review your code for that if you liked. :smiley:

Sure, I mean you don’t need to do it for me, it works which is always the most important thing. :slight_smile: But if you want to look at it and suggest other ways things could be accomplished or if it was what you had in mind for the use of controls, that would be great. Having tangible alternatives or better alternatives to the way I’m currently doing something would be great for learning more about how bibliopixel works now and in the future. Like for instance, not sure what is meant by not using something as a slice – how to pass it in with the normalizer function on without getting the error about passing a fraction.

What are you going to use for sound input levels? I’ve been wanting to do a frequency level sensitive thing for a graphic EQ.

Not totally sure yet because not super familiar with the python ecosystem, but I think pyaudio will work for opening up a stream of audio data, feeding it in chunks to some fft functions or similar in numpy, and then outputting values every x amount of time (250 ms?) of integers that correspond to bass/mids/treble/loudness that could be used to control parameters in an animation. Prob will start out simple and then allow the ability to customize things like filter cutoffs, choose different inputs, etc.

For me I think the hard part will be looking into more about how python does threading, the stream() function, etc, but it looks like there are examples to work from a bibliopiel itself looks like it does a good job of managing a lot of that stuff.

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/c6733a69-4205-4062-a00c-a0a7c80fb3d7%40googlegroups.com.

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