Reference

This page lists the enums, helpers, attributes, and functions exposed by the current D compiler.

For a guided introduction, start with the first tutorial on Entities and Attributes.

Table of Contents

Reading the Reference

Enum values and helper members use qualified names such as Dynamics.mf, Triad.Major, and Meter.Beat(). Attributes of the current scope and batch functions that process it use the @ prefix. Entity-bound random functions use @Rnd; the top-level random generator uses #Rnd and is not bound to an entity. Each entry gives its type, unit where available, description, and callable overloads supplied by the compiler.

Small Examples

Combining Attributes

Attributes can be combined just as in the earlier tutorials. This example plays a D dorian scale while gradually increasing the velocity (how strong the note is hit).

function Main() {
  @span = 8;
  @key = 2;
  @mode = Mode.Dorian;
  @velocity = 0.45;
  @Split(8).Then(i => {
    @degree = i;
    @velocity += 0.5 * i.Relative;
  });
}
8.60 s

Combining Functions

Functions can be chained through Then. Here, Split creates four notes and Clone adds a quieter harmony note to each of them.

function Main() {
  @span = 8;
  @Split(4).Then(i => {
    @degree = i;
    @Clone().Then(() => {
      @degree += 2;
      @velocity *= 0.65;
    });
  });
}
8.60 s

Enums

23 enum values in the current compiler API.

Articulations

Articulations.Closed

Enum value · Articulations

Active closing or muting of a tone.

Brass and percussion instruments.

Articulations.Closing

Enum value · Articulations

Transition from an open (without artificial obstacles) to a closed tone.

Brass and percussion instruments.

Articulations.Marcato

Enum value · Articulations

Accented notes.

Articulations.Pizzicato

Enum value · Articulations

Plucking the strings directly with fingers.

Bowed strings only.

Articulations.PizzicatoSnap

Enum value · Articulations

Plucking the string away from the fingerboard with the right hand with sufficient force to cause it to snap back and strike the fingerboard creating a snapping sound in addition to the pitch itself.

Bowed strings only.

Articulations.Spiccato

Enum value · Articulations

A bowing technique with light bounces producing short tones.

Bowed strings only.

Articulations.Staccatissimo

Enum value · Articulations

Very short tone, technically the shortest possible.

Articulations.Staccato

Enum value · Articulations

Short tone, technically splitting the tone into a shorter copy and a pause.

Articulations.StaccatoMarcato

Enum value · Articulations

Accented staccato played with too much of air pressure.

Selected woodwinds only.

Articulations.Sustained

Enum value · Articulations

Long almost overlapping tones played rather flat.

Articulations.Tremolo

Enum value · Articulations

Trembling or rolling tones, e.g., for bowed strings typically achieved by short back and forth bow movements.

Articulations.Vibrato

Enum value · Articulations

Long tines with active addition of pitch pulsation, e.g. by little periodic movements of the fingers when pressing strings.

Dynamics

Dynamics.f

Enum value · Single

Forte.

Dynamics.ff

Enum value · Single

Fortissimo.

Dynamics.fff

Enum value · Single

Fortississimo.

Dynamics.mf

Enum value · Single

Mezzoforte.

Dynamics.mp

Enum value · Single

Mezzopiano.

Dynamics.p

Enum value · Single

Piano.

Dynamics.pp

Enum value · Single

Pianissimo.

Dynamics.ppp

Enum value · Single

Pianississimo.

Transition

Transition.Gain

Enum value · Transition

Smooth volume adjustment.

Transition.Legato

Enum value · Transition

Legato.

Transition.Velocity

Enum value · Transition

Smooth dynamics.

Helpers

48 helper members in the current compiler API.

Meter

Meter provides time constants and static functions for tempo, beats, measures, and spans.

Meter.Beat

Helper function · Double

Duration of a single beat (assuming constant tempo).

Overloads

  • Meter.Beat(EntityBase x) : Double

  • Meter.Beat(Double tempo, Int32 beatType) : Double

    • tempo (quarter per minute)

    • beatType — Time signature denominator.

Meter.FitBeats

Helper function · Int32

Approximate count of beats to cover the given time span (assuming constant tempo).

Approximate count of -beats to cover the given time span (assuming constant tempo).

Overloads

  • Meter.FitBeats(EntityBase x) : Int32

  • Meter.FitBeats(EntityBase x, Double duration) : Int32

    • duration (seconds)

  • Meter.FitBeats(Double tempo, Int32 beatType, Double duration) : Int32

    • tempo (quarter per minute)

    • beatType — Time signature denominator.

    • duration (seconds)

Meter.FitMeasures

Helper function · Int32

Approximate count of bars to cover the given time span (assuming constant tempo).

Overloads

  • Meter.FitMeasures(EntityBase x) : Int32

  • Meter.FitMeasures(EntityBase x, Double duration) : Int32

    • duration (seconds)

  • Meter.FitMeasures(Double tempo, Int32 beats, Int32 beatType, Double duration) : Int32

    • tempo (quarter per minute)

    • beats — Beats per measure.

    • beatType — Time signature denominator.

    • duration (seconds)

Meter.FitSpan

Helper function · Double

Approximate the duration required for the given amount of beats and tempo.

Overloads

  • Meter.FitSpan(EntityBase x) : Double

  • Meter.FitSpan(EntityBase x, Double tempo) : Double

    • tempo (quarter per minute)

  • Meter.FitSpan(Double tempo, Int32 beats, Int32 beatType) : Double

    • tempo (quarter per minute)

    • beats — Beats per measure.

    • beatType — Time signature denominator.

Meter.FitTempo

Helper function · Double

Approximate the tempo required for the given amount of beats to cover the duration.

Overloads

  • Meter.FitTempo(EntityBase x) : Double

  • Meter.FitTempo(EntityBase x, Double duration) : Double

    • duration (seconds)

  • Meter.FitTempo(Double duration, Int32 beats, Int32 beatType) : Double

    • duration (seconds)

    • beats — Beats per measure.

    • beatType — Time signature denominator.

Meter.Hour

Constant · Double

One hour converted to time units.

Meter.Measure

