5.2.0 • Published 3 years ago

@generative-music/piece-oxalis-1 v5.2.0

Weekly downloads
108
License
MIT
Repository
github
Last release
3 years ago

pieces-alex-bainter

A collection of generative music pieces for Generative.fm.

Installation

Each piece is available via npm under the @generative-music scope. For example, the piece "Observable Streams" can be installed like so:

npm i @generative-music/piece-observable-streams

Usage

The default export of every piece is a function which takes an object parameter and returns a promise which resolves with a cleanup function once the piece is ready.

The object parameter passed to the exported function of a piece should have three properties:

Currently, all pieces use Tone.js which is required to control a piece.

import Tone from 'tone';
import makePiece from '@generative-music/piece-observable-streams';
import getSamplesByFormat from '@generative-music/samples-alex-bainter';

const { wav } = getSamplesByFormat();

makePiece({
  audioContext: Tone.context,
  destination: Tone.Master,
  samples: wav
}).then(cleanUp => {
  // Starting the piece
  // Make sure you follow the Chrome Autoplay policy: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
  Tone.Transport.start();

  // Stopping the piece
  Tone.Transport.stop(); // stop Transport events
  Tone.Transport.cancel(); // remove all Transport events
  cleanUp(); // dispose of audio nodes created by the piece
})
5.2.0

3 years ago

5.1.0

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.8.0

3 years ago

4.7.0

3 years ago

4.6.0

3 years ago

4.5.0

3 years ago

4.4.0

3 years ago

4.3.1

3 years ago

4.3.0

3 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.3.0

4 years ago

3.2.6

4 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago