jazzband
This package contains a jazz band that is able to accompany your playing!
Key Features
-
Grooves that reflect different playing styles
-
Instruments such as Synthesizer or Sampler
-
Musicians: Pianist, Bassist and Drummer
-
Band with Metronome countin
-
iReal parser
-
Modular by design
-
Uses tonal and WAAClock
Installation
npm install jazzband --save
Quick Start
Hello 251
;;;band.comp, ;
The above snippet will setup the default Trio which is a Robot Rhythm Section playing only Synthesizers 🤖 🎹.
Sampler
If you want better sound, try the Sampler Instrument:
;;// create keys from piano samples with correct offset;// create drums from drum samples;// pass samplers to trio as instruments;band.comp, ;
Rhythm
The first argument of the comp method accepts an array of measures. If you want multiple chords per measure, you can just use arrays:
band.comp;// comps two bars
Util
util contains many functions that extend the tonal library by some handy harmony functions.
Intervals
invertInterval(interval)
: inverts interval, e.g. 2M yields -7mforceDirection(interval,direction)
: yields interval that goes in the given direction, e.g. forceDirection('-7M','up') returns '2m' (The target note is the same but the direction is forced)minInterval
: Returns the smallest and simplest interval.renderIntervals(intervals,root)
: Render all intervals on the given root
Notes
getNearestNote(from,to,direction?)
: returns the nearest note (with octave).getTonalChord(chord)
throw in non tonal chords (like -7) => get tonal readable chord
Range
A Range is an array with the lowest note and highest note that can be played.
isInRange(note,range)
: returns true if the note is inside the given range (array with min max)transposeToRange(notes, range)
: will transpose the given notes inside the given rangegetRangePosition(note, range)
: Depends on where the note is inside the given range. e.g. returns 0 for first note 0.5 for middle note and 1 for top note.
Steps
Extend intervals with widely used steps/degrees. The interval to step mapping is:
'1P': '1' '8' '2m': 'b9' 'b2' '2M': '9' '2' '2A': '#9' '#2' '3m': 'b3' '3M': '3' '4P': '11' '4' '4A': '#11' '#4' '5D': 'b5' '5P': '5' '6m': 'b13' 'b6' '6M': '13' '6' '7m': 'b7' '7M': '7' '^7' 'maj7';
The first being the more common name.
getStep(step)
: Returns unified step string. You can pass a number that will be flattened if negative e.g. -2 will output 'b9'.getIntervalFromStep(step)
: Returns the interval that leads to the given step.getStepInChord(note,chord,group?)
: e.g. getStepInChord('F#','C') yields #11renderSteps(steps, root)
: Renders all steps on the given root.
Degrees
A Degree is just a number describing a rough step (no matter if flat/sharp/augmented/diminished). This concept can be helpful to e.g. generate patterns over all kinds of chords (See Patterns).
findDegree(degree, intervals)
: Returns the given degrees step. e.gfindDegree(2,['1P','2m','3M'])
is '2m'hasDegree(degree, intervals)
: Returns true if the given degree is represented by the intervals.
Symbols
Symbols collect all tonal symbols (chords and scales) to map additional information to them:
-
short: the chord symbol that should be shown (e.g. △ for M)
-
long: long name, like humans say it.
-
groups: groups that the symbol is member of. The groups are provided for all kinds of classification.
-
scaleNames(group)
: Returns all scale names that have the given group -
chordNames(group)
: Returns all chord names that have the given group -
groupNames()
: Returns all group names
Scales
getChordScales(chord,group)
: Returns all scales that contain the given chord (can be filtered by a Symbol group)
Patterns
getPatternInChord
getDigitalPattern
renderDigitalPattern
getGuideTones
Sheets
formatChordSnippet
minifyChordSnippet
parseChordSnippet