class Haematite::AudChannel

Overview

Representation of a MIDI channel.

Defined in:

haematite/audchannel.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(synth : Synthesizer, isPercussionChannel : Bool, filterMode : FilterMode) #

Creates a new AudChannel instance.


Instance Method Detail

def bank=(val : Int32) #

Sets the bank number. If #isPercussionChannel is true, then this will automatically add 128 to the bank number.


def bankNumber : Int32 #

The instrument bank number assigned to this channel.


def chorusSend : Float64 #

Returns the current chorus amount for the channel.


def chorusSend=(val : UInt8) #

Sets the chorus amount for the channel.


def cutoff : Float64 #

def cutoff=(val : UInt8) #

Sets the cutoff frequency.


def dataEntryCoarse(val : Int32) #

MIDI Data Entry MSB


def dataEntryFine(val : Int32) #

MIDI Data Entry LSB


def expression : Float64 #

Returns the current expression amount.


def expressionCoarse=(val : Int32) #

Sets the coarse expression.


def expressionFine=(val : Int32) #

Sets the fine expression.


def filterMode : FilterMode #

Describes what kind of lowpass filter is used when applying MIDI controllers 74 and 71.


def holdPedal : Bool #

Whether or not the sustain pedal is depressed.


def holdPedal=(val : Int) #

Sets the sustain pedal state to true if val is greater than or equal to 64, or false otherwise.


def holdPedal=(val : Bool) #

Sets the sustain pedal state.


def isPercussionChannel : Bool #

Whether or not this channel is set to be a percussion channel.


def modulation : Float64 #

Returns the current modulation amount.


def modulationCoarse=(val : Int32) #

Sets the coarse modulation amount.


def modulationFine=(val : Int32) #

Sets the fine modulation amount.


def nrpnCoarse=(val : Int32) #

Sets the coarse NRPN value.


def nrpnFine=(val : Int32) #

Sets the fine NRPN value.


def pan : Float64 #

Returns the current panning.


def panCoarse=(val : Int32) #

Sets the coarse panning.


def panFine=(val : Int32) #

Sets the fine panning.


def patch=(val : Int32) #

Sets the patch number.


def patchNumber : Int32 #

The patch number assigned to this channel.


def pitchBend : Float64 #

Returns the current pitch bend amount for the channel.


def pitchBendRange : Float64 #

Returns the pitch bend range.


def reset #

Resets the channel back to the initial state.

  • The bank number is set # according to #isPercussionChannel
  • The patch number is set to 0.
  • Modulation is set to 0
  • Volume is set to 12800 (100 << 7)
  • Pan is set to 8192 (64 << 7, center)
  • Expression is set to 16256 (127 << 7)
  • Pitch bend range is set to 256 (2 << 7, two semitones)
  • Pitch bend is set to 0
  • Coarse tune is set to 0
  • Fine tune is set to 8192
  • The RPN is set to -1
  • The NRPN is set to -1
  • The RPN/NRPN data is set to 0
  • The sustain pedal is not depressed
  • Reverb and Chorus are set to DEFAULT_REVERB_SEND and DEFAULT_CHORUS_SEND, respectively.

def resetAllControllers #

Resets the controllers for the channel (modulation, expression, sustain pedal, rpn, and pitch bend). See #reset for the values.


def resonance : Float64 #

def resonance=(val : UInt8) #

Sets the resonance of the filter.


def reverbSend : Float64 #

Returns the current reverb amount for the channel.


def reverbSend=(val : UInt8) #

Sets the reverb amount for the channel.


def rpnCoarse=(val : Int32) #

Sets the coarse RPN value.


def rpnFine=(val : Int32) #

Sets the fine RPN value.


def setPitchBend(val1 : Int, val2 : Int) #

Sets the pitch bend amount.


def tune : Float64 #

Returns the tuning.


def volume : Float64 #

Returns the current volume.


def volumeCoarse=(val : Int32) #

Sets the coarse volume.


def volumeFine=(val : Int32) #

Sets the fine volume.