Git Product home page Git Product logo

liv3c0der's Introduction

liv3c0der

An experiment to try to build an audiovisual live coding environment running in the browser

Since this was built for the very specific purpose of jamming with other musicians, it is a very opinionated tool at the moment. I'm not sure what it will be evolve into, but here's what it is right now:

  • A simple, code based pattern sequencer that has up to 16 steps, shuffle and allows you to express the beat in either declarate
  • A set of tools, currently crudely exposed through a global object, that allow for sample playing, synthesizer type stuff and a fixed set of predefined effects
  • A fullscreen, initialized 2D canvas that can be drawn on in requestAnimationFrame speed.
  • Automatic collection of Samples (for Audio) and Images (for canvas)

Documentation is sparse, please look at the examples.

Currently, the live code contains two methods:

draw(canvasContext,state, analyzerData)

  • draw will be called within the canvas loop that is based on requestAnimationFrame
  • canvasContext is the 2d context of the full screen canvas element (only 2d is supported ATM)
  • state is a magical state object you can use to store data that should persist between loop runs
    • state has an init-function that let's you init values if they are not yes existent.
  • analyserData is a 16 element float32array of fft data from the sound source. do your thang.

pattern(context, outlet, start_times, step_time, state, data)

  • pattern will be called once every time the pattern loops. The pattern is (currently) a 16 step
  • pattern with every step matching a 1/16 note.
  • context is the audioContext
  • outlet is the audio destination your webaudio objects should ultimately connect to
  • start_times is an array of start times for the notes in the pattern
  • step_time is the length of a single step
  • state is the beforementioned state object (note that the canvas loop and the pattern loop indeed share this object)
  • data is unused and will most probably contain prefabbed samples etc.

Sound Tools

  • LC.NOTES contains the MIDI array of note frequencies, so LC.NOTES[0] gives you the lowest C

  • LC.LEnv is an Envelope generator created with linearRamps.

    • Signature is (param,time,length,min, max,attack,decay,sustain,release)
    • a,d,r are expressed as fractions of length
    • sustain as fraction of max
  • LC.S is an object containing all loaded samples. The list is currently hardcoded in livecoder.coffee

  • All samples willl be loaded automatically and can be played as soon as they are completely decoded.

  • LC.S. is a sample object that has two public methods

    • play(outlet, time, length, rate)
    • playGrain(outlet, time, offset, length, rate)
  • LC.DelayLine - a configurable delay line that can be used as an output

    • DelayLine.delayTime
    • DelayLine.filterFrequency
    • DelayLine.feedback
  • LC.ReverbLine - a configurable reverb line that can be used as an output

    • ReverbLine.mix - mix ratio between original and reverb signal.
  • LC.BassSynth (will be renamed!) is a dual oscillator synth with full ENVs for amp and filter

  • LC.AcidSynth is a single osc synth with a double filter for enhanced squeakability. It has a more simple envelope.

  • Tuna. See here

Canvas Tools

  • LC.I. is an Image() instance that can be used for context.drawImage

Planned canvas tools

  • color helpers to make color constructions more easy.

liv3c0der's People

Contributors

halfbyte avatar

Watchers

 avatar  avatar

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.