AKKeyboardView

@IBDesignable open class AKKeyboardView: UIView, AKMIDIListener

Clickable keyboard mainly used for AudioKit playgrounds

  • Number of octaves displayed at once

    Declaration

    Swift

    @IBInspectable open var octaveCount: Int = 2
  • Lowest octave dispayed

    Declaration

    Swift

    @IBInspectable open var firstOctave: Int = 4
  • Relative measure of the height of the black keys

    Declaration

    Swift

    @IBInspectable open var topKeyHeightRatio: CGFloat = 0.55
  • Color of the polyphonic toggle button

    Declaration

    Swift

    @IBInspectable open var polyphonicButton: UIColor = #colorLiteral(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000)
  • White key color

    Declaration

    Swift

    @IBInspectable open var  whiteKeyOff: UIColor = #colorLiteral(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000)
  • Black key color

    Declaration

    Swift

    @IBInspectable open var  blackKeyOff: UIColor = #colorLiteral(red: 0.000, green: 0.000, blue: 0.000, alpha: 1.000)
  • Activated key color

    Declaration

    Swift

    @IBInspectable open var  keyOnColor: UIColor = #colorLiteral(red: 1.000, green: 0.000, blue: 0.000, alpha: 1.000)
  • Class to handle user actions

    Declaration

    Swift

    open weak var delegate: AKKeyboardDelegate?
  • Allows multiple notes to play concurrently

    Declaration

    Swift

    open var polyphonicMode = false
  • Initialize the keyboard with default info

    Declaration

    Swift

    public override init(frame: CGRect)
  • Initialize the keyboard

    Declaration

    Swift

    public init(width: Int, height: Int, firstOctave: Int = 4, octaveCount: Int = 3,
                    polyphonic: Bool = false)
  • Initialization within Interface Builder

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)
  • Draw the view

    Declaration

    Swift

    override open func draw(_ rect: CGRect)
  • Handle new touches

    Declaration

    Swift

    override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
  • Handle touches completed

    Declaration

    Swift

    override open func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
  • Handle moved touches

    Declaration

    Swift

    override open func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?)
  • Handle stopped touches

    Declaration

    Swift

    override open func touchesCancelled(_ touches: Set<UITouch>?, with event: UIEvent?)