midi

package
v0.0.0-...-cd0b299 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Provides a midi master clock and various other utils for working with midi

Index

Constants

View Source
const (
	Start    = 0xFA
	Stop     = 0xFC
	Tick     = 0xF8
	Continue = 0xFB
)

Midi standard commands

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct {
	Playing bool
	// contains filtered or unexported fields
}

func NewClock

func NewClock(device *os.File) *Clock

Create a new midi clock. The clock starts to send tick events as soon as it is created. device, err := os.OpenFile("/device/snd/midiC1D0", os.O_WRONLY, 0664)

if err != nil {
	log.Fatal(err)
}

clk := midi.NewClock(device) clk.SetBpm(120.00) clk.Start()

func (*Clock) Continue

func (clk *Clock) Continue()

Send MIDI sequencer stop event

func (*Clock) SetBpm

func (clk *Clock) SetBpm(bpm float32)

Change the BPM of the clock

func (*Clock) Start

func (clk *Clock) Start()

Send MIDI sequencer start event

func (*Clock) Stop

func (clk *Clock) Stop()

Send MIDI sequencer stop event

type VarTicker

type VarTicker struct {
	C <-chan time.Time
	// contains filtered or unexported fields
}

Variable frequency ticker from https://groups.google.com/d/msg/golang-nuts/TMX7D6XrTHk/Ode7de5KBgAJ

func (*VarTicker) SetDuration

func (t *VarTicker) SetDuration(d time.Duration)

Jump to

Keyboard shortcuts

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