Table of Contents

Class Mini

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

Writing a pattern as text, in the style of Strudel and TidalCycles. The steps of a sequence share one cycle equally.

public static class Mini

Inheritance

Inherited Members

Remarks

a b cthree steps in a cycle
a ~ ba rest (~, or - on its own)
a [b c]a group: b and c share the second step
[a,b,c]layers played together (a chord); commas also work at the top level
<a b c>one per cycle, in turn
a*2, a/2twice as fast, half as fast
a(3,8), a(3,8,2)a Euclidean rhythm: 3 hits over 8 steps, rotated by 2
a@3, a _ _take 3 shares of the cycle instead of 1
a!3, a !repeat the step (three in all, and once more)
a?, a?0.3drop it at random (half the time, or 30%), the same way each time

Methods

Chords(string)

Chords by name, such as "c3:min7 f3:7 [g3:sus4 g3]"; see Sigil.Sound.Chord.Parse(System.String) for the names. Turn them into notes with Sigil.Sound.ChordPatterns.Notes(Sigil.Sound.Pattern{Sigil.Sound.Chord}) or Sigil.Sound.ChordPatterns.Arp(Sigil.Sound.Pattern{Sigil.Sound.Chord},Sigil.Sound.ArpMode,System.Int32).

public static Pattern<Chord> Chords(string text)

Parameters

text string

Returns

Pattern<Chord>

Exceptions

MiniNotationException

The text is not valid.

Drums(string)

Drums by name, such as "bd ~ sn ~" or "hh*8", as notes on the General MIDI drum map, so the same pattern also drives a MIDI drum kit. Names are case-insensitive and :0.6 sets the velocity (hh:0.4). Play each drum as its own pattern, and give it the sound you want.

public static Pattern<Note> Drums(string text)

Parameters

text string

Returns

Pattern<Note>

Examples

var bpm = 110;
var kick = Mini.Drums("bd ~ ~ bd ~ bd ~ ~");
var hats = Mini.Drums("hh*8");
kick.Play(v => Sine(Fn(t => 48 + 110 * Exp(-t * 28))).Adsr(0.001, 0.25, 0, 0.02), bpm) * 0.9
    + hats.Play(v => Noise(4).HighPass(7000).Adsr(0.001, 0.04, 0, 0.01), bpm) * 0.25

Remarks

bdbass drum (36)
rimside stick (37)
snsnare (38)
cphand clap (39)
lt, mt, htlow, mid and high tom (41, 47, 50)
hh, ohclosed and open hi-hat (42, 46)
cr, rdcrash and ride cymbal (49, 51)
cbcowbell (56)

Exceptions

MiniNotationException

The text is not valid, or a word is not a drum name.

Integers(string)

Whole numbers, such as scale degrees: "0 2 <4 -1> ~". Pair with Sigil.Sound.Scale.Notes(Sigil.Sound.Pattern{System.Int32}).

public static Pattern<int> Integers(string text)

Parameters

text string

Returns

Pattern<int>

Exceptions

MiniNotationException

The text is not valid, or a word is not a whole number.

Notes(string)

Notes by name, such as "c3 [e3 g3]*2 ~ <b3 d4>". Names are case-insensitive, sharps are # and flats b (eb4), and a name without an octave is in octave 3. Add :0.6 for the velocity (c4:0.6).

public static Pattern<Note> Notes(string text)

Parameters

text string

Returns

Pattern<Note>

Exceptions

MiniNotationException

The text is not valid.

Numbers(string)

Numbers, such as "400 800 1600 3200", for driving a parameter.

public static Pattern<double> Numbers(string text)

Parameters

text string

Returns

Pattern<double>

Exceptions

MiniNotationException

The text is not valid.

Parse<T>(string, Func<string, T>)

Parses mini-notation whose words become values through atom; throw System.FormatException for a word it does not accept.

public static Pattern<T> Parse<T>(string text, Func<string, T> atom)

Parameters

text string
atom Func<string, T>

Returns

Pattern<T>

Type Parameters

T

Exceptions

MiniNotationException

The text is not valid.