Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
full-konduktiva-documentation [2025/08/01 09:03] – steve.wang | full-konduktiva-documentation [2025/08/01 20:30] (current) – steve.wang | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
# Konduktiva Documentation | # Konduktiva Documentation | ||
+ | Konduktiva is a JavaScript library for live coding, an improved version of the Conductive library for live coding in the Haskell programming language by Renick Bell. At present, it is intended for use within Nodejs. | ||
- | Konduktiva | + | [Konduktiva |
- | + | [Konduktiva Github](https:// | |
- | Konduktiva | + | [Konduktiva |
+ | [Renick | ||
## Installation: | ## Installation: | ||
- | 1. Install Nodejs. If npm does not automatically get installed with Nodejs, install npm. | + | 1. Install |
- | 2.1. Check if nodejs is installed by running this command in the terminal: | + | |
+ | ``` | ||
+ | node -v | ||
+ | ``` | ||
+ | 2.2. Check if npm is installed by running this command in the terminal: | ||
+ | ``` | ||
+ | npm -v | ||
+ | ``` | ||
- | ``` | + | 2.3. You can close the terminals you have opened prior to this step. |
- | node -v | + | |
- | ``` | + | |
- | 2.2. Check if npm is installed by running this command in the terminal: | ||
- | |||
- | ``` | ||
- | npm -v | ||
- | ``` | ||
- | |||
- | 2.3. You can close the terminals you have opened prior to this step. | ||
2. Install Konduktiva by using NPM: | 2. Install Konduktiva by using NPM: | ||
- | + | | |
- | ``` | + | npm i konduktiva |
- | | + | ``` |
- | | + | 3. Install a Digital Audio Workstation. |
- | 3. Install a Digital Audio Workstation. Ardour is recommended | + | |
## Setting Up Other related software (MIDI routing in device) | ## Setting Up Other related software (MIDI routing in device) | ||
- | Here | + | [Here](http:// |
## Setting Up An Editor (VIM + TMUX) | ## Setting Up An Editor (VIM + TMUX) | ||
- | Here | + | [Here](https:// |
- | + | ||
- | ## Tutorials: | + | |
- | Click here for tutorials about Konduktiva | + | ## Tutorials: |
+ | [Click here for tutorials about Konduktiva](https:// | ||
## Conceptual Overview | ## Conceptual Overview | ||
Line 46: | Line 43: | ||
Konduktiva is a JavaScript library for live coding performances using a metaphor of a conductor conducting an ensemble. | Konduktiva is a JavaScript library for live coding performances using a metaphor of a conductor conducting an ensemble. | ||
- | A MusicalEnvironment is used to store all of the necessary data. | + | A [MusicalEnvironment](# |
- | Players are processes that can be started or stopped. Using the metaphor of a player in a musical ensemble like a band or orchestra. | + | [Players](# |
The Players execute action functions which do things like play samples, trigger MIDI events, or even change the state of the system. They do so according to timing determined by IOI functions. IOI means interonset interval, which is the time between events. This timing is what determines the rhythm of a Player. | The Players execute action functions which do things like play samples, trigger MIDI events, or even change the state of the system. They do so according to timing determined by IOI functions. IOI means interonset interval, which is the time between events. This timing is what determines the rhythm of a Player. | ||
Line 56: | Line 53: | ||
By starting and stopping Players, a performance can be realized. | By starting and stopping Players, a performance can be realized. | ||
- | --- | + | ---- |
One of the features that Konduktiva has is a sequencer with regular timing. If you use setInterval alone, you will eventually accumulate a time lag, which means that your rhythm will be slow and fall behind what you expect, or that two different processes would fall out of time. | One of the features that Konduktiva has is a sequencer with regular timing. If you use setInterval alone, you will eventually accumulate a time lag, which means that your rhythm will be slow and fall behind what you expect, or that two different processes would fall out of time. | ||
Line 70: | Line 67: | ||
If you think about the piano roll in a DAW, you paint on notes. In Konduktiva, we write functions to determine the arrays containing notes. As for which notes they are, in a DAW the vertical position is painted as well. In Konduktiva, we write a function to determine an array containing position information. | If you think about the piano roll in a DAW, you paint on notes. In Konduktiva, we write functions to determine the arrays containing notes. As for which notes they are, in a DAW the vertical position is painted as well. In Konduktiva, we write a function to determine an array containing position information. | ||
- | Think of an orchestra. You might have one player playing a violin and another playing a flute. In Konduktiva, you might represent each of these with a Player, each with a different | + | Think of an orchestra. You might have one player playing a violin and another playing a flute. In Konduktiva, you might represent each of these with a Player, each with a different |
In a piano roll, you press play, and each of the painted notes is sounded according to its position on the roll, and when all of the notes have been played, the DAW will produce silence (unless you have set a loop point). In Konduktiva, you press play for an individual Player (or for all of the Players together, or a subset, depending on your design), and the default behavior is to repeat a Player' | In a piano roll, you press play, and each of the painted notes is sounded according to its position on the roll, and when all of the notes have been played, the DAW will produce silence (unless you have set a loop point). In Konduktiva, you press play for an individual Player (or for all of the Players together, or a subset, depending on your design), and the default behavior is to repeat a Player' | ||
Line 83: | Line 80: | ||
These functions are separate from the Player itself so that different Players can use the same IOI or action functions. Imagine a violin Player and a flute Player, each having a different action function corresponding to those two sounds, yet both using the same IOI function, resulting in them playing the same rhythm. Alternatively, | These functions are separate from the Player itself so that different Players can use the same IOI or action functions. Imagine a violin Player and a flute Player, each having a different action function corresponding to those two sounds, yet both using the same IOI function, resulting in them playing the same rhythm. Alternatively, | ||
+ | |||
### IOI functions | ### IOI functions | ||
Line 97: | Line 95: | ||
One might want to think of it as defining the negative space between notes. | One might want to think of it as defining the negative space between notes. | ||
- | action functions | + | |
+ | ### action functions | ||
In Konduktiva, the position of the notes is controlled by an IOI function parsing the arrays stored in the MusicalEnvironment. What happens at those notes is determined by the action function. | In Konduktiva, the position of the notes is controlled by an IOI function parsing the arrays stored in the MusicalEnvironment. What happens at those notes is determined by the action function. | ||
Line 106: | Line 105: | ||
This is a class used for storing all of the data that is needed for producing a performance with Konduktiva, including Players, Actions, IOI functions, RhythmMaps, and so on. | This is a class used for storing all of the data that is needed for producing a performance with Konduktiva, including Players, Actions, IOI functions, RhythmMaps, and so on. | ||
- | Users populate the MusicalEnvironment with Players, IOI functions, and action functions. The tempo exists as a property of this MusicalEnvironment. | ||
### Constructor | ### Constructor | ||
- | + | The constructor takes no arguments. Call it to get a default MusicalEnvironment which can then be adjusted to your needs. | |
- | The constructor takes no arguments. Call it to get a default MusicalEnvironment which can then be adjusted to your needs. | + | |
- | + | ``` | |
- | ``` | + | e = new MusicalEnvironment(); |
- | e = new MusicalEnvironment(); | + | ``` |
- | ``` | + | |
### Variables in the MusicalEnvironment | ### Variables in the MusicalEnvironment | ||
- | + | The titles of each variable in this documentation are aimed at giving as much information as possible. For example, the first title " | |
- | The titles of each variable in this documentation are aimed at giving as much information as possible. For example, the first title " | + | |
#### actions: function{} | #### actions: function{} | ||
- | + | Actions functions that can be used are stored here. [Learn more here](https:// | |
- | Actions functions that can be used are stored here. Learn more here | + | |
Connected to player variable: action | Connected to player variable: action | ||
- | |||
#### beatOfChangeToCurrentTempo: | #### beatOfChangeToCurrentTempo: | ||
- | |||
#### channelMaps: | #### channelMaps: | ||
- | |||
Channel Maps that players can use. These maps control which channel player should send midi info to at a given time. | Channel Maps that players can use. These maps control which channel player should send midi info to at a given time. | ||
Connected to player variable: channelMap | Connected to player variable: channelMap | ||
- | |||
#### chordMaps: QuantizedMap{} | #### chordMaps: QuantizedMap{} | ||
- | |||
Chord maps that players can use. These maps control which chords a player should use at a given time. The values are letter musical notation. (eg. M or m7) | Chord maps that players can use. These maps control which chords a player should use at a given time. The values are letter musical notation. (eg. M or m7) | ||
Connected to player variable: chordMap | Connected to player variable: chordMap | ||
- | |||
#### controlChangeMaps: | #### controlChangeMaps: | ||
- | |||
Control change maps that players can use. These map control which control change midi messages a player should send at a given time. The values are the midi controlChange information in form of objects with the variables controller and, value. | Control change maps that players can use. These map control which control change midi messages a player should send at a given time. The values are the midi controlChange information in form of objects with the variables controller and, value. | ||
Connected to control change player variable: controlChangeMap | Connected to control change player variable: controlChangeMap | ||
- | + | #### currentDensityGraphs: | |
- | #### currentDensityGraphs: | + | An array of densityGraph names. The acutal densityGraphs are stored in the [densityGraphs variable](# |
- | + | #### currentTempo: | |
- | An array of densityGraph names. The acutal densityGraphs are stored in the densityGraphs variable. | + | Returns the current tempo of the MusicalEnvironment. To change the tempo use the [changeTempo method](# |
- | + | ||
- | #### currentTempo: | + | |
- | + | ||
- | Returns the current tempo of the MusicalEnvironment. To change the tempo use the changeTempo method. | + | |
#### currentBeatsPerMeasure: | #### currentBeatsPerMeasure: | ||
- | |||
Shows the current beats per measure. Default is 4. | Shows the current beats per measure. Default is 4. | ||
- | |||
#### densityGraphs: | #### densityGraphs: | ||
- | |||
An object filled with densityGraphs. The actual graphs are in form of QuantizedMaps. So, it is a QuantizedMap in an object in another object. | An object filled with densityGraphs. The actual graphs are in form of QuantizedMaps. So, it is a QuantizedMap in an object in another object. | ||
- | |||
#### IOIs: function{} | #### IOIs: function{} | ||
- | |||
IOI function are stored here. | IOI function are stored here. | ||
- | |||
#### legatoMaps: QuantizedMap{} | #### legatoMaps: QuantizedMap{} | ||
- | + | Controls how long each note plays for. Similar to noteDurationMaps. Works with noteDuration. This is the equation used for calculating a duration of a note. noteDuration * legatoMap. | |
- | Controls how long each note plays for. Similar to noteDurationMaps. Works with noteDuration. This is the equation used for calculating a duration of a note. noteDuration | + | |
#### lookahead: number | #### lookahead: number | ||
- | |||
Returns the lookahead time. | Returns the lookahead time. | ||
- | |||
#### maskMaps: QuantizedMap{} | #### maskMaps: QuantizedMap{} | ||
- | |||
maskMaps are basically the booleans. The keys are the time and the values are trues or falses. If it is a true for a specific time, the action function will be called. If it is a false, action function will not be called. To supress events. | maskMaps are basically the booleans. The keys are the time and the values are trues or falses. If it is a true for a specific time, the action function will be called. If it is a false, action function will not be called. To supress events. | ||
- | |||
#### maxPolyphonyMaps: | #### maxPolyphonyMaps: | ||
- | |||
Not filling this in will deactivate this specific feature. | Not filling this in will deactivate this specific feature. | ||
Line 185: | Line 155: | ||
#### midiInputs: Object{} | #### midiInputs: Object{} | ||
- | |||
The midiInputs that Konduktiva/ | The midiInputs that Konduktiva/ | ||
- | |||
#### midiOutputs: | #### midiOutputs: | ||
- | |||
the midiOutputs that Konduktiva/ | the midiOutputs that Konduktiva/ | ||
- | |||
#### midiProgramMaps: | #### midiProgramMaps: | ||
- | |||
Used by the players that send Midi Program messages. Controls which Midi program messages to send at a given time. | Used by the players that send Midi Program messages. Controls which Midi program messages to send at a given time. | ||
- | |||
#### modeFilters: | #### modeFilters: | ||
- | |||
The mode players should be filtered through. It passes the note to filter through the modeFilter QuantizedMap via wrapLookup method. | The mode players should be filtered through. It passes the note to filter through the modeFilter QuantizedMap via wrapLookup method. | ||
- | |||
#### modeMaps: QuantizedMap{} | #### modeMaps: QuantizedMap{} | ||
- | |||
The modeFilter that the player should use. | The modeFilter that the player should use. | ||
- | |||
#### noteDurationMaps: | #### noteDurationMaps: | ||
- | + | These QuantizeMaps store how long each note should play for at a given beat. They are the note spans. Works with legatoMaps. This is the equation used for calculating a duration of a note. noteDuration * legatoMap. | |
- | These QuantizeMaps store how long each note should play for at a given beat. They are the note spans. Works with legatoMaps. This is the equation used for calculating a duration of a note. noteDuration | + | |
#### noteMaps: QuantizedMap{} | #### noteMaps: QuantizedMap{} | ||
- | |||
Stores the noteValues. The keys is the beats and the values are the notes to play. | Stores the noteValues. The keys is the beats and the values are the notes to play. | ||
- | |||
#### notesInputMode: | #### notesInputMode: | ||
- | + | Two options | |
- | Two options relativeSemitone or relativeScaleDegree. This changes how the action function uses the noteMaps | + | |
#### octaveMaps: QuantizedMap{} | #### octaveMaps: QuantizedMap{} | ||
- | |||
Stores the octaves the action function should use at a given beat. The keys are the beats and the values are the octaves to use. | Stores the octaves the action function should use at a given beat. The keys are the beats and the values are the octaves to use. | ||
- | + | #### players: object[] | |
- | #### players: object\[\] | + | An array full of player objects. Find out more by looking at the [player](# |
- | + | ||
- | An array full of player objects. Find out more by looking at the player section. | + | |
#### recordedMessages: | #### recordedMessages: | ||
- | |||
For use in recording midi inputs. | For use in recording midi inputs. | ||
- | |||
#### rhythmMaps: QuantizedMap{} | #### rhythmMaps: QuantizedMap{} | ||
- | |||
Controls when a note is played (keys) and how long each note should play for (values). | Controls when a note is played (keys) and how long each note should play for (values). | ||
- | |||
#### rhythmPatterns: | #### rhythmPatterns: | ||
- | + | Needed to call ```rhythmPattern.add(e, | |
- | Needed to call \`\`\`rhythmPattern.add(e, | + | |
#### root: string | #### root: string | ||
- | |||
The root letter. By default it is ' | The root letter. By default it is ' | ||
- | |||
#### rootMaps: QuantizedMap{} | #### rootMaps: QuantizedMap{} | ||
- | |||
Stores the root English letters. The keys are the beats and the values are the English letters. | Stores the root English letters. The keys are the beats and the values are the English letters. | ||
- | |||
#### sampleKits | #### sampleKits | ||
- | |||
superDirt stuff. | superDirt stuff. | ||
- | |||
#### samplePatternCount | #### samplePatternCount | ||
- | |||
superDirt stuff. | superDirt stuff. | ||
- | |||
#### samplePatternStore | #### samplePatternStore | ||
- | |||
superDirt stuff. | superDirt stuff. | ||
- | |||
#### samplePatterns: | #### samplePatterns: | ||
- | |||
superDirt instrument QuantizedMap. | superDirt instrument QuantizedMap. | ||
- | |||
#### samples | #### samples | ||
- | |||
#### scheduledPlayers | #### scheduledPlayers | ||
- | |||
Players that are schedules to play stored in an array. | Players that are schedules to play stored in an array. | ||
- | |||
#### songMaps: QuantizedMap{} | #### songMaps: QuantizedMap{} | ||
- | |||
Controls which chordMap a player is using | Controls which chordMap a player is using | ||
- | |||
#### scheduler | #### scheduler | ||
- | |||
Tasktimer | Tasktimer | ||
- | |||
#### superDirtPath | #### superDirtPath | ||
- | |||
Location of the superDirt samples. | Location of the superDirt samples. | ||
- | |||
#### timeOfChangeToCurrentTempo | #### timeOfChangeToCurrentTempo | ||
- | |||
#### velocityMaps: | #### velocityMaps: | ||
- | |||
Controls the midi velocity variable from 0-127 at a given beat. The keys are the beats and the values are the velocity. | Controls the midi velocity variable from 0-127 at a given beat. The keys are the beats and the values are the velocity. | ||
### Methods in the MusicalEnvironment | ### Methods in the MusicalEnvironment | ||
- | |||
### currentBeat | ### currentBeat | ||
- | + | -> Number | |
- | \-> Number | + | |
Returns the current beat of the MusicalEnvironment | Returns the current beat of the MusicalEnvironment | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.currentBeat() | e.currentBeat() | ||
Line 301: | Line 218: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.currentBeat()) | console.log(e.currentBeat()) | ||
Line 311: | Line 227: | ||
### changeTempo | ### changeTempo | ||
- | |||
Number -> | Number -> | ||
Takes a number as an argument and changes the currentTempo to that number. | Takes a number as an argument and changes the currentTempo to that number. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.changeTempo(tempo) | e.changeTempo(tempo) | ||
Line 323: | Line 236: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### tempo | ###### tempo | ||
- | |||
New tempo of the current MusicalEnvironment | New tempo of the current MusicalEnvironment | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.changeTempo(100)) //TEMPO CHANGE! time: 5.690928572999313; | console.log(e.changeTempo(100)) //TEMPO CHANGE! time: 5.690928572999313; | ||
Line 340: | Line 250: | ||
### getAction | ### getAction | ||
- | |||
string -> Function | string -> Function | ||
Returns the action function of a specific player in this MusicalEnvironment | Returns the action function of a specific player in this MusicalEnvironment | ||
Takes player name in form of a string as an argument. | Takes player name in form of a string as an argument. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.getAction(player) | e.getAction(player) | ||
Line 353: | Line 260: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### player | ###### player | ||
- | |||
Name of a variable in e.players | Name of a variable in e.players | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.getAction(' | console.log(e.getAction(' | ||
Line 370: | Line 274: | ||
### getIOIFunc | ### getIOIFunc | ||
- | |||
string -> Function | string -> Function | ||
Line 376: | Line 279: | ||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.getIOIFunc(player) | e.getIOIFunc(player) | ||
Line 382: | Line 284: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### player | ###### player | ||
- | |||
Name of a variable in e.players | Name of a variable in e.players | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.getIOIFunc(' | console.log(e.getIOIFunc(' | ||
Line 399: | Line 298: | ||
### scheduleEvents | ### scheduleEvents | ||
- | |||
schedules events. | schedules events. | ||
- | string -> | + | string -> |
Returns the IOI function of a specific player in this MusicalEnvironment. Not meant to be called by user. | Returns the IOI function of a specific player in this MusicalEnvironment. Not meant to be called by user. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.scheduledPlayers(player) | e.scheduledPlayers(player) | ||
Line 412: | Line 308: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### player | ###### player | ||
- | |||
Name of a variable in e.players | Name of a variable in e.players | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.scheduleEvents(' | e.scheduleEvents(' | ||
Line 430: | Line 323: | ||
Starts the scheduler for the MusicalEnvironment. It takes no arguments and returns nothing. | Starts the scheduler for the MusicalEnvironment. It takes no arguments and returns nothing. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.startScheduler() | e.startScheduler() | ||
Line 440: | Line 331: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.startScheduler() | e.startScheduler() | ||
Line 452: | Line 342: | ||
Stops the scheduler for the MusicalEnvironment. Takes no arguments and retunrs nothing. | Stops the scheduler for the MusicalEnvironment. Takes no arguments and retunrs nothing. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.stopScheduler() | e.stopScheduler() | ||
Line 462: | Line 350: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.stopScheduler() | e.stopScheduler() | ||
Line 472: | Line 359: | ||
### play | ### play | ||
- | + | String -> | |
- | String -> | + | |
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.play(player) | e.play(player) | ||
Line 482: | Line 367: | ||
#### Parameters | #### Parameters | ||
- | |||
##### players | ##### players | ||
- | |||
Player name | Player name | ||
### Examples | ### Examples | ||
- | |||
``` | ``` | ||
e.play(' | e.play(' | ||
Line 498: | Line 380: | ||
### stop | ### stop | ||
- | + | String -> | |
- | String -> | + | |
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.stop(player) | e.stop(player) | ||
Line 508: | Line 388: | ||
#### Parameters | #### Parameters | ||
- | |||
##### players | ##### players | ||
- | |||
Player name | Player name | ||
### Examples | ### Examples | ||
- | |||
``` | ``` | ||
e.stop(' | e.stop(' | ||
Line 524: | Line 401: | ||
### allPlayers | ### allPlayers | ||
- | + | -> | |
- | \-> | + | |
Returns an array of all the player names. | Returns an array of all the player names. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.allPlayers() | e.allPlayers() | ||
Line 538: | Line 412: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.allPlayers) | console.log(e.allPlayers) | ||
Line 548: | Line 421: | ||
### allPlayerStatus | ### allPlayerStatus | ||
- | + | -> [[String, String] ...] | |
- | \-> \[\[String, String\] ...\] | + | |
Returns an array full of arrays. Each sub array contains the player name and their status. All the player names and their status also gets logged into the console. | Returns an array full of arrays. Each sub array contains the player name and their status. All the player names and their status also gets logged into the console. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.allPlayerStatus() | e.allPlayerStatus() | ||
Line 562: | Line 432: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.allPlayerStatus()) | console.log(e.allPlayerStatus()) | ||
Line 585: | Line 454: | ||
### playingPlayers | ### playingPlayers | ||
- | + | -> | |
- | \-> | + | |
Returns an array of all the names of players that are currently playing. | Returns an array of all the names of players that are currently playing. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.playingPlayers() | e.playingPlayers() | ||
Line 599: | Line 465: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
console.log(e.playingPlayers()) //[] | console.log(e.playingPlayers()) //[] | ||
Line 609: | Line 474: | ||
### playN | ### playN | ||
- | + | [String] -> | |
- | \[String\] -> | + | |
Starts playing all the player names in the array. | Starts playing all the player names in the array. | ||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.playN(ps) | e.playN(ps) | ||
Line 621: | Line 484: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### ps | ###### ps | ||
- | |||
An array of player names. | An array of player names. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.playN([' | e.playN([' | ||
Line 635: | Line 495: | ||
--- | --- | ||
+ | |||
### stopN | ### stopN | ||
- | + | [String] -> | |
- | \[String\] -> | + | |
Stops playing all the player names in the array. | Stops playing all the player names in the array. | ||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.stopN(ps) | e.stopN(ps) | ||
Line 649: | Line 508: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### ps | ###### ps | ||
- | |||
An array of player names. | An array of player names. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.stopN([' | e.stopN([' | ||
Line 665: | Line 521: | ||
### playAll | ### playAll | ||
- | + | -> | |
- | \-> | + | |
All players start playing. | All players start playing. | ||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.playAll() | e.playAll() | ||
Line 679: | Line 533: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.playAll() | e.playAll() | ||
Line 689: | Line 542: | ||
### stopAll | ### stopAll | ||
- | + | -> | |
- | \-> | + | |
All players stop playing. | All players stop playing. | ||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.stopAll() | e.stopAll() | ||
Line 703: | Line 554: | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.stopAll() | e.stopAll() | ||
Line 714: | Line 564: | ||
### solo | ### solo | ||
- | \[String\] -> | + | [String] -> |
Stops playing all the player names in the array after checking if the players exist inside the MusicalEnvironment. | Stops playing all the player names in the array after checking if the players exist inside the MusicalEnvironment. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.solo(ps) | e.solo(ps) | ||
Line 725: | Line 573: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### ps | ###### ps | ||
- | |||
An array of player names. | An array of player names. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.stopN([' | e.stopN([' | ||
Line 741: | Line 586: | ||
### togglePlayer | ### togglePlayer | ||
- | + | String -> | |
- | String -> | + | |
Toggles the state of a specific player. If that player is playing it will be stopped. If that player is stopped, it will start playing. | Toggles the state of a specific player. If that player is playing it will be stopped. If that player is stopped, it will start playing. | ||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.togglePlayer(p) | e.togglePlayer(p) | ||
Line 753: | Line 596: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### p | ###### p | ||
- | |||
Player name | Player name | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.togglePlayer(' | e.togglePlayer(' | ||
Line 765: | Line 605: | ||
### findSuperDirtSamples | ### findSuperDirtSamples | ||
- | + | -> String | |
- | \-> String | + | |
Checks if superDirt samples exists at the location(file path) they are supposed to be at. | Checks if superDirt samples exists at the location(file path) they are supposed to be at. | ||
- | #### Syntax | + | #### Syntax |
``` | ``` | ||
e.findSuperDirtSamples() | e.findSuperDirtSamples() | ||
Line 777: | Line 615: | ||
#### Parameters | #### Parameters | ||
- | |||
#### Examples: | #### Examples: | ||
- | |||
``` | ``` | ||
e.findSuperDirtSamples() | e.findSuperDirtSamples() | ||
Line 786: | Line 622: | ||
### getSuperDirtSamplesPath | ### getSuperDirtSamplesPath | ||
- | + | -> String | |
- | \-> String | + | |
Returns the path of where superDirt samples should be on a specific system. | Returns the path of where superDirt samples should be on a specific system. | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.getSuperDirtSamplesPath() | e.getSuperDirtSamplesPath() | ||
Line 798: | Line 632: | ||
#### Parameters | #### Parameters | ||
- | |||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.getSuperDirtSamplesPath() | e.getSuperDirtSamplesPath() | ||
Line 808: | Line 640: | ||
### checkingAddMapToMusicalEnvironmentArguments | ### checkingAddMapToMusicalEnvironmentArguments | ||
- | String -> String -> Number, | + | String -> String -> Number, [Number] -> [[Number]]|[Number] -> |
Checks the arguments of addMap method. | Checks the arguments of addMap method. | ||
- | #### Syntax | + | #### Syntax |
e.checkingAddMapToMusicalEnvironmentArguments(objectName, | e.checkingAddMapToMusicalEnvironmentArguments(objectName, | ||
#### Parameters | #### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
##### Example: | ##### Example: | ||
- | |||
``` | ``` | ||
e.checkingAddMapToMusicalEnvironmentArguments(' | e.checkingAddMapToMusicalEnvironmentArguments(' | ||
Line 846: | Line 666: | ||
### createDefaultRhythmMap | ### createDefaultRhythmMap | ||
- | + | String -> String -> Number, [Number] -> [Number] -> Boolean | |
- | String -> String -> Number, | + | |
Creates the default a rhythmMap with the information provided | Creates the default a rhythmMap with the information provided | ||
- | #### Syntax | + | #### Syntax |
e.createDefaultRhythmMap(objectName, | e.createDefaultRhythmMap(objectName, | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createDefaultRhythmMap(' | e.createDefaultRhythmMap(' | ||
Line 884: | Line 691: | ||
``` | ``` | ||
- | ### createSubarrayMap | + | ### createSubarrayMap |
- | + | String -> String -> Number, [Number] -> [Number] -> Boolean | |
- | String -> String -> Number, | + | |
Creates subArray QuantizedMaps and adds them to MusicalEnvivronment. This is used for noteMaps and octaveMaps. | Creates subArray QuantizedMaps and adds them to MusicalEnvivronment. This is used for noteMaps and octaveMaps. | ||
#### Syntax | #### Syntax | ||
- | |||
e.createSubarrayMap(objectName, | e.createSubarrayMap(objectName, | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createSubarrayMap(' | e.createSubarrayMap(' | ||
Line 925: | Line 719: | ||
### createNoteMaps | ### createNoteMaps | ||
- | ### createRhythmPatternMap | ||
- | String -> String -> Number, | + | ### createRhythmPatternMap |
+ | String -> String -> Number, [Number] -> [Boolean] -> Boolean | ||
Creates the default rhythmPattern maps based on the information. | Creates the default rhythmPattern maps based on the information. | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.createRhythmPatternMap(objectName, | e.createRhythmPatternMap(objectName, | ||
Line 938: | Line 731: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createRhythmPatternMap(' | e.createRhythmPatternMap(' | ||
Line 967: | Line 749: | ||
### createDefaultMaskMap | ### createDefaultMaskMap | ||
- | + | String -> String -> Number, [Number] -> [Boolean] -> Boolean | |
- | String -> String -> Number, | + | |
Creates the default maskMap based on the information provided. | Creates the default maskMap based on the information provided. | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.createDefaultMaskMaps(objectName, | e.createDefaultMaskMaps(objectName, | ||
Line 979: | Line 759: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createDefaultMaskMap(' | e.createDefaultMaskMap(' | ||
Line 1007: | Line 776: | ||
### createChordProgressionMap | ### createChordProgressionMap | ||
- | + | String -> String -> Number, [Number] -> [Boolean] -> Boolean | |
- | String -> String -> Number, | + | |
Create default chord progression map with information provided. | Create default chord progression map with information provided. | ||
#### Syntax | #### Syntax | ||
- | |||
e.createChordProgressionMap(objectName, | e.createChordProgressionMap(objectName, | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createDefaultMaskMap(' | e.createDefaultMaskMap(' | ||
Line 1046: | Line 802: | ||
### createSongMap | ### createSongMap | ||
- | + | String -> String -> Number, [Number] -> [Boolean] -> Boolean | |
- | String -> String -> Number, | + | |
Creates the default song map with based on the information provided. | Creates the default song map with based on the information provided. | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.createSongMap(objectName, | e.createSongMap(objectName, | ||
Line 1058: | Line 812: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createSongMap(' | e.createSongMap(' | ||
Line 1088: | Line 831: | ||
### createDefaultMap | ### createDefaultMap | ||
- | + | String -> String -> Number, [Number] -> [Boolean] -> Boolean | |
- | String -> String -> Number, | + | |
Create default chord progression map with information provided. | Create default chord progression map with information provided. | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.createDefaultMap(objectName, | e.createDefaultMap(objectName, | ||
Line 1101: | Line 842: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
e.createDefaultMap(' | e.createDefaultMap(' | ||
Line 1132: | Line 862: | ||
This function helps add QuantizedMaps into the MusicalEnvironment with correct types. If something is wrong, this function will throw an error. It is safer and in some situations easier and quicker to use this method than to create a QuantizedMap manually. | This function helps add QuantizedMaps into the MusicalEnvironment with correct types. If something is wrong, this function will throw an error. It is safer and in some situations easier and quicker to use this method than to create a QuantizedMap manually. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
e.addMap(objectName, | e.addMap(objectName, | ||
Line 1140: | Line 868: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### objectName | ###### objectName | ||
- | |||
Name of a variable in the MusicalEnvironment to add to. | Name of a variable in the MusicalEnvironment to add to. | ||
- | |||
###### mapName | ###### mapName | ||
- | |||
Name of the new QuantizedMap. | Name of the new QuantizedMap. | ||
- | |||
###### keyspan | ###### keyspan | ||
- | |||
Th keyspan of the new QuantizedMap. | Th keyspan of the new QuantizedMap. | ||
- | |||
###### keys | ###### keys | ||
- | |||
The keys of the new QuantizedMap. | The keys of the new QuantizedMap. | ||
- | |||
###### values | ###### values | ||
- | |||
The values of the new QuantizedMap. | The values of the new QuantizedMap. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.addMap(' | e.addMap(' | ||
Line 1182: | Line 899: | ||
--- | --- | ||
- | |||
## Interacting with the Musical Environment | ## Interacting with the Musical Environment | ||
- | There are different ways you can interacte and change things in the MusicalEnvironment. You can change it by doing e.variable = . This way is excellent if you are familliar with what you are doing and if you have time. When live coding we often have to act and think quickly. When doing this is is especially easy to make mistakes when making QuanitzedMaps. | + | There are different ways you can interacte and change things in the MusicalEnvironment. You can change it by doing ```e.variable = ```. This way is excellent if you are familliar with what you are doing and if you have time. When live coding we often have to act and think quickly. When doing this is is especially easy to make mistakes when making QuanitzedMaps. |
### Players | ### Players | ||
- | |||
Players are processes that can be started or stopped using the metaphor of a player in a musical ensemble like a band or orchestra. | Players are processes that can be started or stopped using the metaphor of a player in a musical ensemble like a band or orchestra. | ||
Line 1196: | Line 912: | ||
By starting and stopping Players, a performance can be realized. | By starting and stopping Players, a performance can be realized. | ||
+ | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
new Player(name) | new Player(name) | ||
Line 1204: | Line 920: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### name | ###### name | ||
- | |||
Name of the player. This will also be the value of the name variable in the player. | Name of the player. This will also be the value of the name variable in the player. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.players.testPlayer = new Player(' | e.players.testPlayer = new Player(' | ||
Line 1232: | Line 945: | ||
##### Quantized Map | ##### Quantized Map | ||
- | |||
###### Keyspan: number | ###### Keyspan: number | ||
- | |||
Keyspan is the total | Keyspan is the total | ||
- | + | ###### Keys: number[] | |
- | ###### Keys: number\[\] | + | |
An array of numbers in ascending order. | An array of numbers in ascending order. | ||
- | + | ###### values: number[] | |
- | ###### values: number\[\] | + | |
###### To make a new Quantized Map | ###### To make a new Quantized Map | ||
- | |||
``` | ``` | ||
new QuantizedMap(keyspan, | new QuantizedMap(keyspan, | ||
``` | ``` | ||
- | |||
###### nearestLookup: | ###### nearestLookup: | ||
- | |||
Takes a number as an input and will look for a number in the keys array that is closest to it compared to the others. It will then take the index of that number and return the value array using that index. | Takes a number as an input and will look for a number in the keys array that is closest to it compared to the others. It will then take the index of that number and return the value array using that index. | ||
- | |||
###### floorLookup: | ###### floorLookup: | ||
- | |||
The floorLookup method does something similar to nearestLookup but when it looks for the closest it always looks for a number smaller than it. | The floorLookup method does something similar to nearestLookup but when it looks for the closest it always looks for a number smaller than it. | ||
- | |||
###### wrapLookup: Method | ###### wrapLookup: Method | ||
- | |||
The wrapLookup method is also similar to the nearestLookup method but when the number provided is greater than the keyspan, it does not return the last item in the values array instead it loops back around. | The wrapLookup method is also similar to the nearestLookup method but when the number provided is greater than the keyspan, it does not return the last item in the values array instead it loops back around. | ||
Line 1269: | Line 969: | ||
A RhythmPattern is a set of parameters bundled as an object which is used to create a rhythm pattern and mask pattern for a particular Player. | A RhythmPattern is a set of parameters bundled as an object which is used to create a rhythm pattern and mask pattern for a particular Player. | ||
- | #### Methods | + | #### Methods |
##### constructor | ##### constructor | ||
- | + | String -> Number -> [Number ...] -> [Boolean] -> Object | |
- | String -> Number -> \[Number ...\] -> \[Boolean\] -> Object | + | |
Creates the RhythmPattern | Creates the RhythmPattern | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
new RhythmPattern(n, | new RhythmPattern(n, | ||
Line 1284: | Line 980: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### n | ###### n | ||
- | |||
Name of the rhythmPattern. | Name of the rhythmPattern. | ||
- | |||
###### l | ###### l | ||
- | |||
Length of the rhythmPattern | Length of the rhythmPattern | ||
- | |||
###### i | ###### i | ||
- | |||
A number array filled with the booleans " | A number array filled with the booleans " | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
let testR = new RhythmPattern(' | let testR = new RhythmPattern(' | ||
Line 1306: | Line 995: | ||
--- | --- | ||
- | |||
##### addToPlayer | ##### addToPlayer | ||
- | + | MusicalEnvironment -> String -> | |
- | MusicalEnvironment -> String -> | + | |
Adds this RhythmPattern to a player. | Adds this RhythmPattern to a player. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
testR.addToPlayer(env, | testR.addToPlayer(env, | ||
Line 1320: | Line 1005: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### env | ###### env | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
- | |||
###### playerName | ###### playerName | ||
- | |||
Name of the player to add to. | Name of the player to add to. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
testR.addToPlayer(e, | testR.addToPlayer(e, | ||
Line 1338: | Line 1018: | ||
--- | --- | ||
- | |||
##### add | ##### add | ||
- | + | MusicalEnvironment -> String -> | |
- | MusicalEnvironment -> String -> | + | |
Adds to MusicalEnvironment but does not add to a player. | Adds to MusicalEnvironment but does not add to a player. | ||
- | |||
##### Syntax | ##### Syntax | ||
- | |||
``` | ``` | ||
testR.add(env, | testR.add(env, | ||
Line 1352: | Line 1028: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### env | ###### env | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
- | |||
###### playerName | ###### playerName | ||
- | |||
Name of the player to add to. | Name of the player to add to. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
testR.add(e, | testR.add(e, | ||
Line 1375: | Line 1046: | ||
To Note: None of the action functions or the functions called by/in the action functions are intended to be directly called by users. | To Note: None of the action functions or the functions called by/in the action functions are intended to be directly called by users. | ||
- | Action function are a key part of Konduktiva. Click (here)\[http:// | + | Action function are a key part of Konduktiva. Click (here)[http:// |
Here the details of what each action function does will be documented more specifically. | Here the details of what each action function does will be documented more specifically. | ||
### default | ### default | ||
- | |||
Number -> Number -> MusicalEnvironment | Number -> Number -> MusicalEnvironment | ||
Line 1386: | Line 1056: | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.actions.default(midiOutput, | e.actions.default(midiOutput, | ||
Line 1392: | Line 1061: | ||
##### Parameters | ##### Parameters | ||
- | |||
###### midiOutput | ###### midiOutput | ||
- | + | The index in the array e.midiOutputs. | |
- | The index in the array e.midiOutputs. | + | |
###### b | ###### b | ||
- | |||
Beat | Beat | ||
- | |||
###### e | ###### e | ||
- | |||
MusicalEnvironment. | MusicalEnvironment. | ||
##### Examples | ##### Examples | ||
- | |||
``` | ``` | ||
e.actions.default(1, | e.actions.default(1, | ||
Line 1418: | Line 1080: | ||
### midiSequencedRhythm/ | ### midiSequencedRhythm/ | ||
- | + | Object -> Number -> | |
- | Object -> Number -> | + | |
DEPRECATED | DEPRECATED | ||
### sendNotesMidiInfo: | ### sendNotesMidiInfo: | ||
- | |||
String -> Number -> MusicalEnvironment -> Boolean | String -> Number -> MusicalEnvironment -> Boolean | ||
Sends note MIDI messages using the information provided. | Sends note MIDI messages using the information provided. | ||
Note other functions called in this function documented below. | Note other functions called in this function documented below. | ||
- | |||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.actions.sendNotesMidiInfo(playerName, | e.actions.sendNotesMidiInfo(playerName, | ||
Line 1437: | Line 1095: | ||
#### Parameter | #### Parameter | ||
- | |||
##### playerName | ##### playerName | ||
- | |||
The name of the player to be played | The name of the player to be played | ||
- | |||
###### b | ###### b | ||
- | |||
Beat | Beat | ||
- | |||
###### e | ###### e | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
##### Example | ##### Example | ||
- | |||
``` | ``` | ||
e.actions.sendNotesMidiInfo(' | e.actions.sendNotesMidiInfo(' | ||
Line 1457: | Line 1108: | ||
### sendChordMidiInfo: | ### sendChordMidiInfo: | ||
- | |||
String -> Number -> MusicalEnvironment -> Boolean | String -> Number -> MusicalEnvironment -> Boolean | ||
Sends chord MIDI messages using the information provided. | Sends chord MIDI messages using the information provided. | ||
Note other functions called in this function documented below. | Note other functions called in this function documented below. | ||
- | |||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.actions.sendChordMidiInfo(playerName, | e.actions.sendChordMidiInfo(playerName, | ||
Line 1470: | Line 1118: | ||
#### Parameter | #### Parameter | ||
- | |||
##### playerName | ##### playerName | ||
- | |||
The name of the player to be played | The name of the player to be played | ||
- | |||
###### b | ###### b | ||
- | |||
Beat | Beat | ||
- | |||
###### e | ###### e | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
##### Example | ##### Example | ||
- | |||
``` | ``` | ||
e.actions.sendChordMidiInfo(' | e.actions.sendChordMidiInfo(' | ||
Line 1490: | Line 1131: | ||
### superDirt/ | ### superDirt/ | ||
- | + | Object -> Number -> | |
- | Object -> Number -> | + | |
Plays the information of a player using superdirt | Plays the information of a player using superdirt | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
e.actions.superDirt(e.players.exampleMidiPlayer1, | e.actions.superDirt(e.players.exampleMidiPlayer1, | ||
Line 1502: | Line 1141: | ||
#### Parameter | #### Parameter | ||
- | |||
##### p | ##### p | ||
- | |||
Player | Player | ||
- | |||
##### b | ##### b | ||
- | |||
Beat | Beat | ||
#### Example | #### Example | ||
- | |||
``` | ``` | ||
e.actions.superDirt(e.players.exampleMidiPlayer1, | e.actions.superDirt(e.players.exampleMidiPlayer1, | ||
Line 1520: | Line 1154: | ||
#### getNoteInfoToSend | #### getNoteInfoToSend | ||
- | |||
Object -> Number -> Number -> Object | Object -> Number -> Number -> Object | ||
Line 1526: | Line 1159: | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
K.getNoteInfoToSend(player, | K.getNoteInfoToSend(player, | ||
Line 1532: | Line 1164: | ||
#### Parameter | #### Parameter | ||
- | |||
##### player | ##### player | ||
- | |||
Player that should be playing | Player that should be playing | ||
- | |||
##### b | ##### b | ||
- | |||
Beat | Beat | ||
- | |||
##### midiOutput | ##### midiOutput | ||
- | |||
The index of the array in e.midiOutputs. | The index of the array in e.midiOutputs. | ||
#### checkIfUseVerboseLogging | #### checkIfUseVerboseLogging | ||
- | |||
Object -> ... -> Boolean | Object -> ... -> Boolean | ||
Line 1552: | Line 1177: | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
K.checkIfUseVerboseLogging(player, | K.checkIfUseVerboseLogging(player, | ||
Line 1558: | Line 1182: | ||
#### Parameters | #### Parameters | ||
- | |||
##### players | ##### players | ||
- | |||
Player to check for verbose variable. | Player to check for verbose variable. | ||
- | |||
##### other things to log | ##### other things to log | ||
- | |||
There can be as many other arguments as the user wants and it will be logged in the console if player.verbose is true. | There can be as many other arguments as the user wants and it will be logged in the console if player.verbose is true. | ||
#### Example | #### Example | ||
- | |||
K.checkIfUseVerboseLogging(e.players.exampleMidiPlayer1, | K.checkIfUseVerboseLogging(e.players.exampleMidiPlayer1, | ||
### filterPolyphany | ### filterPolyphany | ||
- | |||
MusicalEnvironment -> Number -> Object -> Object -> Object | MusicalEnvironment -> Number -> Object -> Object -> Object | ||
Checks the maxPolyphany map for how many chords can be played at a specific beat. Notes over the polyphany limit will be dropped. | Checks the maxPolyphany map for how many chords can be played at a specific beat. Notes over the polyphany limit will be dropped. | ||
- | #### Syntax | + | #### Syntax |
``` | ``` | ||
K.filterPolyphany(e, | K.filterPolyphany(e, | ||
Line 1584: | Line 1201: | ||
#### Parameter | #### Parameter | ||
- | |||
##### e | ##### e | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
- | |||
##### b | ##### b | ||
- | |||
Beat | Beat | ||
- | |||
##### player | ##### player | ||
- | |||
Player to play | Player to play | ||
- | |||
##### info | ##### info | ||
- | |||
Information gotten from getNoteInfoToSend function | Information gotten from getNoteInfoToSend function | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
K.filterPolyphany(e, | K.filterPolyphany(e, | ||
Line 1608: | Line 1216: | ||
### filterMode | ### filterMode | ||
- | |||
Number -> MusicalEnvironment -> Number -> Object -> Number | Number -> MusicalEnvironment -> Number -> Object -> Number | ||
Line 1614: | Line 1221: | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
K.filterMode(note, | K.filterMode(note, | ||
Line 1620: | Line 1226: | ||
#### Parameter | #### Parameter | ||
- | |||
##### note | ##### note | ||
- | |||
Note to filter | Note to filter | ||
- | + | ##### e | |
- | ##### e | + | |
MusicalEnvironment | MusicalEnvironment | ||
- | |||
##### b | ##### b | ||
- | |||
Beat | Beat | ||
- | |||
##### player | ##### player | ||
- | |||
Player | Player | ||
#### Example | #### Example | ||
- | |||
``` | ``` | ||
K.filterMode(4, | K.filterMode(4, | ||
Line 1645: | Line 1242: | ||
### calculateFinalNoteValue | ### calculateFinalNoteValue | ||
- | |||
Object -> Object | Object -> Object | ||
Line 1651: | Line 1247: | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
K.calculateFinalNoteValue(info) | K.calculateFinalNoteValue(info) | ||
Line 1657: | Line 1252: | ||
#### Parameter | #### Parameter | ||
- | |||
##### info | ##### info | ||
- | |||
The object returned by getNoteInfoToSend. | The object returned by getNoteInfoToSend. | ||
#### Example | #### Example | ||
- | |||
``` | ``` | ||
K.calculateFinalNoteValue(K.getNoteInfoToSend(e.players.exampleMidiPlayer1, | K.calculateFinalNoteValue(K.getNoteInfoToSend(e.players.exampleMidiPlayer1, | ||
Line 1669: | Line 1261: | ||
### checkIfSendMidiControlChange | ### checkIfSendMidiControlChange | ||
- | |||
MusicalEnvironment -> Number -> Object -> | MusicalEnvironment -> Number -> Object -> | ||
Checks if player is supposed to send MIDI CC messages at the current beat and if yes sends the correct MIDI CC message. | Checks if player is supposed to send MIDI CC messages at the current beat and if yes sends the correct MIDI CC message. | ||
- | ### Syntax | + | ### Syntax |
``` | ``` | ||
K.checkIfSendMidiControlChange(e, | K.checkIfSendMidiControlChange(e, | ||
``` | ``` | ||
- | #### Parameters | + | #### Parameters |
##### e | ##### e | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
- | |||
##### b | ##### b | ||
- | |||
Beat | Beat | ||
- | |||
##### player | ##### player | ||
- | |||
Player | Player | ||
#### Example | #### Example | ||
- | |||
``` | ``` | ||
K.checkIfSendMidiControlChange(e, | K.checkIfSendMidiControlChange(e, | ||
Line 1701: | Line 1284: | ||
### findChannel | ### findChannel | ||
- | |||
Object -> Number -> MusicalEnvironment -> Number | Object -> Number -> MusicalEnvironment -> Number | ||
Checks which channel the player should be sending MIDI messages to. | Checks which channel the player should be sending MIDI messages to. | ||
- | |||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
K.findChannel(player, | K.findChannel(player, | ||
Line 1713: | Line 1293: | ||
#### Parameter | #### Parameter | ||
- | |||
##### Player | ##### Player | ||
- | |||
Player that should be checked | Player that should be checked | ||
- | |||
##### b | ##### b | ||
- | |||
Beat | Beat | ||
- | |||
##### e | ##### e | ||
- | |||
MusicalEnvironment | MusicalEnvironment | ||
#### Examples | #### Examples | ||
- | |||
``` | ``` | ||
K.findChannel(e.players.exampleMidiPlayer1, | K.findChannel(e.players.exampleMidiPlayer1, | ||
Line 1733: | Line 1306: | ||
### sendMidiData | ### sendMidiData | ||
- | |||
Object -> Object -> Number -> Number -> | Object -> Object -> Number -> Number -> | ||
Line 1739: | Line 1311: | ||
#### Syntax | #### Syntax | ||
- | |||
``` | ``` | ||
K.sendMidiData(info, | K.sendMidiData(info, | ||
Line 1745: | Line 1316: | ||
#### Parameters | #### Parameters | ||
- | |||
##### info | ##### info | ||
- | |||
Object returned from getNoteInfoToSend function. | Object returned from getNoteInfoToSend function. | ||
- | |||
##### player | ##### player | ||
- | |||
Player to check | Player to check | ||
- | |||
##### Channel | ##### Channel | ||
- | |||
Channel to send MIDI message to. | Channel to send MIDI message to. | ||
- | #### Examples | + | #### Examples |
``` | ``` | ||
K.sendMidiData(K.getNoteInfoToSend(e.players.exampleMidiPlayer1, | K.sendMidiData(K.getNoteInfoToSend(e.players.exampleMidiPlayer1, | ||
``` | ``` | ||
</ | </ |