1.23.0 • Published 4 years ago

@generative-music/samples.generative.fm v1.23.0

Weekly downloads
26
License
MIT
Repository
github
Last release
4 years ago

samples.generative.fm

Browser and Node client for accessing files from samples.generative.fm.

Access to samples.generative.fm is currently restricted with CORS. Unrecognized origins will not be able to fetch audio files.

Usage

There are three ways to import the client.

1. Environment Automatic Detection

This method will detect if the package has been imported in a browser or Node environment.

import fetchSpecFile from 'samples.generative.fm';
// or
const fetchSpecFile from 'samples.generative.fm';

2. Browser-only

import fetchSpecFile from 'samples.generative.fm/browser-client';

3. Node-only

const fetchSpecFile from 'samples.generative.fm/node-client';

The imported function can be used like so:

fetchSpecFile('my-sample-host.com', 'sample-spec.json').then(sampleInfo => {
  console.log(sampleInfo.samples['sampled-instrument'].ogg['A4']);
  // outputs something like 'https://samples.generative.fm/sampled-instrument/ogg/<filename>.ogg'
});

API

fetchSpecFile([baseUrl], [filename])

Returns an object containing information about the samples.

Parameters

Local Development

The package is built with npm run build:pkg.

1.23.0

4 years ago

1.22.0

4 years ago

1.21.1

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.0

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.1

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago