GithubHelp home page GithubHelp logo

emptyflash / bitfolly Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 2.0 2.91 MB

Bytebeat+bitfield inspired environment for livecoding visual art

Home Page: https://emptyfla.sh/bitfolly

License: Other

JavaScript 99.96% HTML 0.04%
bitfield bytebeat generative-art livecoding visual-art

bitfolly's Introduction

bitfolly

Because these bits are acting unwise.

Bitfolly is a livecoding tool for creating visuals using bitwise operations, inspired by bytebeats and bitfield patterns.

Usage and examples

Bitfolly programs are essentially a javascript shader that is compiled to run on the GPU by gpu.js

Each program is run for every pixel on the screen. The coordinates for the current pixel can be accessed via the x and y variables.

Additionally, there is a t variable that is constantly increasing, which can be used to animated your creations.

Here's an example of a bitfolly program:

(x&y^t/20)%100

To run a program in the editor, press "Ctrl-Enter" or click the ▶️ icon in the top right corner.

Most javascript expressions can be used, for example, the javascript ternary operator:

(t%1000>500?x|y:x^y)%255

Or javascript Math functions:

(x^y&Math.sin(t/300)*255)%255

Additional features include:

  • audioreactivity via the a array, at audio-based incrementor
  • feedback via the previous frame p texture.
let p0 = p[x&y][y^x]
p0 *= 255
c[0] = Math.tan(x^y^at/3) + 0.96 * p0[0]
c[1] = Math.tan(x^y^at/5) + 0.96 * p0[1]
c[2] = Math.tan(x^y^at/7) + 0.96 * p0[2]

Vim mode can also be enabled by adding the v=1 query param to the URL

Using in Hydra

Import the global bundle and create a bitfolly object. To get the audio reactive variables you need to pass it a function that returns Hydra's a.fft array. Then just call the update function and initialize a Hydra source with bitfolly's canvas.

await import("https://emptyfla.sh/bitfolly/bundle-global.js")
window.bitfolly = window.bitfolly || new Bitfolly(() => a.fft)
bitfolly.update("(x&y^t/30)%255")
s0.init({
    src: bitfolly.canvas
})
src(o0)
    .diff(osc(1, 1, 1)
        .modulate(src(s0), 10), .1)
    .modulateScale(src(s0), [.01, -.01].fast(.3).smooth())
    .modulateRotate(src(s0), [.02,-.02].fast(.7).smooth())
    .out()

bitfolly's People

Contributors

emptyflash avatar iainnash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

iainnash 5l1v3r1

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.