Skip to content

Commit

Permalink
Merge pull request #17 from mohayonao/v0.1.8
Browse files Browse the repository at this point in the history
v0.1.8
  • Loading branch information
mohayonao committed Mar 5, 2015
2 parents d32d902 + 6afffd4 commit 4a50054
Show file tree
Hide file tree
Showing 22 changed files with 736 additions and 238 deletions.
53 changes: 38 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![Build Status](http://img.shields.io/travis/mohayonao/ciseaux.svg?style=flat-square)](https://travis-ci.org/mohayonao/ciseaux)
[![NPM Version](http://img.shields.io/npm/v/ciseaux.svg?style=flat-square)](https://www.npmjs.org/package/ciseaux)
[![Bower](http://img.shields.io/bower/v/ciseaux.svg?style=flat-square)](http://bower.io/search/?q=ciseaux)
[![Coverage Status](http://img.shields.io/coveralls/mohayonao/ciseaux.svg?style=flat-square)](https://coveralls.io/r/mohayonao/ciseaux?branch=master)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> JavaScript utility to chop an audio buffer, inspired from [youpy/scissor](https://github.com/youpy/scissor)
Expand Down Expand Up @@ -30,6 +31,7 @@ downloads:
- [ciseaux.min.js](https://raw.githubusercontent.com/mohayonao/ciseaux/master/build/ciseaux.min.js)

## :scissors: API
- `Ciseaux.from(src: ArrayBuffer|string, [audioContext: AudioContext]): Promise<Tape>`
- `Ciseaux.silence(duration: number): Tape`
- `Ciseaux.concat(...tapes: Tape): Tape`
- `Ciseaux.mix(...tapes: Tape, [method='silence']): Tape`
Expand Down Expand Up @@ -62,10 +64,18 @@ downloads:
- `dispose(): void`

### Ciseaux.Sequence
- `constructor(pattern: string, durationPerStep: number)`
Utility class for creating a sequence tape that is concatenated tapes

- `constructor(...args: any)`
- `pattern: string`
- `durationPerStep: number|number[]`
- `instruments: object`

### Instance methods
- `apply(instruments: object): Tape`
- `apply(...args: any): Tape`
- `pattern: string`
- `durationPerStep: number|number[]`
- `instruments: object`

## :scissors: Usage
```js
Expand Down Expand Up @@ -150,24 +160,37 @@ tape = Ciseaux.concat(tape1.split(32).map(function(tape, index) {

#### concrete
```js
tape = Ciseaux.mix([ -12, -7, -3, 0, 4 ].map(function(midi) {
return tape1.pitch(Math.pow(2, midi * 1/12)).fill(30);
})).gain(0.5);
tape = Ciseaux.mix([ -12, -10, -7, -3, 0 ].map(function(midi) {
return tape1.pitch(Math.pow(2, midi * 1/12));
}), "fill").gain(0.5).fill(30);
```

#### sequence

```js
tape = new Ciseaux.Sequence("a bdacbba babfeg", 0.2)
.apply({
a: tape1.split(16)[0],
b: tape1.split(16)[1],
c: tape1.split(16)[2],
d: tape1.split(16)[3].gain(0.15),
e: tape2.split(16)[4].pitch(0.25),
f: tape2.split(16)[5].pitch(4).gain(0.1),
g: tape3.pitch(32),
}).fill(30);
tape = new Ciseaux.Sequence("a bdacbba babfeg", 0.2, {
a: tape1.split(16)[0],
b: tape1.split(16)[1],
c: tape1.split(16)[2],
d: tape1.split(16)[3].gain(0.15),
e: tape2.split(16)[4].pitch(0.25),
f: tape2.split(16)[5].pitch(4).gain(0.1),
g: tape3.pitch(32),
}).apply().fill(30);
```

#### shuffled sequence

```js
tape = new Ciseaux.Sequence("a bdaabcaccbgabb", {
a: tape1.split(16)[4],
b: tape1.split(16)[1],
c: tape1.split(16)[2],
d: tape1.split(16)[3].gain(0.15),
e: tape2.split(16)[4].pitch(0.25),
f: tape2.split(16)[5].pitch(4).gain(0.1),
g: tape3.pitch(32),
}).apply([ 2/3, 1/3 ].map(function(x) { return x * 0.3; })).fill(30);
```

## :scissors: Developments
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ciseaux",
"description": "utility to chop an audio buffer",
"version": "0.1.7",
"version": "0.1.8",
"authors": [
"nao yonamine <mohayonao@gmail.com>"
],
Expand Down
3 changes: 3 additions & 0 deletions browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require("./lib/web-audio-tape").use();

module.exports = require("./lib");

0 comments on commit 4a50054

Please sign in to comment.