GithubHelp home page GithubHelp logo

hear-and-now's Introduction

hear&now

hear&now is a lightweight interactive audio mixer library for cool dudes

caveat emptor

hear&now is in early development, and should not be considered thread-safe, work-safe, or dishwasher-safe. it is being developed by a couple of dudes who haven't really developed a ton of audio software before. the terms of the license for hear&now explicitly preclude you from using it to throw a rave at a nuclear power plant or hospital.

architecture

disclaimers

we've only tested the following set of native audio formats:

  • 44100Hz / 8-bit / mono

it's a pretty small set. where you read "native X", read "native X in principle, but really it has to be one of those formats I saw earlier."

Audio

the Audio object is an minimal PCM audio device. it plays audio at the sample rate and bit depth you request when opening it, and will not hold your hand by resampling or mixing down multiple channels to one.

the programming model for Audio is simple: you pass audio in on your own thread when you deem it necessary; Audio will give you a callback whenever a buffer is finished so you can free it or keep track of how much audio Audio still has ready or whatever your consumer needs to do.

Mixer

the Mixer object is a simple audio mixer. its input is an arbitrary number of floating-point (0-1.0) audio streams with the native sample rate and number of channels. it converts these audio streams to the native bit depth and gives the mixed stream to Audio.

the programming model for Mixer is based around callbacks: audio generators register a generator callback with Mixer, which Mixer then calls whenever it feels that it needs to go to the audio store to get some more audio.

automation, Cmds, and CmdQueues

audio generators (or, really, pretty much anything) can be controlled automatically by Cmd objects. they create CmdQueues and expose them to their controllers. the owner of the CmdQueue dequeues Cmds and handles them in a generator-specific fashion.

Sequencer

the Sequencer object is a minimal audio sequencer. it lies outside of the Audio/Mixer/generator stack. the Sequencer deals with musical time -- that is, time as governed by the tempo of a performance, rather than the audio device's sampling rate -- and provides you the ability to schedule automation commands based on musical time measurements.

the atomic time unit of the Sequencer is the "jiffy", and the mapping from samples onto jiffies is governed by the Sequencer's "jiffy tempo". (it's intended that a jiffy be equal to the length of a 256th note; under this assumption, jiffy tempo is approximately equal to real tempo in 4/4 time.)

the primary metaphor of the Sequencer is the "trigger", a Cmd saved up to send to a CmdQueue at a given future time. just before the appropriate sample is rendered, the Sequencer populates fields in the Cmd telling the generator the exact sample to begin executing the Cmd at.

hear-and-now's People

Contributors

vogon avatar

Watchers

Jensen avatar James Cloos 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.