keyboard

package
v0.0.0-...-1f3efd1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Always       = "always"
	Never        = "never"
	NewPressOnly = "new_presses_only"
)
View Source
const (
	//  channel info are in first byte and last four bits
	MidiNoteOn         uint8 = 0x90 // first byte, first four bit mask, should be mixed with channel bits (last four bits)`
	MidiNoteOff        uint8 = 0x80
	MidiControlAndMode uint8 = 0xb0
	MidiProgramChange  uint8 = 0xc0
	MidiPitchControl   uint8 = 0xe0

	MidiPanic uint8 = 0x7b // all notes off (status bytes)

	Note = iota
	Control

	PitchControl
	PitchControlToggle

	Panic // ControlEvents targets
	Reset
	OctaveUp
	OctaveDown
	SemitoneUp
	SemitoneDown
	ChannelUp
	ChannelDown
	ProgramUp
	ProgramDown
	OctaveAdd
	OctaveDel
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigStruct

type ConfigStruct struct {
	Identification Identification   `yaml:"identification"`
	Control        map[uint8]string `yaml:"control"`
	Notes          map[uint8]uint8  `yaml:"notes"`
	Options        Options          `yaml:"options"`
	AutoConnect    []string         `yaml:"auto_connect"`
}

configuration yaml structure

func FindConfig

func FindConfig(name string) (ConfigStruct, error)

finds and return KeyMap

type Identification

type Identification struct {
	RealName string `yaml:"real_name"`
	NiceName string `yaml:"nice_name"`
}

type MidiDevice

type MidiDevice struct {
	Handler *hardware.Handler
	Config  ConfigStruct

	MidiPort *jack.Port
	// contains filtered or unexported fields
}

func New

func New(handler *hardware.Handler, eventChan *chan MidiEvent) *MidiDevice

func (*MidiDevice) ChangeChannel

func (d *MidiDevice) ChangeChannel(value int)

func (*MidiDevice) ChangeOctave

func (d *MidiDevice) ChangeOctave(value int)

func (*MidiDevice) ChangeProgram

func (d *MidiDevice) ChangeProgram(value int)

func (*MidiDevice) ChangeSemitone

func (d *MidiDevice) ChangeSemitone(value int)

func (*MidiDevice) Close

func (d *MidiDevice) Close()

func (*MidiDevice) HandleRawEvent

func (d *MidiDevice) HandleRawEvent(event hardware.KeyEvent)

main function responsible for processing raw hardware events to Midi

func (*MidiDevice) Process

func (d *MidiDevice) Process()

func (*MidiDevice) String

func (d *MidiDevice) String() string

type MidiEvent

type MidiEvent struct {
	Port *jack.Port
	Data jack.MidiData
}

func (MidiEvent) String

func (m MidiEvent) String() string

type Options

type Options struct {
	MidiJamMode string `yaml:"midi_jam_mode"`
}

Jump to

Keyboard shortcuts

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