Helper function · Double

Duration of a single measure (assuming constant tempo).

Time span of a single measures (assuming constant tempo).

Overloads

  • Meter.Measure(EntityBase x) : Double

  • Meter.Measure(Double tempo, Int32 beats, Int32 beatType) : Double

    • tempo (quarter per minute)

    • beats — Beats per measure.

    • beatType — Time signature denominator.

Meter.Minute

Constant · Double

One minute converted to time units.

Meter.Quarter

Helper function · Double

Duration of a quarter note (assuming constant tempo).

Overloads

  • Meter.Quarter(EntityBase x) : Double

  • Meter.Quarter(Double tempo) : Double

    • tempo (quarter per minute)

Meter.Second

Constant · Double

One second converted to time units.

Triad

Triad provides chord constants represented as int[] arrays.

Triad.Augmented

Constant · int[]

An augmented triad.

Triad.Diminished

Constant · int[]

A diminished triad.

Triad.Major

Constant · int[]

A major triad.

Triad.Minor

Constant · int[]

A minor triad.

Seventh

Seventh provides chord constants represented as int[] arrays.

Seventh.Augmented

Constant · int[]

An augmented seventh chord.

Seventh.AugmentedMajor

Constant · int[]

An augmented major seventh chord.

Seventh.Diminished

Constant · int[]

A diminished seventh chord.

Seventh.DiminishedMajor

Constant · int[]

A diminished major seventh chord.

Seventh.Dominant

Constant · int[]

A dominant seventh chord.

Seventh.DominantFlatFive

Constant · int[]

A dominant flat five seventh chord.

Seventh.HalfDiminished

Constant · int[]

A half diminished seventh chord.

Seventh.Major

Constant · int[]

A major seventh chord.

Seventh.MajorFlatFive

Constant · int[]

A major flat five seventh chord.

Seventh.Minor

Constant · int[]

A minor seventh chord.

Seventh.MinorMajor

Constant · int[]

A minor major seventh chord.

Slicing

Slicing helpers describe absolute, relative, and fill portions passed to batch functions such as @Split.

ABS

Helper function · SlicePart

Create a new SlicePart with exact duration.

Overloads

  • ABS(Double size) : SlicePart

    • size (second)

  • ABS(ƒ<Double> size) : SlicePart

    • size (second)

  • ABS(ƒ<Single> size) : SlicePart

    • size (second)

  • ABS(ƒ<Int32> size) : SlicePart

    • size (second)

FILL

Helper function · SlicePart

Create a new SlicePart with a duration relative to other FILLs.

FILLs occupy the space available after placing all ABS and REL parts. In case there is no more space left, the FILLs get omitted.

Overloads

  • FILL(Double size) : SlicePart

  • FILL(ƒ<Double> size) : SlicePart

  • FILL(ƒ<Single> size) : SlicePart

  • FILL(ƒ<Int32> size) : SlicePart

REL

Helper function · SlicePart

Create a new SlicePart with a duration relative to the parent duration.

Overloads

  • REL(Double size) : SlicePart

    • size (ratio of the parent duration)

  • REL(ƒ<Double> size) : SlicePart

    • size (ratio of the parent duration)

  • REL(ƒ<Single> size) : SlicePart

    • size (ratio of the parent duration)

  • REL(ƒ<Int32> size) : SlicePart

    • size (ratio of the parent duration)

Chord

Chord.Base

Constant · Chord

The single base tone. This is the default value for each entity.

Chord.Count

Constant · Int32

Number of tones in this chord.

Chord.Dyad

Constant · Chord

The base tone along with a third above.

Chord.Eleventh

Constant · Chord

The base along with 3rd, 5th, 7th, 9th and 11th above.

Chord.Has

Helper function · Boolean

Checks whether the chord contains the given tone.

Call

  • Chord.Has(Int32 index) : Boolean

Chord.IsChord

Helper function · Boolean

Indicates whether there are any tones in the chord. Otherwise it is a rest.

Call

  • Chord.IsChord() : Boolean

Chord.IsRest

Helper function · Boolean

Indicates whether there are any tones in the chord. Otherwise it is a rest.

Call

  • Chord.IsRest() : Boolean

Chord.Ninth

Constant · Chord

The base along with 3rd, 5th, 7th and 9th above.

Chord.Rest

Constant · Chord

No tone played at all.

Chord.Seventh

Constant · Chord

The base along with third, fifth and seventh above.

Chord.Triad

Constant · Chord

The base tone along with a third and fifth above.

Mode

Mode.Aeolian

Constant · Mode

Aeolian / minor (-3).

Mode.Dorian

Constant · Mode

Dorian (-2).

Mode.Ionian

Constant · Mode

Ionian / major (0).

Mode.Locrian

Constant · Mode

Locrian (-5).

Mode.Lydian

Constant · Mode

Lydian (+1).

Mode.Major

Constant · Mode

Major / ionian (0).

Mode.Minor

Constant · Mode

Minor / aeolian (-3).

Mode.Mixolydian

Constant · Mode

Mixolydian (-1).

Mode.Phrygian

Constant · Mode

Phrygian (-4).

Attributes

38 attributes in the current compiler API.

@alter

Attribute · SByte · chromatic

Adds a chromatic offset to the diatonic degree.

Note that this is a hacky way to get semitones outside of the current key. Make sure you use modulation as musch as possible.

@articulation

Attribute · Articulations

Articulation of the instrument, the way it is played. E.g. staccato, pizzicato, tremolo.

Different instruments have different default articulations. Usually it is sustained and vibrato, if available.

@attack

Attribute · Single · second

Duration from silence to full gain.

Overrides the default envelope of the respective instrument.

@beatType

Attribute · Byte · beat note type

Metre denominator (e.g. 2, 4, 8)

@beats

Attribute · Byte · beats per bar

Count of beats per bar

@chord

Attribute · Chord

A set of tones to be played for this entity.

By default the set is (0), i.e. only the direct degree will be played.

Try it out: An augmented harmonic progression.

function Main() {
    var h = [3, 1, 4, 0];
    @span = 4;
    @chord = Chord.Triad;
    @Split(4).Then(i => @harmony = h[i]); //IV, II, V, I
    @Split().Then(i => {
        if (i.IsLast) ++@alter; //raise the top note by a semitone
    });
}

@color

Attribute · String

Color for rendering this entity.

Any html valid color format like #abc, #a0b1c2, rgb(10,20,30), etc.

@decay

Attribute · Single · second

Duration from full gain to the sustain level.

Overrides the default envelope of the respective instrument.

@degree

Attribute · SByte · diatonic

Index of the tone within the given harmonic function and key.

Try it out: Five notes starting at subdominant of C major.

function Main() {
    @span = 3;
    @harmony = 3; //IV subdominant
    @Split(5).Then(i => @degree = i); //F, G, A, H, C
}

@delay

Attribute · Single · second

Plays the sample later (or earlier if negative) as notated.

In the notes view and in the piano roll the note still appears correctly timed.

Try it out: Playing with imperfect rhtythm

function Main() {
    @span = 4;
    @Split(8).Then(i => {@degree = i; @delay = @Rnd.Float(-0.1, 0.3); });
}

@gain

Attribute · Single · factor

Loudness factor of the entity.

Non-negative, by default 1. Applied at the very end as an effect, does not affect the timbre.

Try it out: Increasing gain.

function Main() {
    @span = 10;
    @Split(20).Then(i => @gain = i.Relative);
}

@harmony

Attribute · SByte · diatonic

Index of the harmonic function within the given key.

Try it out: A simple harmonic progression.

function Main() {
    var h = [3, 1, 4, 0];
    @span = 4;
    @chord = Chord.Triad;
    @Split(4).Then(i => @harmony = h[i]); //IV, II, V, I
}

@instrument

Attribute · String

Name of the instrument to be played.

@inversion

Attribute · SByte

Chord inversion.

The base form is 0. Every higher inversion moves the lowest chord tone an octave higher. Everly lower inversion moves the highest chord tone an octave lower.

@key

Attribute · SByte · chromatic

Key offset, e.g. D♭ would be 1.

Try it out: A triad in three keys, always a semitone higher.

function Main() {
    @span = 4;
    @chord = Chord.Triad;
    @Split(3).Then(i => @key = i); //key shift 3x
    @Split(); //breaks up the chord
}

@language

Attribute · String

Name of the TTS model.

For details see https://github.com/rhasspy/piper/blob/master/VOICES.md, but not all of the models are available.

@mode

Attribute · Mode · a fourth step

Mode of the key.

For diatonic scales ionian (major) is the default mode. Each increment adds a # (following the circle of 4ths for the common diatonic scale), each decrement adds a ♭. Swtiching to from the major to the minor (aeolian) mode requires to subtract 3. A full chromatic key step can be achieved by adding or subtracting 7.

@octave

Attribute · SByte · octave

Octave base for the tone (ranged 0 to 8).

Try it out: C in all nine octaves.

function Main() {
    @span = 9;
    @Split(9).Then(i => @octave = i);
}

@ramp

Attribute · Ramp

Ramp function for transitions between gain levels in the envelope.

Either Ramp.Linear or Ramp.Exp (default).

@randomized

Attribute · Boolean

Randomization of duplicates, by default true.

Applies to children entities produced by split, slices, repeats, multiple calls of a custom function within an expression and similar. Without randomization they all inherit the same random seed producing the same values.

Try it out: Forcing identity after a split.

function Main() {
    @span = 10;
    @randomized = false; //turning off to obtain 4 identical entities
    @Split(4);
    @randomized = true; //turning on again to obtain a randomized ostinato
    @Split(6).Then(i => @degree = @Rnd.Int(-3, 5));
}

@release

Attribute · Single · second

Duration from the sustain level to silence.

Overrides the default envelope of the respective instrument. Release is by default not counted into the entity span, use alignment to change that.

@releaseAlignment

Attribute · Single · factor

Aligns the release part either after the entity (default = 1), or moves it earlier.

A continuous factor from -1 to 1. At -1 the whole release part is part of the entity span, at 0 the half of it and at 1 the release only starts at entity span (default).

@reversed

Attribute · Reverse

Reversed sample effect. No reverse by default.

Reverse.Forward keeps the sample as is. Reverse.Simple just reverses the sample, Reverse.Full also reverses its envelope.

@scale

Attribute · Scale

Scale as subset of chromatic tones.

Given as a mask, by default a diatonic scale.

@section

Attribute · Byte

Section index (e.g. 1 for first violins).

The default 0 and 1 are equal. If a section recording does not exist the highes available index is used.

@seed

Attribute · UInt64

Seed of the random numbers generator.

By default the seed is initialized from the current time.

Try it out: Deterministic seed.

function Main() {
    @span = 10;
    @seed = 27;
    @Split(20);
    //the constant seed above generates the very same sequence in every each run
    @degree = @Rnd.Int(-5, 5);
}

@skip

Attribute · Single · second

Skips an initial portion of the sample.

The note timing and duration are preserved, just the sample internally shifts earlier in time.

Try it out: Skipping the moment when the hammer hits the string

function Main() {
    @span = 4;
    @skip = 1;
    @Split(4).Then(i => @degree = i);
}

@span

Attribute · Single · second

Duration of this entity

Try it out: A simple split would normally create a sequence of equal duration. In this example each entity is shortened to half of its original duration.

function Main() {
    @instrument = "viola";
    @span = 4;
    @Split(4).Then(i => @span *= 0.5);
}

@sustain

Attribute · Single · factor

The sustained gain level expresses as a factor of the full gain.

Overrides the default envelope of the respective instrument. Duration of the sustain = span - attack - decay

@syllable

Attribute · Syllable

Syllable selection. Applies only to vocals.

@temperament

Attribute · Byte

Equal temperament divides the octave into a number of regular intervals. By default these are the 12 semitones. Values up to 64 are possible.

Changing the default value allows the exploration of microtonalities.

@tempo

Attribute · Single · quarters per minute

Count of quarter notes played per minute

@text

Attribute · String

Text to be spoken by a text-to-speech synthesizer.

@time

