This package has been deprecated

Author message:

obsolete

markovian-media

1.2.3 • Public • Published

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

title method seed
In Those of the Understanding despondency 5003
Reading reading 1

Songs

title method seeds
"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

method number of optional seeds
musicQueen 8
takeOnWreckingBall 9

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.

Package Sidebar

Install

npm i markovian-media

Weekly Downloads

1

Version

1.2.3

License

MIT

Unpacked Size

2.57 MB

Total Files

7

Last publish

Collaborators

  • stassi