Git Product home page Git Product logo

pixelmaestro's Introduction

PixelMaestro

latest tag license

PixelMaestro is a graphics library for LED displays. It lets you create dynamic, colorful 2D animations and patterns on any size display. Originally designed for Arduinos, PixelMaestro can be used to drive any kind of LED on any device.

Features

  • True (24-bit) color depth
  • Support for up to 256 independent, layered drawing surfaces
  • Over 10 unique, customizable animations with support for different orientations, speeds, and color schemes
  • Powerful raster graphics editing tools with support for still or animated images
  • Intuitive scheduling system for creating time-based animations and transitions
  • Lightweight communications protocol for controlling devices over USB, Bluetooth, or other serial channel
  • Microcontroller friendly: Use with Arduino, Raspberry Pi, ESP32, and other devices

Getting Started

Click here for a tutorial on using PixelMaestro, or read the documentation.

If you want to run PixelMaestro on an Arduino, you can do so via the Arduino IDE or PlatformIO. For detailed instructions, see the examples folder.

Companion App

PixelMaestro has a companion desktop application called PixelMaestro Studio. PixelMaestro Studio lets you build custom animations, save and share configurations, control devices over USB, and more. Click here to learn more about PixelMaestro Studio.

Running Tests

PixelMaestro uses the Catch framework to run tests. Compiling the test suite requires CMake 3.6.2 or higher.

  1. Navigate to the tests folder.
  2. Run cmake .
  3. Navigate to the bin folder and run PixelMaestro_Test.

pixelmaestro's People

Contributors

8bitbuddhist avatar etmeister avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pixelmaestro's Issues

Demo video

Hi
is there a demo video available to see all the effects, or at least some of them?

Feature: Visualizer Animation

Animation that renders a music visualizer-like output to the Section. This doesn't do any direct audio processing, but instead takes output from a process such as a fast Fourier transform and converts it into a byte array.

Variables:

  • samples: double array containing output from FFT function
  • sample_size: the number of samples in the FFT array
  • out: byte array for output of conversion from samples

When calling the set_input() function, the out array is initialized to the number of samples (only if it's uninitialized or different from the size of the samples array). It then converts the values from samples into bytes, which it stores in out.

When map() is called, the contents of out are scaled and set in map_. map() is called whenever set_input() is called or the grid resizes.

Users are expected to run set_input() as often as their FFT function can generate output. Users can also use any input values they want - it doesn't have to be output from an FFT function or even related to audio.

How to create custom animations

I want to create custom animations and I can not store all frames in canvases, because the animations are dynamic and cannot be precomputed and stored or have to many frames.

Canvas Overhaul

To reduce complexity and sketch size, the three Canvas types will be re-consolidated into a single type. This "new" Canvas type will act like a PaletteCanvas, but will have the ability to display the underlying Animation like an AnimationCanvas. This is done by drawing index 255, which is reserved for transparency.

Occlusion culling

When Canvas is enabled, avoid rendering content behind the Canvas.

Feature: Transitions

Timer-based component that gradually changes any numeric variable from a start value to a target value. Gets initialized when calling any of the set() functions that changes a numeric value.

Required varibles:

  • var: a reference to the variable that will be changed. To start, this is restricted to certain ints.
  • value: the value that the variable will transition to
  • interval: the amount of time until the transition is finished

When calling a set() function with these arguments, a new Transition object is allocated. It calculates the difference between the variable's current value and target value using the Maestro's refresh interval and stores it as step_. Transitions use internal Timers to store the interval. On update(), step_ gets added to var until the Timer fires. Once the Transition ends, its object gets deleted.

Example: cutting a Maestro's brightness in half over 5 seconds:

# main.cpp
int brightness = 127;
int interval = 5000;
maestro.set_brightness(brightness, interval);

# transition.cpp
void Transition::Transition(...) {
	this->step_ = (value - *var) / (float)maestro_->get_refresh->get_interval();
	this->target_value_ = value;
	this->timer_ = new Timer(interval);
}

bool Transition::update(const uint32_t& current_time) {
	if (this->timer_->update(current_time)) {
		*var = this->target_value_;
		return true;
	}
	else {
		*var += this->step_;
		return false;
	}
}

# maestro.cpp
void Maestro::set_brightness(uint8_t target_brightness, uint16_t interval) {
	this->transition_ = new Transition(&this->brightness_, target_brightness, interval);
}

void Maestro::update(const uint32_t& current_time, bool force) {
	...
	if (this->transition_->update()) {
		delete this->transition_;
	}
	...
}

Build PixelMaestro

Hello there !

I am trying to build PixelMaestro and use it in a C++ project. Is this possible ?

More specifically I want to use https://github.com/shaduzlabs/cabl in combination with PixelMaestro to control the LEDs on a MaschineJAM.

Thank you for this awesome library !!!

Memory leak in mapped animations

Animations using the mappedanimation function such as Plasma, Fire, etc, do not appear to be properly cleaned up when set_animation is called to replace them. This occurs regardless of the state of the preserve_settings flag. Other animations do not appear to have this issue.

The following is from a run calling set_animation(AnimationType::Plasma, true) once every second:

1015 freeMemory()=508
1046 freeMemory()=456
...
2027 freeMemory()=456
2061 freeMemory()=404
...
3041 freeMemory()=404
3077 freeMemory()=352

Add PaletteCanvas

PaletteCanvases draw shapes using a palette of colors, similar to Animations. Users define a palette using PaletteCanvas::set_colors() and select a color by the index of the color they want to draw with. The result is similar to a ColorCanvas, but uses far less memory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.