to_note

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionKey

func ActionKey(velocity uint8, nt32th uint32, valuer midiline.Valuer) midiline.Action

TransformKey converts the given valuer to a note key with the given velocity. If the valuer return 0, a note off message is sent.

Example:

// To get a transformer that converts cc1 messages on channel2 to note messages of a 8th note length and
// and velocity of 100, use
var m = midiline.And(typ.Channel2,message.ControlChange(1))
var t = TransformKey(100,4, m, value.ControlChange)

func ActionKeyScale

func ActionKeyScale(velocity uint8, nt32th uint32, valuer midiline.Valuer, scale func(uint8) uint8) midiline.Action

TransformKeyScale is like TransformKey but allows a scaler function to calculate the note key value from the valuer value.

Example:

   // To get a transformer that converts cc1 messages on channel2 to note messages of a 8th note length by adding 1, use
   var m = midiline.And(typ.Channel2,message.ControlChange(1))
   var s = func (in uint8) (out uint8) {
       return in+1 // lib takes care that the value won't get too high (>127)
	  }

   var t = TransformKeyScale(100,4,m,value.ControlChange,s)

func ActionVelocity

func ActionVelocity(key uint8, nt32th uint32, valuer midiline.Valuer) midiline.Action

TransformVelocity converts the given valuer to a note velocity with the given key. If the valuer return 0, a note off message is sent.

Example:

// To get a transformer that converts cc1 messages on channel2 to note velocities of key 64 and length 8th note, use
var m = midiline.And(typ.Channel2,message.ControlChange(1))
var t = TransformVelocity(64, 4,m, value.ControlChange)

func ActionVelocityScale

func ActionVelocityScale(key uint8, nt32th uint32, valuer midiline.Valuer, scale func(uint8) uint8) midiline.Action

TransformVelocityScale is like TransformVelocity but with a custom scaling function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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