Documentation ¶
Index ¶
- Variables
- func ExponentialDistribution(param string, from, to float64, n int, dur Measure) *expDistribute
- func ExponentialTempoChange(from, to float64, n int, dur Measure) *expTempoLine
- func FloatToInt(x float64) int
- func LinearDistribution(param string, from, to float64, n int, dur Measure) *linearDistribute
- func LinearTempoChange(from, to float64, n int, dur Measure) *linearTempoLine
- func Loop(patterns ...Pattern) *loop
- func MillisecsToTick(ms float64) int
- func PlayAll(startOffset uint)
- func RoundFloat(x float64, decimals int) float64
- func SeqTempo(start float64, step float64, modifier func(current, step float64) float64) *tempoSpan
- func SetTempo(at string, t Tempo) *setTempo
- func SlotPattern(relations ...float64) *slotPattern
- func StepAdd(current, step float64) float64
- func StepMultiply(current, step float64) float64
- func TickToSeconds(tick int) float32
- func Voices(v ...interface{}) voices
- type Add
- type Amp
- type Attack
- type BPM
- type Dur
- type Dyn
- type End
- type Event
- type EventGenerator
- type Freq
- type Gate
- type HumanizeV1
- type In
- type Max
- type Measure
- type Min
- type Multiply
- type NegOffset
- type Out
- type Pan
- type Parameter
- type ParameterFunc
- type ParamsMap
- type ParamsModifier
- type ParamsModifierFunc
- type Pattern
- func EventFuncPattern(pos string, fn func(e *Event)) Pattern
- func Exec(pos string, fns ...func()) Pattern
- func MixPatterns(trafos ...Pattern) Pattern
- func RandomPattern(patterns ...Pattern) Pattern
- func RepeatPattern(n int, loop Pattern) Pattern
- func SeqPatterns(seq ...Pattern) Pattern
- func SeqSwitch(trafo Pattern, seq ...bool) Pattern
- type PatternFunc
- type Random
- type Rate
- type Release
- type Sample
- type SampleLibrary
- type Sequencer
- type Stage
- func (s *Stage) Bus(name string, numchannels int) *Voice
- func (s *Stage) Group(parent int) *Voice
- func (s *Stage) Instrument(name string, dir string, numVoices int) []*Voice
- func (s *Stage) Play(startOffset uint)
- func (s *Stage) Route(name, dir string, numVoices int) []*Voice
- func (s *Stage) Sample(path string, numVoices int) []*Voice
- func (s *Stage) SampleFreq(path string, freq float64, numVoices int) []*Voice
- func (s *Stage) SampleInstrument(instrument string, sampleLib SampleLibrary, numVoices int) []*Voice
- func (s *Stage) Track(bar string, tempo Tempo) *Track
- type Start
- type Tempo
- type Track
- func (t *Track) At(pos Measure, events ...*Event)
- func (t *Track) BarNum() int
- func (t *Track) Change(bar string, tr ...Pattern) *Track
- func (t *Track) CurrentBar() Measure
- func (t *Track) Fill(num int, tr ...Pattern) *Track
- func (t *Track) MixPatterns(patterns ...Pattern)
- func (t *Track) Next(tr ...Pattern) *Track
- func (t *Track) Print(tempo Tempo, unit string, wr io.Writer)
- func (t *Track) RemoveLoops(names ...string) *Track
- func (t *Track) SetLoop(name string, pattern Pattern) *Track
- func (t *Track) SetLoopAt(name string, startPos string, pattern Pattern) *Track
- func (t *Track) SetLoops(namePatternPairs ...interface{}) *Track
- func (t *Track) SetTempo(pos Measure, tempo Tempo)
- func (t *Track) Start(patterns ...Pattern) *Track
- type TrackLoop
- func (l TrackLoop) Events(barNum int, t Tracker) map[Measure][]*Event
- func (l TrackLoop) Next(patterns ...Pattern) *loop
- func (l TrackLoop) NumBars() int
- func (l *TrackLoop) Off() *TrackLoopStop
- func (l *TrackLoop) On() *TrackLoopStart
- func (l *TrackLoop) OnAt(pos string) *TrackLoopStart
- func (l *TrackLoop) Replace(n *loop) *TrackLoopReplacer
- func (l *TrackLoop) ReplaceAt(start string, n *loop) *TrackLoopReplacer
- func (l TrackLoop) TrackLoop() *TrackLoop
- type TrackLoopReplacer
- type TrackLoopStart
- type TrackLoopStop
- type Tracker
- type Valuer
- type Voice
- func NewBus(name string, numchannels int) *Voice
- func NewGroup(parent int) *Voice
- func NewInstrument(name string, dir string, numVoices int) []*Voice
- func NewRoute(name, dir string, numVoices int) []*Voice
- func NewSample(path string, numVoices int) []*Voice
- func NewSampleFreq(path string, freq float64, numVoices int) []*Voice
- func NewSampleInstrument(instrument string, sampleLib SampleLibrary, numVoices int) []*Voice
- func (v *Voice) Bar(parameter ...Parameter) Pattern
- func (v *Voice) ChangeEvent(ev *Event)
- func (v *Voice) Exec(pos string, fn func() *Event) Pattern
- func (v *Voice) Metronome(unit Measure, parameter ...Parameter) *metronome
- func (v *Voice) Modify(pos string, params ...Parameter) Pattern
- func (v *Voice) Mute(pos string) Pattern
- func (v *Voice) OffEvent(ev *Event)
- func (v *Voice) OnEvent(ev *Event)
- func (v *Voice) Phrase(pos string) *phrase
- func (v *Voice) Play(pos string, params ...Parameter) Pattern
- func (v *Voice) PlayDur(pos, dur string, params ...Parameter) Pattern
- func (v *Voice) Rhythm(start string, positions ...string) *rhythm
- func (v *Voice) Sequencer(s Sequencer) Pattern
- func (v *Voice) SetOffset(o float64)
- func (v *Voice) Stop(pos string) Pattern
- func (v *Voice) UnMute(pos string) Pattern
Constants ¶
This section is empty.
Variables ¶
var ChangeEvent = EventGenerator(func(v *Voice, params ...Parameter) *Event { return &Event{ Voice: v, Params: MixParams(params...), runner: v.ChangeEvent, type_: "CHANGE", } })
var DefaultStage = New()
var MuteEvent = EventGenerator(func(v *Voice, params ...Parameter) *Event { return &Event{ Voice: v, runner: v.OffEvent, type_: "MUTE", } })
params are ignored, just to fullfill the EventGenerator interface
var OffEvent = EventGenerator(func(v *Voice, params ...Parameter) *Event { return &Event{ Voice: v, runner: v.OffEvent, type_: "OFF", } })
params are ignored, just to fullfill the EventGenerator interface
var OnEvent = EventGenerator(func(v *Voice, params ...Parameter) *Event { return &Event{ Voice: v, Params: MixParams(params...), runner: v.OnEvent, type_: "ON", } })
var SynthDefPool = filepath.Join(home, ".local/share/SuperCollider/quarks/SynthDefPool/pool")
var UnMuteEvent = EventGenerator(func(v *Voice, params ...Parameter) *Event { return &Event{ Voice: v, runner: v.donothing, type_: "UNMUTE", } })
params are ignored, just to fullfill the EventGenerator interface
Functions ¶
func ExponentialDistribution ¶
ExponentialDistribution creates a transformer that modifies the given parameter param from the value from to the value to in n steps in exponential growth for a total duration dur
func ExponentialTempoChange ¶
func FloatToInt ¶
func LinearDistribution ¶
LinearDistribution creates a transformer that modifies the given parameter param from the value from to the value to in n steps in linear growth for a total duration dur
func LinearTempoChange ¶
func MillisecsToTick ¶
func RoundFloat ¶
RoundFloat rounds the given float by the given decimals after the dot
func SlotPattern ¶
func SlotPattern(relations ...float64) *slotPattern
SlotPattern creates slots by scaling the given relations to the current Bar of the used tracker. The slots are Measure positions on which the events that are passed via SetEvents() are positioned. Each of events may be *Event or []*Event If len(relations) < len(events), the positions of the events will rotate through the slots. If len(events) < len(relations), the events will rotate through the slot positions. The scaling base can be customized by calling SetBase(). The default base is the current Bar. The pattern by default starts at position 0 inside the bar, but that could be changed by calling At()
func StepMultiply ¶
func TickToSeconds ¶
Types ¶
type Event ¶
type Event struct { Voice *Voice Params Parameter // a special parameter offset may be used to set a per event offset // contains filtered or unexported fields }
func CustomEvent ¶
func (*Event) ChangeMerged ¶
merges the given params of the event into a clone of ev, returning the clone may be used with events that have modifiers, like Scale, Rhythm etc the given voice is set and we get a change event func (ev *Event) ChangeMerged(voice Voice, m map[string]float64) *Event {
type EventGenerator ¶
type HumanizeV1 ¶
type HumanizeV1 struct { OffsetFactor float64 AmpFactor float64 FreqFactor float64 RateFactor float64 }
func (HumanizeV1) Modify ¶
func (h HumanizeV1) Modify(params Parameter) Parameter
type Measure ¶
type Measure int
func ExponentialDistributedValues ¶
func ExponentialDistributedValues(from, to float64, steps int, dur Measure) (width Measure, diffs []float64)
ExponentialDistributedValues returns the width (time difference) and values for and exponential growth from the given value from to the given value to in the total time of dur with the given number of steps
func LinearDistributedValues ¶
func LinearDistributedValues(from, to float64, steps int, dur Measure) (width Measure, diff float64)
LinearDistributedValues fill duration dur linearily with values from from to to in steps steps
type ParameterFunc ¶
func (ParameterFunc) Params ¶
func (p ParameterFunc) Params() map[string]float64
type ParamsModifier ¶
type ParamsModifierFunc ¶
func (ParamsModifierFunc) Modify ¶
func (p ParamsModifierFunc) Modify(param Parameter) Parameter
type Pattern ¶
func EventFuncPattern ¶
returns a Pattern for an event func at a certain position
func MixPatterns ¶
func RandomPattern ¶
each pattern must have the same NumBars
func RepeatPattern ¶
func SeqPatterns ¶
type PatternFunc ¶
func (PatternFunc) Events ¶
func (tf PatternFunc) Events(barNum int, t Tracker) map[Measure][]*Event
func (PatternFunc) NumBars ¶
func (tf PatternFunc) NumBars() int
type Random ¶
type Random float64
Random adds a random float multiplied by the given value to the existing value
type Sample ¶
type Sample struct { Path string // the path of the sample Offset float64 // offset in milliseconds until max amplitude must be positiv MaxAmp float64 // max amplitude value, must be between 0 and 1 Channels uint // number of channels NumFrames int // number of frames SampleRate int // e.g. 44100 SampleFormat string // e.g. int16 Duration float64 // duration in seconds HeaderFormat string // e.g. WAV Frequency float64 // contains filtered or unexported fields }
type SampleLibrary ¶
type Stage ¶
type Stage struct { AudioFile string ScoreFile string WriteSynthDefs bool LoadSamples bool // contains filtered or unexported fields }
func (*Stage) Instrument ¶
func (*Stage) SampleFreq ¶
func (*Stage) SampleInstrument ¶
func (s *Stage) SampleInstrument(instrument string, sampleLib SampleLibrary, numVoices int) []*Voice
type Track ¶
func (*Track) CurrentBar ¶
func (*Track) MixPatterns ¶
func (*Track) RemoveLoops ¶
RemoveLoops removes all loops if no names is passed
func (*Track) SetLoop ¶
SetLoop sets a Loop so that position "0" inside the loop matches position "0" inside the track bar
type TrackLoop ¶
type TrackLoop struct {
// contains filtered or unexported fields
}
func (*TrackLoop) Off ¶
func (l *TrackLoop) Off() *TrackLoopStop
func (*TrackLoop) On ¶
func (l *TrackLoop) On() *TrackLoopStart
func (*TrackLoop) OnAt ¶
func (l *TrackLoop) OnAt(pos string) *TrackLoopStart
func (*TrackLoop) Replace ¶
func (l *TrackLoop) Replace(n *loop) *TrackLoopReplacer
func (*TrackLoop) ReplaceAt ¶
func (l *TrackLoop) ReplaceAt(start string, n *loop) *TrackLoopReplacer
type TrackLoopReplacer ¶
type TrackLoopReplacer struct { *TrackLoop // contains filtered or unexported fields }
type TrackLoopStart ¶
type TrackLoopStart struct { *TrackLoop // contains filtered or unexported fields }
type TrackLoopStop ¶
type TrackLoopStop struct { // stopAt Measure *TrackLoop }
type Tracker ¶
type Tracker interface { /* SetTempo(pos Measure, tempo Tempo) TempoAt(abspos Measure) Tempo */ At(pos Measure, events ...*Event) // TempoAt(abspos Measure) Tempo CurrentBar() Measure }
Tracker limits the available functions for a Pattern
type Voice ¶
type Voice struct { Group int Bus int // lastSampleFrequency float64 // frequency of the last played sample ParamsModifier ParamsModifier // contains filtered or unexported fields }
func NewSampleInstrument ¶
func NewSampleInstrument(instrument string, sampleLib SampleLibrary, numVoices int) []*Voice
func (*Voice) ChangeEvent ¶
func (*Voice) Exec ¶
func (v *Voice) Exec(numBars int, pos string, fn PatternFunc) Pattern { func (v *Voice) Exec(numBars int, pos string, fn PatternFunc) Pattern {
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package amp provides shortcuts for amplitude measures contrasting with the dyn package that affects how something is played
|
Package amp provides shortcuts for amplitude measures contrasting with the dyn package that affects how something is played |
Package beat provides shortcuts for beat positions within a bar
|
Package beat provides shortcuts for beat positions within a bar |
Package chord provides shortcuts for chords
|
Package chord provides shortcuts for chords |
Package dyn provides shortcuts for dynamic measures as a matter of how something is played contrasting to amp that affects the amplitude
|
Package dyn provides shortcuts for dynamic measures as a matter of how something is played contrasting to amp that affects the amplitude |
Package amp provides shortcuts for midi notes and their frequencies
|
Package amp provides shortcuts for midi notes and their frequencies |
Package sample provides shortcuts for parameters that are useful for samples
|
Package sample provides shortcuts for parameters that are useful for samples |
Package sampleplayer provides an instrument based on different samples for different frequencies and dynamics
|
Package sampleplayer provides an instrument based on different samples for different frequencies and dynamics |
Package scale provides shortcuts for chromatic and periodic (diatonic) scales
|
Package scale provides shortcuts for chromatic and periodic (diatonic) scales |