Class NotePatterns
- Namespace
- Sigil.Sound
- Assembly
- Sigil.Sound.Notes.dll
Working with patterns of notes.
public static class NotePatternsInheritance
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
patternPattern<Note>-
The notes to write out.
cyclesint-
How many cycles to write out before the loop starts over.
Returns
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
patternPattern<Note>-
The notes. Needs a Sigil.Sound.HostClock on the runner that plays the stream, and plays nothing while it is stopped.
Returns
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
Returns
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)