Attribute · Single · second

Time when this entity starts to play

The song starts at 0, but negative time is possible as well (e.g. using @Prepend). If entities with negative time values are present, a post processing step shifts them all, so that the first entity starts at 0.

Try it out: A split would normally create a sequence of entities that is continuous in time. In this example we postpone each entity for later and the shift increases.

function Main() {
    @span = 4;
    @Split(4).Then(i => @time += i * 0.5);
}

@track

Attribute · Byte

Instrument track, usefull when an instrument plays several unaligned notes at once or to divide a section.

Track is always bound to the instrument identifier. So track 1 for violins is a different one as for cellos.

@transitions

Attribute · TransitionsData

Control of smooth transitions that span over several notes.

Includes smooth dynamics, volume adjustment and legato.

@tutti

Attribute · Boolean

Solo instrument or the Whole section.

Instruments play solo by default (if a solo sample is available). Activating tutti will trigger the whole section.

@velocity

Attribute · VelocityData · factor

Intensity of the instrument.

Non-negative, by default 0.7. Different levels change the timbre.

Try it out: Increasing velocity.

function Main() {
    @span = 10;
    @Split(20).Then(i => @velocity = i.Relative);
}

Functions

57 functions in the current compiler API.

Batch functions

Batch functions process the entities in the current scope and use the @ prefix.

@Aggregate

Function · T

Aggregates over the entities in the current scope.

Overloads

  • @Aggregate(Func<T, Music, T> fn) : T

    • fn — Aggregation function

  • @Aggregate(Func<T, Music, Int32, T> fn) : T

    • fn — Aggregation function

  • @Aggregate(Func<T, Music, T> fn, T init) : T

    • fn — Aggregation function

    • init — Initial value of the aggregator

  • @Aggregate(Func<T, Music, Int32, T> fn, T init) : T

    • fn — Aggregation function

    • init — Initial value of the aggregator

@Append

Function · MusicPromise

For each entity in the current scope it creates a new entity of the same duration as the original and appends it right after the original entity.

Both the appended as well as the original entity are returned at output. Any Then() transformers will be only applied to the appended content.

Creates a new entity of a given duration and appends it right after each entity of the current scope.

Appends the given entities right after each entity of the current scope.

All the appended as well as the original entity are returned at output. Any Then() transformers will be only applied to the appended content.

Overloads

  • @Append() : MusicPromise

  • @Append(Func<Entity, Single> duration) : MusicPromise

    • duration — Duration of the appended entity. If omited, the span of the original entity is taken. (second)

  • @Append(Func<Entity, Double> duration) : MusicPromise

    • duration — Duration of the appended entity. If omited, the span of the original entity is taken. (second)

  • @Append(Double duration) : MusicPromise

    • duration — Duration of the appended entity. If omited, the span of the original entity is taken. (second)

  • @Append(Music input, Func<Entity, Music> content) : MusicPromise

    • content — Entities to be appended.

  • @Append(Music input, Music content) : MusicPromise

    • content — Entities to be appended.

@AppendOnce

Function · MusicPromise

Creates a new entity of a given duration and appends it right after the last entity of the current scope.

Both the appended as well as the original entity are returned at output. Any Then() transformers will be only applied to the appended content.

Appends the content right after the last entity of the current scope.

All the appended as well as the original entity are returned at output. Any Then() transformers will be only applied to the appended content.

Overloads

  • @AppendOnce() : MusicPromise

  • @AppendOnce(Music input, Func<Entity, Double> duration) : MusicPromise

  • @AppendOnce(Music input, Double duration) : MusicPromise

  • @AppendOnce(Music content) : MusicPromise

@Arpeggio

Function · MusicPromise

Plays the chord by adding and holding one note after each other in ascending direction.

The notes are added in regular intervals to cover the whole span of the chord. This is just an alias for ArpeggioUp.

The notes are added in regular intervals of the given duration. This is just an alias for ArpeggioUp.

