piano

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Piano

type Piano struct {
	InputDevice  portmidi.DeviceID
	OutputDevice portmidi.DeviceID

	InputStream *portmidi.Stream
	sync.Mutex
	// contains filtered or unexported fields
}

Piano is the AI class for the piano

func New

func New(ports ...int) (p *Piano, err error)

New sets the device ports. Optionally you can pass the input and output ports, respectively.

func (*Piano) Close

func (p *Piano) Close() (err error)

Close will shutdown the streams and gracefully terminate.

func (*Piano) PlayNotes

func (p *Piano) PlayNotes(notes []music.Note, bpm int) (err error)

PlayNotes will play all the notes

Jump to

Keyboard shortcuts

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