Table of Contents

Class NotePatterns

Namespace
Sigil.Sound
Assembly
Sigil.Sound.Notes.dll

Working with patterns of notes.

public static class NotePatterns

Inheritance

Inherited Members

Methods

ToPattern(Pattern<Note>, int)

Writes the first cycles cycles out as a looping Sigil.Sound.Pattern that Sigil.Sound.Patterns.Play(Sigil.Sound.Pattern,System.Func{Sigil.Sound.Voice,Sigil.Sound.Sound},System.Nullable{System.Double},System.Int32) can play. One cycle is Sigil.Sound.Pat.BeatsPerCycle beats, and each note lasts as long as its event. Anything that changes from cycle to cycle (<a b>, Every) repeats after this many cycles, so pass the length of the whole variation.

public static Pattern ToPattern(this Pattern<Note> pattern, int cycles = 1)

Parameters

pattern Pattern<Note>

The notes to write out.

cycles int

How many cycles to write out before the loop starts over.

Returns

Pattern

ToStream(Pattern<Note>)

Plays a pattern of notes as a stream, so it can go through the same operators as live notes (Transpose, Echo, Merge with a keyboard) and out of the same jack. The notes start on the host's beat grid and end when their events do.

public static NoteStream ToStream(this Pattern<Note> pattern)

Parameters

pattern Pattern<Note>

The notes. Needs a Sigil.Sound.HostClock on the runner that plays the stream, and plays nothing while it is stopped.

Returns

NoteStream

Examples

// A written melody becomes a stream, so it goes through the same operators as live notes: here a fifth is added and the notes are strummed.
Mini.Notes("c3 [e3 g3]*2 ~ <b3 d4>").ToStream()
    .Harmonize(0, 7).Strum(0.05)
    .Play(v => Saw(v.Frequency).LowPass(2400).Adsr(0.005, 0.15, 0.4, 0.2)) * 0.2

Transpose(Pattern<Note>, int)

Moves every note by semitones.

public static Pattern<Note> Transpose(this Pattern<Note> pattern, int semitones)

Parameters

pattern Pattern<Note>
semitones int

Returns

Pattern<Note>

Velocity(Pattern<Note>, double)

Sets how hard every note is played, from 0 to 1.

public static Pattern<Note> Velocity(this Pattern<Note> pattern, double velocity)

Parameters

pattern Pattern<Note>
velocity double

Returns

Pattern<Note>