Skip to main content

Flitter is a functional programming language and declarative system for describing 2D and 3D visuals

Project description

Screenshot from a Flitter program showing colourful distorted ellipse shapes with trails moving outwards from the centre of the screen.

Flitter

CI lint CI test docs

Flitter is a functional programming language and declarative system for describing 2D and 3D visuals. The language is designed to encourage an iterative, explorative, play-based approach to constructing visuals.

The engine is able to live reload all code and assets (including shaders, images, videos, models, etc.) while retaining the current system state - thus supporting live-coding. It also has support for interacting with running programs via MIDI surfaces.

Flitter is implemented in a mix of Python and Cython and requires at least OpenGL 3.3 (Core Profile) or OpenGL ES 3.0. At least Python 3.10 is also required as the code uses match/case syntax.

Flitter is designed for expressivity and ease of engine development over raw performance, but is fast enough to be able to do interesting things.

The engine that runs the language is capable of:

  • 2D drawing (loosely based on an HTML canvas/SVG model)
  • 3D rendering, including:
    • primitive box, sphere, cylinder and cone shapes
    • external triangular mesh models in a variety of formats including OBJ and STL
    • texture mapping, including with the output of other visual units (e.g., a drawing canvas or a video)
    • planar slicing and union, difference and intersection of solid models
    • ambient, directional, point/sphere, line/capsule and spotlight sources (currently shadowless)
    • Physically-based rendering material shading, emissive objects and transparency
    • multiple cameras with individual control over location, field-of-view, near and far clip planes, render buffer size, color depth, MSAA samples, perspective/orthographic projection, fog, conversion to monochrome and colour tinting
  • simulating physical particle systems, including spring/rod/rubber-band constraints, gravity, electrostatic charge, adhesion, buoyancy, inertia, drag, barriers and particle collisions
  • playing videos at arbitrary speeds, including in reverse (although video will stutter if it makes extensive use of P-frames)
  • running GLSL shaders as stacked image filters and generators, with per-frame control of arbitrary uniforms
  • compositing all of the above and rendering to one or more windows
  • saving rendered output to image and video files (including lockstep frame-by-frame video output suitable for producing perfect loops and direct generation of animated GIFs)
  • driving arbitrary DMX fixtures via a USB DMX interface (currently via an Entec-compatible interface or my own crazy hand-built devices)
  • driving a LaserCube plugged in over USB (other lasers probably easy-ish to support)
  • taking live inputs from Ableton Push 2 or Behringer X-Touch mini MIDI surfaces (other controllers relatively easy to add)

Installation

Flitter can be installed from the flitter-lang PyPI package with:

pip3 install flitter-lang

and then run as:

flitter path/to/some/flitter/script.fl

More details can be found in the installation documentation.

Documentation

The documentation is available on the Flitter Read the Docs pages.

There are a few quick examples in the main repository. However, there is also a separate repo containing many more interesting examples that are worth checking out.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flitter-lang-1.0.0b11.tar.gz (139.4 kB view hashes)

Uploaded Source

Built Distributions

flitter_lang-1.0.0b11-cp312-cp312-win_amd64.whl (1.7 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

flitter_lang-1.0.0b11-cp312-cp312-musllinux_1_1_x86_64.whl (12.2 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

flitter_lang-1.0.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

flitter_lang-1.0.0b11-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

flitter_lang-1.0.0b11-cp312-cp312-macosx_10_9_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

flitter_lang-1.0.0b11-cp311-cp311-win_amd64.whl (1.7 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

flitter_lang-1.0.0b11-cp311-cp311-musllinux_1_1_x86_64.whl (12.5 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

flitter_lang-1.0.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

flitter_lang-1.0.0b11-cp311-cp311-macosx_11_0_arm64.whl (1.8 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

flitter_lang-1.0.0b11-cp311-cp311-macosx_10_9_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

flitter_lang-1.0.0b11-cp310-cp310-win_amd64.whl (1.7 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

flitter_lang-1.0.0b11-cp310-cp310-musllinux_1_1_x86_64.whl (11.4 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

flitter_lang-1.0.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

flitter_lang-1.0.0b11-cp310-cp310-macosx_11_0_arm64.whl (1.8 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

flitter_lang-1.0.0b11-cp310-cp310-macosx_10_9_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page