Giter VIP home page Giter VIP logo

qwak's Introduction

qwak

Definition and parser for qwak, a simple and expressive minimal ascii dialect for programming step-based web audio event sequences

Join the chat at https://gitter.im/adamrenklint/qwak npm version GitHub stars Travis CI status npm dependencies Code Climate score Code Climate coverage

Made by Adam Renklint, Berlin august 2015. Inspired by Typedrummer by Kyle Stetz.

Concepts

  • Timing is step based, where a default step is two 1/16th beats, i.e. 48 ticks
  • A pattern consists of several layered sequences
  • A sequence maps to a kit by id and contains an array of notes
  • A note contains instructions for how to play back a sample

Syntax

/86     define bpm, 86 by default (optional)
/1-9=   define kit id for sequence

## step triggers
a-z     trigger key, oneshot
A-Z     trigger key, note on until next
_       skip step, not blocking "note on" triggers
:       mute step, blocking "note on" triggers
!       repeat last note, including transient modifiers
?       repeat last note, decrease volume 25% (i.e. manual echo)
&       layer next with previous note, i.e. jump back to previous position
*       jump to start on next step and repeat sequence
;       jump to start on next bar and repeat sequence

## persistent modifiers
(       increase step resolution
)       decrease step resolution
[       start block, nestable, applies transient modifiers to block
]       end block
,       start triplet resolution (48 > 32)
.       stop triplet resolution (32 > 48)

## transient modifiers
+       pitch up next note (1/12th)
-       pitch down next note
%       lower volume 20% for next note
^       raise volume 20% for next note
{       pan next note to 25% left
}       pan next note to 25% right
<       pull next note cursor 1/12th step back
>       push next note cursor 1/12th step forward
~       shift sample starting point 0.1 seconds
'       fade in next note attack in 0.1 seconds
`       fade out next note release in 0.1 seconds
≈       reverse next note or group
∞       loop the first 0.1 seconds of sample

## transient modifier parameters
+52     pitch up next note (52/100th)
-18     pitch down next note (18/100th)
%33     lower volume 33% for next note
^10     raise volume 10% for next note
{40     pan next note to 40% left
}60     pan next note to 60% right
<10     pull next note cursor 10 ticks back
>8      push next note cursor 8 ticks forward
~350    shift sample starting point 0.35 seconds
'250    fade in next note attack in 0.25 seconds
`800    fade out next note release in 0.8 seconds
∞250    loop the first 0.25 seconds of sample
§333    set next note sample maxlength to 0.333 seconds

Install

$ npm install --save qwak

Usage

var qwak = require('qwak');
var pattern = qwak.parse('/qwak');

qwak.parse(raw:string) -> pattern

Parses a raw qwak string into a qwak pattern, an object with the attributes tempo:number, bars:number and sequences:array. Each sequence contains kit:number, bars:number and notes:array. A note contains key:string, oneshot:boolean, pitch:number, volume:number, pan:number and offset:number.

Examples

/qwak           The most basic qwak sequence
/q+wa-k         Pitch "w" note up, and "k" down
/90/2=foxobaxa  Use kit 2 at 90 bpm

For more examples, have a look at the extensive test suite

License

MIT © 2015 Adam Renklint


Generated with redok @ Sunday August 30th, 2015 - 11:50:19 PM

qwak's People

Contributors

adamrenklint avatar

Watchers

 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.