var improv = require('sharp11-improv')
dissonance- A number (0 to 1) or a numerical range. A higher value means the improv engine is more likely to select a less common / more dissonant scale according to scale precedence. Default value is
changeDir- A number (0 to 1) or a numerical range. A higher value means the improv engine is more likely to change directions while traversing up or down a scale. The probability of changing direction is equal to the value of
changeDir. Default value is
jumpiness- A number (0 to 1) or a numerical range. A higher value means the improv engine is more likely to jump to a random note in the current scale. The probability of jumping is equal to the value of
jumpiness. Default value is
rests- A number (0 to 1) or a numerical range. A higher value means the improv engine is more likely to insert a rest (currently the same as extending the previous note). The probability of inserting a rest is equal to the value of
rests. Default value is
rhythmicVariety- A number (0 to 1) or a numerical range. A higher value means the improv engine is more likely to use triplets or sixteenths rather than eighth notes. The probabilities of the improv engine inserting a measure of triplets or a measure of sixteenth notes are each one third the value of
rhythmicVariety. Default value is
useSixteenths- A boolean. If false, the improv engine will not use sixteenth notes and the probability of it using triplets becomes half the value of
rhythmicVariety. Default value is
onlyEighthRests- A boolean. If true, the improv engine will only put rests in measures of eighth notes and not in measures of triplets of sixteenth notes. Default value is
range- An array containing two Note objects or strings. The improv engine will only use notes within the given range (inclusive). Default value is
sections- An array listing the sections of the Chart object to improvise over and in what order. By default, it will improvise over the original song form.
repeat- A number representing the number of times to repeat the form when improvising. Default value is
cadence- A boolean. If true, the improvisation will end by returning to the first chord of the form. Default value is
Note: Some settings can take a numerical range instead of a number. A numerical range is given as an array containing two values. When improvising, the improv engine starts with the value set to the first element of the array and adjusts it linearly throughout the improvisation, reaching the second value by the end of the improvisation.
Returns true if a given object is an ImprovChart.
ImprovChart represents an improvisation over a Chart.
The Chart object being improvised over.
An object containing all the settings used for this improvisation.
An array of objects representing the notes that have been improvised for a given chord change. Each object contains the following properties:
chord- A Chord object representing the chord change.
scale- A Scale object representing the scale that was chosen for improvising over the chord change.
notes- An array of beats. Each beat is an array of two (eighth), three (triplet), or four (sixteenth) notes. Notes can either be Note objects or
null, representing rests.
duration- A Duration object representing the duration of the chord change.
Returns an array of objects representing the notes in the improvisation. Each object has a key
note that corresponds to a Note object or
null for a rest, and a key
duration that corresponds to a Duration object.