axewitcher

package module
v0.0.0-...-b188af3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 6 Imported by: 1

README

axewitcher

MIDI controller for Axe-FX 2 guitar amplifier written in Golang running on Raspberry Pi 3

Documentation

Overview

fsw

midi

midi_linux

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBtoMIDI

func DBtoMIDI(db float64) uint8

func MIDItoDB

func MIDItoDB(n uint8) float64

Types

type AmpConfig

type AmpConfig struct {
	DirtyGain uint8
	CleanGain uint8
	Fx        [5]FXConfig
}

type AmpMode

type AmpMode int
const (
	AmpDirty AmpMode = iota
	AmpClean
	AmpAcoustic
)

type AmpState

type AmpState struct {
	Mode      AmpMode
	DirtyGain uint8
	CleanGain uint8
	Volume    uint8
	Fx        [5]FXState
}

type Controller

type Controller struct {
	DefaultAmpConfig [2]AmpConfig
	Programs         []*Program

	Curr ControllerState
	Prev ControllerState
	// contains filtered or unexported fields
}

func NewController

func NewController(midi Midi) *Controller

func (*Controller) ActivateProgram

func (c *Controller) ActivateProgram()

func (*Controller) ActivateScene

func (c *Controller) ActivateScene()

func (*Controller) HandleFswEvent

func (c *Controller) HandleFswEvent(ev FswEvent) (err error)

func (*Controller) Init

func (c *Controller) Init()

func (*Controller) Load

func (c *Controller) Load() error

func (*Controller) SendMidi

func (c *Controller) SendMidi() error

type ControllerState

type ControllerState struct {
	SceneIdx  int
	Scene     *Scene
	PrIdx     int
	Pr        *Program
	Amp       [2]AmpState
	AmpConfig [2]AmpConfig
}

type FXConfig

type FXConfig struct {
	Name   string
	MidiCC uint8
}

type FXState

type FXState struct {
	Enabled bool
}

type FswButton

type FswButton uint8
const (
	FswNone FswButton = iota
	FswReset
	FswPrev
	FswNext
)

type FswEvent

type FswEvent struct {
	Fsw   FswButton
	State bool
}

type Midi

type Midi interface {
	Close() error

	// Controller change:
	CC(channel uint8, controller uint8, value uint8) error
	// Program change:
	PC(channel uint8, program uint8) error
	// send sysex data; F0 and F7 are automatically included
	Sysex(data []byte) error
}

func NewMidi

func NewMidi() (midi Midi, err error)

func NewNullMidi

func NewNullMidi() (midi Midi, err error)

type Program

type Program struct {
	Name      string
	Tempo     int
	Scenes    []*Scene
	AmpConfig [2]AmpConfig
}

type Scene

type Scene struct {
	Name string
	Amp  [2]AmpState
}

Jump to

Keyboard shortcuts

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