notes

package
v0.0.0-...-d40d5fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2019 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Pressed = iota
	Released
)
View Source
const (
	C      = "C"
	Csharp = "C#"
	Db     = "Db"
	D      = "D"
	Dsharp = "D#"
	Eb     = "Eb"
	E      = "E"
	F      = "F"
	Fsharp = "F#"
	Gb     = "Gb"
	G      = "G"
	Gsharp = "G#"
	Ab     = "Ab"
	A      = "A"
	Asharp = "A#"
	Hb     = "Hb"
	H      = "H"
	Bb     = "Bb"
	B      = "B"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adsr

type Adsr struct {
	// contains filtered or unexported fields
}

func NewAdsr

func NewAdsr(attack, decay, sustain, release float32) *Adsr

func (*Adsr) NoteEnded

func (adsr *Adsr) NoteEnded() bool

func (*Adsr) Read

func (adsr *Adsr) Read(samples *snd.Samples)

func (*Adsr) ReadStateless

func (adsr *Adsr) ReadStateless(samples *snd.Samples, freq float32, state *snd.NoteState)

func (*Adsr) SetAttack

func (adsr *Adsr) SetAttack(v float32)

func (*Adsr) SetDecay

func (adsr *Adsr) SetDecay(v float32)

func (*Adsr) SetReadable

func (adsr *Adsr) SetReadable(r snd.Readable)

func (*Adsr) SetRelease

func (adsr *Adsr) SetRelease(v float32)

func (*Adsr) SetSustain

func (adsr *Adsr) SetSustain(v float32)

type ContinuousNote

type ContinuousNote struct {
	// contains filtered or unexported fields
}

func NewContinuousNote

func NewContinuousNote(note NoteValue) *ContinuousNote

func (*ContinuousNote) Read

func (c *ContinuousNote) Read(samples *snd.Samples)

func (*ContinuousNote) ReadStateless

func (c *ContinuousNote) ReadStateless(samples *snd.Samples, freq float32, _ *snd.NoteState)

func (*ContinuousNote) SetNote

func (c *ContinuousNote) SetNote(note NoteValue)

func (*ContinuousNote) SetReadable

func (c *ContinuousNote) SetReadable(r snd.Readable)

type NoteAware

type NoteAware interface {
	NoteEnded() bool
}

type NoteEvent

type NoteEvent struct {
	// contains filtered or unexported fields
}

func NewNoteEvent

func NewNoteEvent(evtype int, note NoteValue, volume float32) *NoteEvent

func (*NoteEvent) GetData

func (ev *NoteEvent) GetData() (int, NoteValue, float32)

type NoteEventReceiver

type NoteEventReceiver interface {
	SendNoteEvent(ev *NoteEvent)
}

type NoteMultiplexer

type NoteMultiplexer struct {
	// contains filtered or unexported fields
}

func NewNoteMultiplexer

func NewNoteMultiplexer() *NoteMultiplexer

func (*NoteMultiplexer) ActiveNotes

func (n *NoteMultiplexer) ActiveNotes() int

func (*NoteMultiplexer) Read

func (n *NoteMultiplexer) Read(samples *snd.Samples)

func (*NoteMultiplexer) ReadStateless

func (n *NoteMultiplexer) ReadStateless(samples *snd.Samples, freq float32, _ *snd.NoteState)

func (*NoteMultiplexer) SendNoteEvent

func (n *NoteMultiplexer) SendNoteEvent(ev *NoteEvent)

func (*NoteMultiplexer) SetReadable

func (n *NoteMultiplexer) SetReadable(r snd.Readable)

type NoteValue

type NoteValue float32
var BaseA4 NoteValue = 440.0

func MidiToNote

func MidiToNote(notenum int64) NoteValue

func Note

func Note(name string, octave int) NoteValue

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL