Skip to content

Latest commit

 

History

History
 
 

mode

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@tonaljs/mode tonal npm version

@tonaljs/mode greek modes dictionary

Usage

ES6:

import { Mode } from "@tonaljs/tonal";

node:

const { Mode } = require("@tonaljs/tonal");

API

get(name: string) => object

Given a mode name, returns a Mode object with the following fields:

  • name: the mode name
  • aliases: alternative mode names
  • modeNum: the mode number (0...7)
  • mode: the mode number
  • alt: the alterations
  • triad: the triad chord type
  • seventh: the seventh chord type

Example:

Mode.get("major");
// {
//   name: "ionian",
//   aliases: ["major"]
//   intervals: ["1P", "2M", "3M", "4P", "5P", "6M", "7M"]
//   modeNum: 0,
//   mode: 2773,
//   alt: 0,
//   triad: "",
//   seventh: "Maj7",
// }

names() => string[]

Get a list of all mode names.

Mode.names();
// => ["ionian", "dorian", "phrygian", "lydian", "mixolydian", "aeolian", "locrian"];

all() => object[]

Return a list of known modes

Mode.all();

How to?

Get notes from a mode?

For example, "A major" mode:

import { Mode, Note } from "@tonaljs/tonal";

Mode.get("major").intervals.map(Note.transposeFrom("A"));
["A", "B", "C#", "D", "E", "F#", "G#"];

Want more?

Take a look to @tonal/key