npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

music-builder

v1.2.5

Published

The Music Builder provides the notes needed for a chord or scale.

Downloads

71

Readme

Music Builder

The Music Builder returns the musical notes for a chord, scale, or any array of intervals. It works in any key up to a double flat or sharp within the 12 tones of western music. It is highly recommended that you use TypeScript when working with this library.

Installation

Use npm to install the dependencies:

npm i music-builder

Usage

Interval Builder

The IntervalBuilder is the heart of the music builder and is utilized in both the chord and scale builders. It allows you to generate any musical idea or pattern you like provided a key and array of intervals.

import { IntervalBuilder } from 'music-builder';

IntervalBuilder.getNotes('C', ['1P', '5P']);
// returns ['C', 'G']

Intervals include:

  • Perfect unison: '1P'
  • Minor second: '2m'
  • Major second: '2M'
  • Minor third: '3m'
  • Major third: '3M'
  • Perfect fourth: '4P'
  • Augmented fourth: '4A'
  • Diminished fifth: '5d'
  • Perfect fifth: '5P'
  • Minor sixth: '6m'
  • Major sixth: '6M'
  • Minor seventh: '7m'
  • Major seventh: '7M'
  • Perfect octave: '8P'

Scale Builder

The ScaleBuilder returns a scale provided a key.

import { ScaleBuilder } from 'music-builder';

ScaleBuilder.major('A');
// returns ['A', 'B', 'C#', 'D',  'E', 'F#', 'G#', 'A']

Scales include:

  • Major
  • Minor
  • Major Pentatonic
  • Minor Pentatonic
  • Dorian
  • Phrygian
  • Lydian
  • Mixolydian
  • Aeolian
  • Locrian

Chord Builder

The ChordBuilder returns a chord provided a key.

import { ChordBuilder } from 'music-builder';

ChordBuilder.major('C');
// returns ['C', 'E', 'G']

Chords include:

  • major
  • major7
  • minor
  • minor7
  • dominant
  • diminished
  • minor7flat5

Contributing

The music-builder is a pet project currently but contributions and ideas for improvement are welcome! Feel free to report any bugs or suggestions on the project's issues page. Before sending a pull request with a new feature, check if it's already been discussed on the issues page and ask yourself three questions:

  1. Are you sure that this new feature is important enough to justify its presence in the music-builder core?
  2. Is it written in a simple, concise way that doesn't add bulk to the codebase?
  3. Is it tested sufficiently?

Code of Conduct

Everyone is invited to participate in the music-builder community and related projects: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The Contributor Covenant applies to all projects utilizing music-builder.

Thank You

Thanks for taking the time to view this project and I hope it proves itself useful/interesting for you!