// I need to

ModernizeUpgrade without breaking it RescueFix what someone else started Build NewTurn an idea into a product Reach More PeopleGet found, get used, include everyone

// Company

Case StudiesExpertiseAbout + CareersResourcesContact Book a call →

Re-animated

Friz, our animation framework for JUCE, is now a JUCE module with new parametric easing curves. What changed, plus download and license details.

Brett Porter Oct 1, 20203 min read

From the Art+Logic archive · written in 2020. The tools may have moved on; the thinking still holds.

Last year, I posted here about an animation control framework called ‘Friz’ that works within the JUCE Application Framework.

As I said in that post:

I sat down to sketch some things out and ended up making a small framework for generating dynamic data that can be used to animate pretty much any aspect of the user interface of a program written using the JUCE application framework (which I’ve written about here many times before), and has the goals of being:

  • Lightweight, if there aren’t any animations in progress, there’s no runtime overhead.
  • Flexible, it’s easy to add new types of animation curves if you want to, or to chain multiple curves together into a more complex sequence.
  • Decoupled, it doesn’t need or want to know anything about your application. When your code creates an animation effect, you pass it a pair of std::function objects; one to handle updates for each frame, and another one to handle the completion of the effect.
  • Modern, written using current C++ techniques (defined for our purposes as C++11 and later). I spent some time away from C++ and have come back to find the language has undergone some seroius changes that require me to consciously update my habits, making me feel like the programmer version of SNL’s Unfrozen Caveman Lawyer.

As the code began to take shape, I decided to name it after the great Warner Bros. animator/director Friz Freling. I would like to have called it ‘Chuck’ after his colleague Chuck Jones, but “ChucK” already means something else in the electronic music software world.

I found the time this past weekend to update the Friz code with two things that I’ve had on my list for a long time:

JUCE Module

The library is now packaged as a JUCE module, so it’s straightforward to include in a JUCE project without needing to manually copy files around. In reality, I should have done this from day one (and now that I understand how trivial it is to work with JUCE modules, that’s how I’ll approach anything like this in the future).

To use friz as a module, get it from the GitHub repo (see below) and then use the Projucer to add it to your project from that directory:

projucer view

Once you’ve done that, you can just add

#include "friz.h"

…and start using it as described in my earlier post.

New ‘parametric’ easing curves

Shortly after releasing the original version of this last year, I stumbled on an excellent site that described itself as an “Easing Curve Cheat Sheet” that shows examples of a whole bunch of curves that are commonly found in the wild, libraries and frameworks like jQuery, Cinder, and Flutter all support a set of curves that all point back to functions defined by Robert Penner, whose site you should check out.

The new Parametric class may be created to implement any of those Penner curves, or you can use it to follow any curve that you design, by passing in a function (whether a std::function, lambda, or plain old C function) that accepts a single float parameter in the range [0..1] and returns a float that is typically but not necessarily also in the [0..1] range. The animation framework will interpolate that output value between the start/end values used in your animation. Since these curves may have overshoot on either end (see for example, the easeInOutElastic curve, which has fairly complex under- and overshoot on both ends of the curve), the code that handles your animation must work correctly when passed values outside of your start/stop values (where only you can define what ‘correctly’ means other than ‘don’t crash’).

Download/Licence/etc.

You can get the library at https://github.com/bgporter/animator, and it’s MIT licensed. Open source, closed source, it’s all fine by me as long as you only use it for good and not evil.

Go make cool stuff.

keep going

More to explore in Reach More People.

All Reach More People resources →
let's talk

Got a problem like this one?

Tell us what's stuck. A real person replies within one business day.

Talk to our team →

Talk to people who know software, not a sales script.

Your first call is with Aja, our VP of Sales. He'll help make sure you're solving the right problem. Here's what you'll cover together:

  1. What you're trying to accomplish

    The business goal first, then the technology.

  2. Possible approaches

    And the tradeoffs of each, in plain language.

  3. Risks you may not have considered

    Technical and business, before they cost you.

  4. Whether AI changes the math

    What's practical, and what's just hype for your project.

  5. Sensible next steps

    Even if the right next step is not us.

book-a-call.ics

Loading the scheduler…

Open the booking page →

Some problems are easier to explain in writing. Send us a few lines about what you're working on, and we'll reply within one business day. Helpful to include:

  1. What the software does, or should do
  2. What's stuck, or what's worrying you
  3. Any deadline or budget you have in mind
note.md

Loading the form…