devices

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMIDIDeviceNotFound       = errors.New("MIDI Device not found")
	ErrMIDIDeviceNotInitialized = errors.New("MIDI Device not initialized")
)
View Source
var (
	ErrShuttleExpressDeviceNotFound  = errors.New("no ShuttlExpress found")
	ErrShuttleExpressDeviceNotOpened = errors.New("ShuttlExpress: No device opened")
)

Functions

func GetMIDIDevices

func GetMIDIDevices(driver midi.Driver) ([]string, error)

GetMIDIDevices returns a list of all devices availalbe for the specified driver. If nil is passed as driver the default driver will be used (rtmididrv)

Types

type MidiController

type MidiController interface {
	Open() error
	Close() error
	SendCommand(controller uint8, value uint8, repeat bool) error
}

MidiController is the public interface to send out MIDI controller messages to a device

func NewMIDIController

func NewMIDIController(driver midi.Driver, devicename string, delay time.Duration, channel uint8) MidiController

NewMIDIController creates a new MidiController instance with the specified parameters. If nil is passed as driver the default driver will be used (rtmididrv). delay specifies the time between each command message, in case the message should be send repeatedly.

type ShuttlExpress

type ShuttlExpress struct {
	ShuttleStatus
	// contains filtered or unexported fields
}

ShuttlExpress Driver based on the hardware information from the Python implementation https://github.com/EMATech/ContourShuttleXpress

func NewShuttlExpress

func NewShuttlExpress() (*ShuttlExpress, error)

NewShuttlExpress searches for available ShuttlExpress devices and opens the first one it finds

type ShuttleStatus

type ShuttleStatus struct {
	Wheel_position  chan int8
	Dial_direction  chan int8
	Button1_pressed chan bool
	Button2_pressed chan bool
	Button3_pressed chan bool
	Button4_pressed chan bool
	Button5_pressed chan bool
	// contains filtered or unexported fields
}

ShuttleStatus contains a event channel for all ShuttlExpress hardware controls. The channels have to be created by the consuming module.

Jump to

Keyboard shortcuts

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