# rites

> Musical scales and tunings library

Latest version **0.1.0** (published 2015-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install rites
pnpm add rites
yarn add rites
bun add rites
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-12-02 |
| First published | 2015-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Joe Turner |
| Maintainers | oampo |
| Keywords | scale, tuning, music |

## Links

- npm: https://www.npmjs.com/package/rites
- Repository: https://github.com/oampo/rites
- Homepage: https://github.com/oampo/rites#readme
- Issues: https://github.com/oampo/rites/issues
- npm.io page: https://npm.io/package/rites

## Recent versions

- 0.1.0 (latest) — 2015-12-02

## README

# Rites - Musical scales and tunings library

## Installation

```
npm install rites
```

## Example

```js
var scale = new rites.scale.Major();
// The third degree of a major scale with root frequency at low C (65.406Hz),
// in the second octave i.e. bass E.
scale.getFrequency(2, 65.406, 1);
```

## API Documentation

### Scales

#### Scale

```js
new rites.scale.Scale(degrees, [tuning=new rites.tuning.EqualTemperament(12)]);
```

Representation of a generic musical scale.  Can be subclassed to produce specific scales.

*Parameters*:

* degrees - `Number[]` - Array of integer degrees
* tuning - `Tuning` - The scale's tuning.  Defaults to 12-tone ET.

```js
rites.scale.Scale.prototype.getFrequency(degree, rootFrequency, octave);
```

Get the frequency of a note in the scale.

*Parameters*:

* degree - `Number` - The note's degree.
* rootFrequency - `Number` - The root frequency of the scale.
* octave - `Number` - The octave of the note.

*Returns*:

`Number` - The frequency of the note in hz.

#### Major

```js
new rites.scale.Major();
```

Major scale.

*Extends*:

`rites.scale.Scale`

#### Major

```js
new rites.scale.Minor();
```

Representation of a generic musical tuning.  Can be subclassed to produce specific tunings.

### Tunings

#### Tuning

```js
new rites.tuning.Tuning(semitones, [octaveRatio=2]);
```

*Parameters*:

* semitones - `Number[]` - Array of semitone values for the tuning.
* octaveRatio - `Number` - Frequency ratio for notes an octave apart.

#### EqualTemperamentTuning

```js
new rites.tuning.EqualTemperament(pitchesPerOctave);
```

*Extends*:

`rites.scale.Scale`

*Parameters*:

* pitchesPerOctave - `Number` The number of notes in each octave.

---
_Source: https://npm.io/package/rites · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
