1.2.3 • Published 5 years ago

markovian-media v1.2.3

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

markovian-media

npm dependencies npm dev dependencies license npm bundle size (minified) npm bundle size (minified + gzip) node version compatibility npm current version

Quick start

As an isomorphic JavaScript package, there are multiple ways for clients, servers, and bundlers to start using this library. Several methods do not require installation.

RunKit

RunKit provides one of the least difficult ways to get started:

CodePen

Declare imports in the JS section to get started:

import { takeOnWreckingBall } from 'https://unpkg.com/markovian-media@latest?module';
const song = takeOnWreckingBall();
console.log(song);
// example output: 'i guess i never meant to be gone...'

Browsers

Insert the following element within the <head> tag of an HTML document:

<script src="https://unpkg.com/markovian-media@latest"></script>

After the script is loaded, the markovianMedia browser global is exposed:

const song = markovianMedia.takeOnWreckingBall();
console.log(song);
// example output: 'i guess i never meant to be gone...'

Node.js

With npm installed, run terminal command:

npm i markovian-media

Once installed, declare method imports at the top of each JavaScript file they will be used.

ES2015

Recommended

import { takeOnWreckingBall } from 'markovian-media';

CommonJS

const { takeOnWreckingBall } = require('markovian-media');

Usage

Generate a random song

takeOnWreckingBall();
// example output: 'i guess i never meant to be gone...'

Generate a specific song

Optionally providing seeds generates deterministic media.

const seeds = [
  74,
  40,
  83,
  115,
  110,
  108,
  158,
  204,
  245,
];

takeOnWreckingBall(seeds);
// output: 'i guess i never meant to be gone...'

Media catalogue

Providing methods with optional seeds generates deterministic media. This section lists a seed or seeds that generate titled works.

Essays

titlemethodseed
In Those of the Understandingdespondency5003
Readingreading1

Songs

titlemethodseeds
"I Can't Live a Wrecking Ball"takeOnWreckingBall[74, 40, 83, 115, 110, 108, 158, 204, 245]
"I Want to Boogie Woogie"musicQueen[146, 114, 183, 189, 173, 98, 179, 163]

API

All essay methods accept seed, an optional Number.

All song methods accept seeds, an optional Array of Numbers.

All methods return a String.

Single-seed methods

  • despondency
  • reading

Omit seed to generate random media.

Multiple-seed methods

methodnumber of optional seeds
musicQueen8
takeOnWreckingBall9

Omit all seeds to generate random media.

Omit some seeds to generate a random and deterministic media combination. Substitute any numbers with null to randomize those specific seeds (e.g.: seeds = [1, 2, null, 4] is 25% random, 75% deterministic).

Learn more

This package is powered by markovian-nlp, available on npm and GitHub.

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago