Skip to content
프로젝트

소개

generative.fm을 위한 생성 음악 작품 모음

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

pieces-alex-bainter

A collection of generative music systems for Generative.fm.

The documentation here is incomplete but hopefully it can help you get started. Please see Generative.fm Open-source Objectives.

Installation

The generative systems are available as npm packages. You can either install every system in one package or as separate packages for each system.

Installing every system in one package

See @generative-music/pieces-alex-bainter.

Installing systems individually

Each piece is available on npm as package in the @generative-music scope. For example, to install the system for "Zed", you would do:

npm install @generative-music/piece-zed

In general, a system's package name is the same as its title, written in lower-kebab-case and prefixed with @generative-music/piece-. Slashes (/) in titles are replaced with dashes (-). You can confirm a system's package name by looking at the name property of its package.json file. For example, the package.json file for "Zed" is located at packages/piece-zed/package.json, where the name is specified as "@generative-music/piece-zed".

You will also need to install Tone.js if you haven't already (npm install tone).

Usage

As fast as possible

  1. You need to have the necessary audio sample files hosted somewhere accessible to the systems. These samples can be found in the @generative-music/samples-alex-bainter repository. For local development, follow the instructions for building and serving the files.

  2. Install necessary dependencies from npm:

npm install @generative-music/web-library @generative-music/web-provider @generative-music/samples-alex-bainter
  1. Run the system:
import activate from '@generative-music/piece-zed';
import createLibrary from '@generative-music/web-library';
import createProvider from '@generative-music/web-provider';
import getSampleIndex from '@generative-music/samples-alex-bainter';
import { Transport, Destination, context } from 'tone';

const provider = createProvider();

const sampleIndex = getSampleIndex({
  format: 'wav', // also accepts 'mp3' and 'ogg'
  host: 'http://localhost:6969', // host where sample files can be fetched from
});

const sampleLibrary = createLibrary({
  sampleIndex,
  provider,
});


// activate the system (load sample files and allocate memory)
activate({
  context,
  sampleLibrary
  destination: Destination, // connect the output of the system to Tone's Destination node
}).then(([deactivate, schedule]) => {
  const end = schedule(); // schedule a performance along Tone's Transport
  Transport.start(); // begin playback

  // stopping the system
  Transport.stop(); // stop Tone's Transport
  Transport.cancel(); // clear Tone's Transport
  end(); // clear the performance

  // releasing resources
  deactivate();
});

🍝 Regarding code quality (or lack thereof)

Most of the systems within this repository were written during a period where I'd set an aggressive pace for myself to create new systems regularly and experiment. As a result, code quality suffered. Unfortunately, this means the code may be hard to understand, and I don't consider it to be a good example of how I typically build software. Someday, I'd love to improve these systems so they're easier for you to read.

You've been warned!

관련 프로젝트 살펴보기

불러오는 중…