Overloads

  • @Arpeggio() : MusicPromise

  • @Arpeggio(Func<Entity, Single> duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

  • @Arpeggio(Func<Entity, Double> duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

  • @Arpeggio(Double duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

@ArpeggioDown

Function · MusicPromise

Plays the chord by adding and holding one note after each other in descending direction.

The notes are added in regular intervals to cover the whole span of the chord.

The notes are added in regular intervals of the given duration.

Overloads

  • @ArpeggioDown() : MusicPromise

  • @ArpeggioDown(Func<Entity, Single> duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

  • @ArpeggioDown(Func<Entity, Double> duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

  • @ArpeggioDown(Double duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

@ArpeggioUp

Function · MusicPromise

Plays the chord by adding and holding one note after each other in ascending direction.

The notes are added in regular intervals to cover the whole span of the chord.

The notes are added in regular intervals of the given duration.

Overloads

  • @ArpeggioUp() : MusicPromise

  • @ArpeggioUp(Func<Entity, Single> duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

  • @ArpeggioUp(Func<Entity, Double> duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

  • @ArpeggioUp(Double duration) : MusicPromise

    • duration — Duration after which the next note is added. (second)

@Axiom

Function · MusicPromise

Creates a new default entity.

Call

  • @Axiom() : MusicPromise

@Chromatic

Function · Music

Switch to the chromatic scale to perform atonal composition.

Overloads

  • @Chromatic() : Music

  • @Chromatic(Func<Entity, int[]> chordConst) : Music

    • chordConst — Override chord by a quality constant: Triad or Seventh.

  • @Chromatic(int[] chordConst) : Music

    • chordConst — Override chord by a quality constant: Triad or Seventh.

  • @Chromatic(Func<Entity, Chord> chord) : Music

    • chord — Override chord

  • @Chromatic(Func<Entity, Int32[]> chord) : Music

    • chord — Override chord

  • @Chromatic(Chord chord) : Music

    • chord — Override chord

  • @Chromatic(Int32[] chord) : Music

    • chord — Override chord

@Clone

Function · MusicPromise

Copies the entity several times. Also keeps the original. Any Then transformation is applied only to the clones, not to the original.

All entities share the same properties, except for the random seed which is uniqe.

Count of the returned entites is by one higher than the count specified in the function call. All entities share the same properties, except for the random seed which is uniqe.

Count of the returned entites is by one higher than the count of transforms. All entities share the same properties, except for the random seed which is uniqe.

Copies the entity with new instrument assignment. The original is kept as well. The Then transformation is applied only to the produced copies, not to the original.

Count of new copies is given by the count of instruments. All entities share the same properties, except for the random seed which is unique and instrument is assigned from the input collection.

Overloads

  • @Clone() : MusicPromise

  • @Clone(Func<Entity, Int32> count) : MusicPromise

    • count — Number of the cloned parts, initialized to 1. Note that this count excludes the original that is returned along, so the number of returned entities is always by one higher than count.

  • @Clone(Int32 count) : MusicPromise

    • count — Number of the cloned parts, initialized to 1. Note that this count excludes the original that is returned along, so the number of returned entities is always by one higher than count.

  • @Clone(params Func<Music, Music>[] transforms) : MusicPromise

    • transforms — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Clone(params Func<Music, Indexer, Music>[] transforms) : MusicPromise

    • transforms — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Clone(Func<Entity, IList<Func<Music, Music>>> transforms) : MusicPromise

    • transforms — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Clone(Func<Entity, IList<Func<Music, Indexer, Music>>> transforms) : MusicPromise

    • transforms — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Clone(IList<Func<Music, Music>> transforms) : MusicPromise

    • transforms — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Clone(IList<Func<Music, Indexer, Music>> transforms) : MusicPromise

    • transforms — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Clone(params String[] instruments) : MusicPromise

    • instruments — A list of instruments. Each will be applied only to its corresponding entity.

  • @Clone(Func<Entity, IList<String>> instruments) : MusicPromise

    • instruments — A list of instruments. Each will be applied only to its corresponding entity.

  • @Clone(IList<String> instruments) : MusicPromise

    • instruments — A list of instruments. Each will be applied only to its corresponding entity.

@Count

Function · Int32

Count of entities within the current scope.

Call

  • @Count() : Int32

@Done

Function · Music

The entity is set to be done, i.e. terminal. No more command will affect it.

Call

  • @Done() : Music

@Duration

Function · Single · seconds

Duration of entities within the current scope.

Call

  • @Duration() : Single

@Motive

Function · MusicPromise

Splits the entity to occupy the given melody.

Splits the entity to occupy the given harmony and melody.

Overloads

  • @Motive(Func<Entity, IList<Int32>> melody) : MusicPromise

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<SByte>> melody) : MusicPromise

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<Int32> melody) : MusicPromise

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<SByte> melody) : MusicPromise

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<Int32>> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<SByte>> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<Int32>> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<SByte>> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<Int32>> harmony, IList<SByte> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<Int32> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<Int32> harmony, IList<SByte> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<SByte>> harmony, IList<Int32> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<SByte> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<SByte> harmony, IList<Int32> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<Int32>> harmony, IList<Int32> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<Int32> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<Int32> harmony, IList<Int32> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, IList<SByte>> harmony, IList<SByte> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<SByte> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(IList<SByte> harmony, IList<SByte> melody) : MusicPromise

    • harmony — Harmony progression for the motive. Both arrays must be of same length.

    • melody — Melody degrees as offsets to the harmony progression. Both arrays must be of same length.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Rhythm rhythm, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Rhythm rhythm, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Rhythm rhythm, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Rhythm rhythm, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody.

    • melody — Melody degrees. Must be the same length as rhythm.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<Int32>> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<SByte>> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<Int32>> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<SByte>> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<Int32>> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<Int32> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<Int32> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<Int32>> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<Int32>> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<Int32> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<Int32> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<SByte>> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<SByte> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<SByte> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<SByte>> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<SByte>> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<SByte> harmony, Func<Entity, IList<Int32>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<SByte> harmony, IList<Int32> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<Int32>> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<Int32> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<Int32> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<Int32>> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<Int32>> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<Int32> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<Int32> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, Func<Entity, IList<SByte>> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<SByte> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Func<Entity, Rhythm> rhythm, IList<SByte> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<SByte>> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, Func<Entity, IList<SByte>> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<SByte> harmony, Func<Entity, IList<SByte>> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

  • @Motive(Rhythm rhythm, IList<SByte> harmony, IList<SByte> melody) : MusicPromise

    • rhythm — A rhythm defining note lengths. Must be the same length as melody and harmony.

    • harmony — Harmony progression for the motive. Must be the same length as rhythm and melody.

    • melody — Melody degrees as offsets to the harmony progression. Must be the same length as rhythm and harmony.

@Prepend

Function · MusicPromise

For each entity in the current scope it creates a new entity of the same duration as the original and prepends it right before the original entity.

Both the prepended as well as the original entity are returned at output. Any Then() transformers will be only applied to the prepended content.

Creates a new entity of a given duration and prepends it right before each entity of the current scope.

Prepends the given entities right before each entity of the current scope.

All the prepended as well as the original entity are returned at output. Any Then() transformers will be only applied to the prepended content.

Overloads

  • @Prepend() : MusicPromise

  • @Prepend(Music input, Func<Entity, Single> duration) : MusicPromise

  • @Prepend(Music input, Func<Entity, Double> duration) : MusicPromise

  • @Prepend(Music input, Double duration) : MusicPromise

  • @Prepend(Func<Entity, Music> content) : MusicPromise

    • content — Entities to be prepended.

  • @Prepend(Music content) : MusicPromise

    • content — Entities to be prepended.

@PrependOnce

Function · MusicPromise

Creates a new entity and prepends it right before the first entity of the current scope.

Both the prepended as well as the original entity are returned at output. Any Then() transformers will be only applied to the prepended content.

Creates a new entity of a given duration and prepends it right before the first entity of the current scope.

Prepends the given entities right before the first entity of the current scope.

All the prepended as well as the original entity are returned at output. Any Then() transformers will be only applied to the prepended content.

Overloads

  • @PrependOnce() : MusicPromise

  • @PrependOnce(Music input, Func<Entity, Double> duration) : MusicPromise

  • @PrependOnce(Music input, Double duration) : MusicPromise

  • @PrependOnce(Music input, Music content) : MusicPromise

@Replace

Function · MusicPromise

Replaces the entity by a whole Music instance.

Overloads

  • @Replace(Func<Entity, Music> content) : MusicPromise

    • content — A Music instance with entities to be inserted.

  • @Replace(Music content) : MusicPromise

    • content — A Music instance with entities to be inserted.

@Rest

Function · Music

Converts the entity into a rest.

A rest keeps all its properties, but chord which is set to an empty set.

Call

  • @Rest() : Music

@Scope

Function · MusicPromise

Extracts the current scope.

Passes the given scope to the transformer.

The transformer is applied to the provided scope instead of the default scope.

Overloads

  • @Scope() : MusicPromise

  • @Scope(Music scope) : MusicPromise

@Select

Function · Entity[] | T[]

Extracts all entities from the current scope.

The extracted data is returned in a new array.

Extracts data from the current scope of entities.

Overloads

  • @Select() : Entity[]

  • @Select(Func<Music, T> fn) : T[]

  • @Select(Func<Music, Int32, T> fn) : T[]

@Slice

Function · MusicPromise

Copies the entity several times. The original gets removed. Any Then transformation is applied to all produced copies.

All entities share the same properties, except for the random seed which is unique.

Vertical division of a chord producing a new entity for each tone of the chord. Any Then transformation is applied to all produced copies.

All entities share the same properties, except for the degree which is derived from the chord and random seed which is unique.

Count of copies is given by the count of transforms. All entities share the same properties, except for the random seed which is unique.

Copies the entity with new instrument assignment. The original gets removed. Any Then transformation is applied to all produced copies.

Count of copies is given by the count of instruments. All entities share the same properties, except for the random seed which is unique and instrument is assigned from the input collection.

Overloads

  • @Slice(Func<Entity, Int32> count) : MusicPromise

    • count — Number of copies to produce.

  • @Slice(Int32 count) : MusicPromise

    • count — Number of copies to produce.

  • @Slice() : MusicPromise

  • @Slice(params Func<Music, Music>[] transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Slice(params Func<Music, Indexer, Music>[] transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Slice(Func<Entity, IList<Func<Music, Music>>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Slice(Func<Entity, IList<Func<Music, Indexer, Music>>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Slice(IList<Func<Music, Music>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Slice(IList<Func<Music, Indexer, Music>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Slice(params String[] instruments) : MusicPromise

    • instruments — A list of instruments. Each will be applied only to its corresponding entity.

  • @Slice(Func<Entity, IList<String>> instruments) : MusicPromise

    • instruments — A list of instruments. Each will be applied only to its corresponding entity.

  • @Slice(IList<String> instruments) : MusicPromise

    • instruments — A list of instruments. Each will be applied only to its corresponding entity.

@Split

Function · MusicPromise

Divides a chord into a sequence of ascending notes.

The resulting entities are of equal duration. Together they cover the whole timespan of the input entity.

Divides an entity into a sequence of shorter entities.

Spans of the resulting entities are of equal duration. Together they cover the whole timespan of the input entity.

Spans of the resulting entities correspond to the relative durations of the rhythm beats. Together they cover the whole timespan of the input entity.

Spans of the resulting entities are given using a sequence of ABS, REL and FILL parts. Together they cover the whole timespan of the input entity.

Count of the resulting entities is given by the number of transforms. Resulting entities are of equal length. Together they cover the whole timespan of the input entity.

Overloads

  • @Split() : MusicPromise

  • @Split(Func<Entity, Int32> count) : MusicPromise

    • count — Specifies the count of resulting entities.

  • @Split(Int32 count) : MusicPromise

    • count — Specifies the count of resulting entities.

  • @Split(Func<Entity, IList<Single>> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(params Single[] relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(Func<Entity, Int32[]> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(Func<Entity, IList<Int32>> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(IList<Func<EntityBase, Int32>> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(Func<Entity, IList<Double>> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(IList<Single> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(Int32[] relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(IList<Int32> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(IList<Double> relativeDurations) : MusicPromise

    • relativeDurations — Specifies the count of resulting entities and their relative durations.

  • @Split(Func<Entity, Rhythm> rhythm) : MusicPromise

    • rhythm — Rhythm with relative tone lengths to be used for the split.

  • @Split(Rhythm rhythm) : MusicPromise

    • rhythm — Rhythm with relative tone lengths to be used for the split.

  • @Split(params SlicePart[] durations) : MusicPromise

    • durations — Relative durations of the split parts.

  • @Split(Func<Entity, IList<SlicePart>> durations) : MusicPromise

    • durations — Relative durations of the split parts.

  • @Split(IList<Func<Entity, SlicePart>> durations) : MusicPromise

    • durations — Relative durations of the split parts.

  • @Split(params Func<Entity, SlicePart>[] durations) : MusicPromise

    • durations — Relative durations of the split parts.

  • @Split(IList<SlicePart> durations) : MusicPromise

    • durations — Relative durations of the split parts.

  • @Split(params Func<Music, Music>[] transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Split(params Func<Music, Indexer, Music>[] transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Split(Func<Entity, IList<Func<Music, Music>>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Split(Func<Entity, IList<Func<Music, Indexer, Music>>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Split(IList<Func<Music, Music>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

  • @Split(IList<Func<Music, Indexer, Music>> transform) : MusicPromise

    • transform — A list of subroutines. Each will be applied only to its corresponding entity.

@Where

Function · List<Entity>

Filters the current scope of entities by a predicate.

The scope itself is not modified, The filtered list is returned separately.

Overloads

  • @Where(Predicate<Entity> fn) : List<Entity>

  • @Where(Func<Entity, Int32, Boolean> fn) : List<Entity>

Random functions

These functions use the random number generator of the current entity and are accessed through @Rnd.

@Rnd.Bool

Function · Boolean

A random boolean value.

Call

  • @Rnd.Bool() : Boolean

@Rnd.BoolVec

Function · Boolean[]

An array of random Boolean values.

Call

  • @Rnd.BoolVec(Int32 count) : Boolean[]

@Rnd.Choice

Function · T

A random choice of several options.

Overloads

  • @Rnd.Choice(List<T> options) : T

  • @Rnd.Choice(params T[] options) : T

  • @Rnd.Choice(ReadOnlySpan<T> options) : T

@Rnd.Float

Function · Single

A random 32-bit float value with inclusive bounds.

Overloads

  • @Rnd.Float(Double lowerInclusive, Double upperInclusive) : Single

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Float(SignedRangeInt range) : Single

    • range — Inclusive range.

  • @Rnd.Float(SignedRangeDouble range) : Single

    • range — Inclusive range.

@Rnd.Int

Function · Int32

A random signed 32-bit integer value.

A random signed 32-bit integer value with inclusive bounds.

Overloads

  • @Rnd.Int() : Int32

  • @Rnd.Int(Int32 lowerInclusive, Int32 upperInclusive) : Int32

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Int(SignedRangeInt range) : Int32

    • range — Inclusive range.

@Rnd.IntVec

Function · Int32[]

An array of random signed 32-bit integers.

Call

  • @Rnd.IntVec(Int32 count) : Int32[]

    • count — Number of integers to generate.

@Rnd.Mode

Function · Mode

A random mode value for musical keys.

A random mode value for musical keys with an inclusive upper bound.

A random mode value for musical keys with inclusive bounds.

Overloads

  • @Rnd.Mode() : Mode

  • @Rnd.Mode(Mode upperInclusive) : Mode

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Mode(Int32 upperInclusive) : Mode

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Mode(Mode lowerInclusive, Mode upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Mode(Int32 lowerInclusive, Mode upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Mode(Mode lowerInclusive, Int32 upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • @Rnd.Mode(Int32 lowerInclusive, Int32 upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

@Rnd.Num

Function · T

A generic random number (up to 128 bits).

Call

  • @Rnd.Num(SignedRange<T> range) : T

@Rnd.Partition

Function · Int32[] | Single[]

Random partition of a number into several positive parts.

Overloads

  • @Rnd.Partition(Int32 sum, Int32 count, SignedRangeInt range = null) : Int32[]

    • sum — The number to partition.

    • count — The number of partitions.

    • range — Minimum and maximum item size, must be positive.

  • @Rnd.Partition(Double sum, Int32 count, SignedRangeDouble range = null) : Int32[]

    • sum — The number to partition.

    • count — The number of partitions.

    • range — Minimum and maximum item size, must be positive.

@Rnd.PositiveFloat

Function · Single

A random positive 32-bit float value.

Mathematics defines positive as larger than zero, but here we include it.

A random 32-bit float value with an inclusive upper bound.

Overloads

  • @Rnd.PositiveFloat() : Single

  • @Rnd.PositiveFloat(Double upperInclusive) : Single

    • upperInclusive — Inclusive upper bound.

@Rnd.PositiveInt

Function · Int32

A random signed 32-bit integer value larger than -1.

Mathematics defines positive as larger than zero, but here we include it.

A random positive signed 32-bit integer value with an inclusive upper bound.

Overloads

  • @Rnd.PositiveInt() : Int32

  • @Rnd.PositiveInt(Int32 upperInclusive) : Int32

    • upperInclusive — Inclusive upper bound.

@Rnd.PositiveIntVec

Function · Int32[]

An array of random signed 32-bit integers larger than -1.

Call

  • @Rnd.PositiveIntVec(Int32 count) : Int32[]

    • count — Number of integers to generate.

@Rnd.Shuffle

Function · List<T> | T[] | Int32[]

Random ordering of the provided list.

Random ordering of the provided array.

Random ordering of the provided integer range. Both ends inclusive.

Overloads

  • @Rnd.Shuffle(List<T> collection) : List<T>

    • collection — A list of items to shuffle.

  • @Rnd.Shuffle(params T[] collection) : List<T>

    • collection — An array of items to shuffle.

  • @Rnd.Shuffle(SignedRangeInt range) : Int32[]

    • range — A range to shuffle. Both ends are inclusive.

@Rnd.Subset

Function · List<T> | T[] | Int32[]

Random selection from the collection. Maintains order.

Overloads

  • @Rnd.Subset(Int32 count, List<T> collection) : List<T>

    • count — Number of elements to choose.

    • collection — A list of elements to choose from.

  • @Rnd.Subset(Int32 count, T[] collection) : List<T>

    • count — Number of elements to choose.

    • collection — An array of elements to choose from.

  • @Rnd.Subset(Int32 count, SignedRangeInt range) : Int32[]

    • count — Number of elements to choose.

    • range — Range of elements to choose from, both ends are inclusive.

@Rnd.UInt

Function · UInt32

A random unsigned 32-bit integer value.

A random unsigned 32-bit integer value with inclusive bounds.

Overloads

  • @Rnd.UInt() : UInt32

  • @Rnd.UInt(UInt32 lowerInclusive, UInt32 upperInclusive) : UInt32

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • @Rnd.UInt(SignedRangeInt range) : UInt32

    • range — Inclusive range, clamped to [0, int32.MaxValue].

@Rnd.ULong

Function · UInt64

A random unsigned 64-bit integer value.

A random unsigned 64-bit integer value with an inclusive upper bound.

A random unsigned 64-bit integer value with inclusive bounds.

Overloads

  • @Rnd.ULong() : UInt64

  • @Rnd.ULong(UInt64 upperInclusive) : UInt64

    • upperInclusive — Inclusive upper bound.

  • @Rnd.ULong(UInt64 lowerInclusive, UInt64 upperInclusive) : UInt64

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

@Rnd.UnitFloat

Function · Single

A random 32-bit float value in the range of 0 to 1.

Call

  • @Rnd.UnitFloat() : Single

Global random functions

These functions use the top-level random number generator and are accessed through #Rnd; they are not bound to an entity.

#Rnd.Bool

Function · Boolean

A random boolean value.

Call

  • #Rnd.Bool() : Boolean

#Rnd.BoolVec

Function · Boolean[]

An array of random Boolean values.

Call

  • #Rnd.BoolVec(Int32 count) : Boolean[]

#Rnd.Choice

Function · T

A random choice of several options.

Overloads

  • #Rnd.Choice(params T[] options) : T

  • #Rnd.Choice(List<T> options) : T

  • #Rnd.Choice(ReadOnlySpan<T> options) : T

#Rnd.Float

Function · Single

A random 32-bit float value with inclusive bounds.

Overloads

  • #Rnd.Float(Double lowerInclusive, Double upperInclusive) : Single

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Float(SignedRangeInt range) : Single

    • range — Inclusive range.

  • #Rnd.Float(SignedRangeDouble range) : Single

    • range — Inclusive range.

#Rnd.Int

Function · Int32

A random signed 32-bit integer value.

A random signed 32-bit integer value with inclusive bounds.

Overloads

  • #Rnd.Int() : Int32

  • #Rnd.Int(Int32 lowerInclusive, Int32 upperInclusive) : Int32

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Int(SignedRangeInt range) : Int32

    • range — Inclusive range.

#Rnd.IntVec

Function · Int32[]

An array of random signed 32-bit integers.

Call

  • #Rnd.IntVec(Int32 count) : Int32[]

    • count — Number of integers to generate.

#Rnd.Melody

Function · SByte[]

A random melody of given length

Call

  • #Rnd.Melody(Int32 length) : SByte[]

#Rnd.Mode

Function · Mode

A random mode value for musical keys.

A random mode value for musical keys with an inclusive upper bound.

A random mode value for musical keys with inclusive bounds.

Overloads

  • #Rnd.Mode() : Mode

  • #Rnd.Mode(Mode upperInclusive) : Mode

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Mode(Int32 upperInclusive) : Mode

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Mode(Mode lowerInclusive, Mode upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Mode(Int32 lowerInclusive, Mode upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Mode(Mode lowerInclusive, Int32 upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • #Rnd.Mode(Int32 lowerInclusive, Int32 upperInclusive) : Mode

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

#Rnd.Num

Function · T

A generic random number (up to 128 bits).

Call

  • #Rnd.Num(SignedRange<T> range) : T

#Rnd.Partition

Function · Int32[] | Single[]

Random partition of a number into several positive parts.

Overloads

  • #Rnd.Partition(Int32 sum, Int32 count, SignedRangeInt range = null) : Int32[]

    • sum — The number to partition.

    • count — The number of partitions.

    • range — Minimum and maximum item size, must be positive.

  • #Rnd.Partition(Double sum, Int32 count, SignedRangeDouble range = null) : Int32[]

    • sum — The number to partition.

    • count — The number of partitions.

    • range — Minimum and maximum item size, must be positive.

#Rnd.PositiveFloat

Function · Single

A random positive 32-bit float value.

Mathematics defines positive as larger than zero, but here we include it.

A random 32-bit float value with an inclusive upper bound.

Overloads

  • #Rnd.PositiveFloat() : Single

  • #Rnd.PositiveFloat(Double upperInclusive) : Single

    • upperInclusive — Inclusive upper bound.

#Rnd.PositiveInt

Function · Int32

A random signed 32-bit integer value larger than -1.

Mathematics defines positive as larger than zero, but here we include it.

A random positive signed 32-bit integer value with an inclusive upper bound.

Overloads

  • #Rnd.PositiveInt() : Int32

  • #Rnd.PositiveInt(Int32 upperInclusive) : Int32

    • upperInclusive — Inclusive upper bound.

#Rnd.PositiveIntVec

Function · Int32[]

An array of random signed 32-bit integers larger than -1.

Call

  • #Rnd.PositiveIntVec(Int32 count) : Int32[]

    • count — Number of integers to generate.

#Rnd.Shuffle

Function · List<T> | T[] | Int32[]

Random ordering of the provided list.

Random ordering of the provided array.

Random ordering of the provided integer range. Both ends inclusive.

Overloads

  • #Rnd.Shuffle(List<T> collection) : List<T>

    • collection — A list of items to shuffle.

  • #Rnd.Shuffle(params T[] collection) : List<T>

    • collection — An array of items to shuffle.

  • #Rnd.Shuffle(SignedRangeInt range) : Int32[]

    • range — A range to shuffle. Both ends are inclusive.

#Rnd.Subset

Function · List<T> | T[] | Int32[]

Random selection from the collection. Maintains order.

Overloads

  • #Rnd.Subset(Int32 count, List<T> collection) : List<T>

    • count — Number of elements to choose.

    • collection — A list of elements to choose from.

  • #Rnd.Subset(Int32 count, T[] collection) : List<T>

    • count — Number of elements to choose.

    • collection — An array of elements to choose from.

  • #Rnd.Subset(Int32 count, SignedRangeInt range) : Int32[]

    • count — Number of elements to choose.

    • range — Range of elements to choose from, both ends are inclusive.

#Rnd.UInt

Function · UInt32

A random unsigned 32-bit integer value.

A random unsigned 32-bit integer value with inclusive bounds.

Overloads

  • #Rnd.UInt() : UInt32

  • #Rnd.UInt(UInt32 lowerInclusive, UInt32 upperInclusive) : UInt32

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

  • #Rnd.UInt(SignedRangeInt range) : UInt32

    • range — Inclusive range, clamped to [0, int32.MaxValue].

#Rnd.ULong

Function · UInt64

A random unsigned 64-bit integer value.

A random unsigned 64-bit integer value with an inclusive upper bound.

A random unsigned 64-bit integer value with inclusive bounds.

Overloads

  • #Rnd.ULong() : UInt64

  • #Rnd.ULong(UInt64 upperInclusive) : UInt64

    • upperInclusive — Inclusive upper bound.

  • #Rnd.ULong(UInt64 lowerInclusive, UInt64 upperInclusive) : UInt64

    • lowerInclusive — Inclusive lower bound.

    • upperInclusive — Inclusive upper bound.

#Rnd.UnitFloat

Function · Single

A random 32-bit float value in the range of 0 to 1.

Call

  • #Rnd.UnitFloat() : Single

Search for something