# doc-cache created by Octave 10.2.0
# name: cache
# type: cell
# rows: 3
# columns: 26
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
audio


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1613
The Audio package provides basic MIDI and audio functionality for GNU
octave.

MIDI
----

The following MIDI functions are available:

MIDI Device query:
..................

mididevinfo
     list any MIDI devices detected in the system

MIDI Device creation and manipulation:
......................................

mididevice
     Create a midi device
midimsg
     Create a MIDI message or group of messages
midireceive
     receive a MIDI message from a device
midisend
     Send a MIDI message to a device

MIDI Controller Interface Functions:
....................................

midiid
     Identify a midi controller
midicontrols
     Create a MIDI controller object
midireceive
     Receive data from a MIDI controller object
midisend
     Send data to a MIDI controller.

Writing and reading basic MIDI files:
.....................................

midifileinfo
     read information about a MIDI file, including number of tracks,
     comments etc.
midifileread
     read a MIDI file into a midimsg array
midifilewrite
     write a midimsg array to a MIDI file

General usage:
..............

Normal usage would involve querying the devices that are available:
     mididevinfo

   Then selecting the device(s) to connect to, and creating a mididevice
to perform read and write functionality:
     dev = mididevice(0);

   And then performing I/O on the device:
     msg = midireceive(dev)

Audio
-----

The following Audio functions are available:
hz2mel, hz2bark, hz2erp, mel2hz, bark2hz, erp2hz
     Convert between hz and other frequenct scales
audioOscillator
     Create a audio waveform generator


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
The Audio package provides basic MIDI and audio functionality for GNU
octave.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
audioOscillator


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2145
 -- audioOscillator
     Generate sine, sawtool and square waveforms

Methods
-------

 -- OBJ = audioOscillator ()
 -- OBJ = audioOscillator (SIGNALTYPEVALUE)
 -- OBJ = audioOscillator (SIGNALTYPEVALUE, FREQUENCYVALUE)
 -- OBJ = audioOscillator (__, PROPERTYNAME, PROPERTYVALUE)
     Create a audioOscillator object

     Inputs
     ......

     SIGNALTYPEVALUE - signal type of "sine" (default), "square",
     "sawtooth".
     FREQUENCYVALUE - hz frequency value of waveform (default 100).
     PROPERTYNAME, PROPERTYVALUE - properties to set on the object.

     Known properties are:
     SignalType
          signal type of "sine" (default), "square" or "sawtooth".
          (readonly)
     Frequency
          frequency of the waveform (default 100)
     Amplitude
          amplitude of the signal (default 1)
     SampleRate
          sample rate of the signal (default 44100)
     PhaseOffset
          phase offset of signal 0 (default) - 1 (readonly)
     DutyCycle
          dutycycle of the signal 0 - 1 (default 0.5) when signal is a
          square wave.
     SamplePerFrame
          Samples per frame as returned from () (default 512)
     MaxSamplePerFrame
          Max samples per frame (default 192000)
     DCOffset
          DC Offset of signal (default 0)
     Width
          Width of sawtooth (default 1)
     OutputDataType
          Output data type of 'single' or 'double' (default 'double')

     Outputs
     .......

     OBJ - signalGenerator object

     Examples
     ........

     Create a 100 hz sine wave and plot first 512 samples
          sinosc = audioOscillator
          data = sinosc();
          plot(data);

     Create a 2 hz square wave with duty cycle of 0.5
          sqosc = audioOscillator('square', 'DutyCycle', 0.50,  'Frequency', 2);

 -- DATA = OBJ()
     Generate a frame of waveform data from the generator function

     Inputs
     ......

     OBJ - signalGenerator object

     Outputs
     .......

     DATA - waveform data

 -- release(OBJ)
     Release resources of generator

     Inputs
     ......

     OBJ - signalGenerator object

     Outputs
     .......

     None


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Generate sine, sawtool and square waveforms



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
bark2hz


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 398
 -- HZ = bark2hz (BARK)
     Convert equivalent Bark Frequency to Hz.

     Inputs
     ......

     BARK - input frequency in bark.

     Outputs
     .......

     HZ - Output frequency in Hz.

     References
     ..........

     Traunmüller, Hartmut.  ‘Analytical Expressions for the Tonotopic
     Sensory Scale. Journal of the Acoustical Society of America. Vol.
     88, Issue 1, 1990’


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Convert equivalent Bark Frequency to Hz.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
erb2hz


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 368
 -- HZ = erb2hz (ERB)
     Convert equivalent rectangular bandwidth (ERB) to Hz.

     Inputs
     ......

     ERB - input frequency in erb.

     Outputs
     .......

     HZ - Output frequency in Hz.

     References
     ..........

     Glasberg and Moore.  ‘Derivation of Auditory Filter Shapes from
     Notched-Noise Data. Hearing Research. Vol. 47, 1990’


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Convert equivalent rectangular bandwidth (ERB) to Hz.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
hz2bark


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 491
 -- BARK = hz2bark (HZ)
     Convert hz to equivalent bark frequency

     Inputs
     ......

     HZ - input frequency in Hz.

     Outputs
     .......

     BARK - Output frequency as a bark value

     Examples
     ........

     Convert 4000 Hz to erb
          erb = hz2erb(4000)

     References
     ..........

     Traunmüller, Hartmut.  ‘Analytical Expressions for the Tonotopic
     Sensory Scale. Journal of the Acoustical Society of America. Vol.
     88, Issue 1, 1990’


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Convert hz to equivalent bark frequency



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
hz2erb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 534
 -- ERB = hz2erb (HZ)
     Convert hz to equivalent rectangular bandwidth (ERB)

     Inputs
     ......

     HZ - input frequency in Hz.

     Outputs
     .......

     ERB - Output frequency as a erb value

     Examples
     ........

     Convert 4000 Hz to erb
          erb = hz2erb(4000)

     Convert a range of Hz to erb
          erb = hz2erb(4000:100:5000)

     References
     ..........

     Glasberg and Moore.  ‘Derivation of Auditory Filter Shapes from
     Notched-Noise Data. Hearing Research. Vol. 47, 1990’


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Convert hz to equivalent rectangular bandwidth (ERB)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
hz2mel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 524
 -- MEL = hz2mel (HZ)
     Convert hz to equivalent mel frequency.

     Inputs
     ......

     HZ - input frequency in Hz.

     Outputs
     .......

     MEL - Output frequency as a mel value

     Examples
     ........

     Convert 4000 Hz to mel
          mel = hz2mel(4000)

     Convert a range of Hz to mel
          mel = hz2erb(4000:100:5000)

     References
     ..........

     O'Shaghnessy, Douglas.  ‘Speech Communication: Human and Machine.
     Reading, MA: Addison-Wesley Publishing Company, 1987’


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Convert hz to equivalent mel frequency.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ismidifile


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 483
 -- ISMIDI = ismidifile (FILENAME)
     Check if FILENAME is a midi file.

     The function only checks whether it is an existing file and the
     file starts with a valid 'MThd' header.

     Non existing files, or files that do not meet the header criteria
     will return false.

     Inputs
     ......

     FILENAME - filename of file to check.

     Outputs
     .......

     ISMIDI - true if it is a midi file, false otherwise

     See also: midifileread, midifilewrite.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Check if FILENAME is a midi file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
mel2hz


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 357
 -- HZ = mel2hz (MEL)
     Convert equivalent mel frequency to Hz.

     Inputs
     ......

     MEL - input frequency in mel.

     Outputs
     .......

     HZ - Output frequency in Hz.

     References
     ..........

     O'Shaghnessy, Douglas.  ‘Speech Communication: Human and Machine.
     Reading, MA: Addison-Wesley Publishing Company, 1987’


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Convert equivalent mel frequency to Hz.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
midicallback


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1303
 -- OLDHANDLE = midicallback (MIDICONTROLSOBJ, FUNCTIONHANDLE)
 -- OLDHANDLE = midicallback (MIDICONTROLSOBJ, [])
 -- CURRHANDLE = midicallback (MIDICONTROLSOBJ)
     Get, set or clear the midicontrol object callback.

     Inputs
     ......

     MIDICONTROLOBJ - control object created using midicontrols.

     FUNCTIONHANDLE - function handle to set for call back.  If it is
     [], the callback function will be cleared.

     *NOTE*: currently anonymous functions will not work.

     *NOTE*: callbacks should be cleared before losing all references to
     the midicontrols object.

     Outputs
     .......

     OLDHANDLE The previously set midicallback function handle when
     setting a new callback.

     CURRHANDLE The current set midicallback function handle.

     Examples
     ........

     Set a callback on a midicontrols object
          ctrl = midicontrols(2001)
          function dispCallback(ctrl),disp(midiread(ctrl)),endfunction;
          midicallback(ctrl, @dispCallback);

     Clear the callback on a midicontrols object
          ctrl = midicontrols(2001)
          midicallback(ctrl, []);

     Get the current callback on a midicontrols object
          ctrl = midicontrols(2001)
          cb = midicallback(ctrl);

     See also: midicontrols, midisync, midiread.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Get, set or clear the midicontrol object callback.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
midicontrols


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1267
 -- OBJ = midicontrols ()
 -- OBJ = midicontrols (CTRLID)
 -- OBJ = midicontrols (CTRLID, INITIALVALUES)
 -- OBJ = midicontrols (__, PROPERTYNAME, PROPERTYVALUE)
     Create a midi controls object

     Inputs
     ......

     CTRLID - single control id or array of control ids to monitor, or
     [] to use any controller.
     INITIALVALUES - initial values to use for controls.  It should be
     the same size as CTRLID
     PROPERTYNAME, PROPERTYVALUE - properties to set on the controller.
     If a device is not specified the value from getpref("midi",
     "DefaultDevice", 0) will be used.

     Known properties are:
     mididevice
          name of the mididevice to monitor.
     outputmode
          the scaling mode for values: 'rawmidi' will return values
          between 0 ..  127, 'normalized' will use values between 0 ..
          1.

     Outputs
     .......

     OBJ - returns a midicontrols object

     Examples
     ........

     Create a midicontrols object monitoring control id 2001 on the
     default midi device
          ctrl = midicontrols(2001)

     Create a midicontrols object monitoring control id 2001 on a a non
     default device
          ctrl = midicontrols(2001, 'mididevice', 1)

     See also: midiread, midisync.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Create a midi controls object



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
mididevice


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1528
 -- DEV = mididevice (MIDIDEV)
 -- DEV = mididevice (MIDIDIR, MIDIDEV)
 -- DEV = mididevice ("input", MIDIINDEV, "output", MIDIOUTDEV)
     Create a midi device using the input parameters.

     When a single device name or id is provided, attempt to create the
     midi device using the same name for both input and output.

     Otherwise, use the name or device id for the given input or output
     direction.

     Inputs
     ......

     MIDIDEV - name or id of device to load.
     MIDIDIR - midi direction of "input" or "output"
     MIDIINDEV - midi input name or id
     MIDIOUTDEV - midi output name or id

     Outputs
     .......

     DEV - octave_midi class for opened device

     Properties
     ..........

     INPUT - Input device name (read only).
     OUTPUT - Output device name (read only).
     INPUTID - Input device id (read only).
     OUTPUTID - Output device id (read only).

     Examples
     ........

     Open midi device with ID of 0.
          > dev = mididevice(0);

           mididevice connected to
             input: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (1)
             output: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (0)

     Open a named midi device:
          > dev = mididevice("SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0");

           mididevice connected to
             input: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (1)
             output: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (0)

     See also: mididevinfo.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Create a midi device using the input parameters.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
mididevinfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1768
 -- DEVLIST = mididevinfo ()
 -- mididevinfo ()
     Retrieve the midi devices detected within the system.

     The list will be stored with variable DEVLIST as either a input or
     output device.  If no output variable is provided, the devices will
     be displayed.

     Inputs
     ......

     None

     Outputs
     .......

     DEVLIST - a structure containing the midi device information

     Examples
     ........

     Display the known devices of the system.
          > mididevinfo

          MIDI devices available
          ID Direction Interface  Name
           0 output    Alsa       Midi Through:Midi Through Port-0 14:0
           1 output    Alsa       Ensoniq AudioPCI:ES1371 16:0
           2 output    Alsa       SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0
           3 input     Alsa       Midi Through:Midi Through Port-0 14:0
           4 input     Alsa       Ensoniq AudioPCI:ES1371 16:0
           5 input     Alsa       SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0

     Assign variable MIDIDEVICES with the values from the known devices
          > mididevices = mididevinfo

          mididevices =
           scalar structure containing the fields:
             input =
             {
               [1,1] =
                 scalar structure containing the fields:
                   Name = SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0
                   Interface = Alsa
                   ID =  0
             }
             output =
             {
               [1,1] =
                 scalar structure containing the fields:
                   Name = SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0
                   Interface = Alsa
                   ID =  1
             }

     See also: mididevice.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Retrieve the midi devices detected within the system.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
midifileinfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 530
 -- INFO = midifileinfo (FILENAME)
     Read MIDI file and display information about the tracks and data

     Inputs
     ......

     FILENAME - filename of file to open.

     Outputs
     .......

     INFO - structure of the midi file data with the following fields:
     filename
          the name of the file
     header
          The header block information
     track
          An array of tracks read from the file
     other
          An array of non-track midi blocks read from the file

     See also: midifileread.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Read MIDI file and display information about the tracks and data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
midifileread


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 520
 -- MSG = midifileread (FILENAME, [propertyname, propertyvalue ...])
     Read MIDI file into a midimsg

     Inputs
     ......

     FILENAME - filename of file to open.
     PROPERTYNAME, PROPERYVALUE - optional propertyname/value pairs.

     Known property values are:
     includemetaevents
          A True/False value to include MetaEvents in the out message
          list.

     Outputs
     .......

     MSG - a midimsg struct containing the messages read from the file

     See also: midifileinfo, midimsg.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Read MIDI file into a midimsg



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
midifilewrite


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 721
 -- midifilewrite (FILENAME, MSGS)
 -- midifilewrite (FILENAME, MSGS, OPTIONNAME, OPTIONVALUE)
     Write a midifile

     Inputs
     ......

     FILENAME - filename of file to open.
     MSG - a midimsg struct or a cell array of midimsg containing data
     to write to file
     OPTIONNAME, OPTIONVALUE - option value/name pairs

     Known options are:
     format
          MIDI file format number.  (0 (default), 1, 2)

     Where format is 0, if a cell array is passed to midifilewrite, the
     midimsg values will be concatenated together before saving.

     Were format is not 0, the cell array is treated as tracks of
     misimsg.

     Outputs
     .......

     None

     See also: midifileread, midimsg.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Write a midifile



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
midiflush


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 300
 -- midiflush (DEV)
     Flush the receive buffers on a midi device

     Inputs
     ......

     DEV - midi device opened using mididevice

     Outputs
     .......

     None

     Examples
     ........

     Flush a midi device
          midiflush(dev);

     See also: mididevice, midireceive.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Flush the receive buffers on a midi device



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
midiid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 653
 -- [CTRLID, DEV] = midiid ()
     Scan for control messages from midi devices to get the id of the
     device

     Function will display a prompt for the user to move the midi
     control and return when a control messages is detected or ctrl-C is
     pressed.

     Inputs
     ......

     None

     Outputs
     .......

     CTRLID - control id made from the controller channel * 1000 +
     controller number.
     DEV = name of the midi device the controller was detected on.

     Examples
     ........

     Monitor midi devices for first moving controller
          [ctrlid, devname] = midiid()

     See also: mididevinfo, midicontrols.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Scan for control messages from midi devices to get the id of the device



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
midimsg


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5547
 -- MSG = midimsg (0)
 -- MSG = midimsg (TYPE ....)
 -- MSG = midimsg ("note", CHANNEL, NOTE, VELOCITY, DURATION,
          TIMESTAMP)
 -- MSG = midimsg ("noteon", CHANNEL, NOTE, VELOCITY, TIMESTAMP)
 -- MSG = midimsg ("noteoff", CHANNEL, NOTE, VELOCITY, TIMESTAMP)
 -- MSG = midimsg ("programchange", CHANNEL, PROG, TIMESTAMP)
 -- MSG = midimsg ("controlchange", CHANNEL, CCNUM, CCVAL, TIMESTAMP)
 -- MSG = midimsg ("polykeypressure", CHANNEL, NOTE, KEYPRESSURE,
          TIMESTAMP)
 -- MSG = midimsg ("channelpressure", CHANNEL, CHANPRESSURE,
          TIMESTAMP)
 -- MSG = midimsg ("localcontrol", CHANNEL, LOCALCONTROL, TIMESTAMP)
 -- MSG = midimsg ("pitchbend", CHANNEL, PITCHCHANGE, TIMESTAMP)
 -- MSG = midimsg ("polyon", CHANNEL, TIMESTAMP)
 -- MSG = midimsg ("monoon", CHANNEL, MONOCHANNELS, TIMESTAMP)
 -- MSG = midimsg ("omnion", CHANNEL, TIMESTAMP)
 -- MSG = midimsg ("omnioff", CHANNEL, TIMESTAMP)
 -- MSG = midimsg ("allsoundoff", CHANNEL, TIMESTAMP)
 -- MSG = midimsg ("allnotesoff", CHANNEL, TIMESTAMP)
 -- MSG = midimsg ("resetallcontrollers", CHANNEL, TIMESTAMP)
 -- MSG = midimsg ("start", TIMESTAMP)
 -- MSG = midimsg ("stop", TIMESTAMP)
 -- MSG = midimsg ("continue", TIMESTAMP)
 -- MSG = midimsg ("systemreset", TIMESTAMP)
 -- MSG = midimsg ("activesensing", TIMESTAMP)
 -- MSG = midimsg ("timingclock", TIMESTAMP)
 -- MSG = midimsg ("systemexclusive", TIMESTAMP)
 -- MSG = midimsg ("systemexclusive", BYTES, TIMESTAMP)
 -- MSG = midimsg ("eox", TIMESTAMP)
 -- MSG = midimsg ("data", BYTES, TIMESTAMP)
 -- MSG = midimsg ("songselect", SONG, TIMESTAMP)
 -- MSG = midimsg ("songpositionpointer", SONGPOSITION, TIMESTAMP)
 -- MSG = midimsg ("tunerequest", TIMESTAMP)
 -- MSG = midimsg ("miditimecodequarterframe", TIMESEQ, TIMEVALUE,
          TIMESTAMP)
     Create a midimsg object

     If the input parameter is 0, create an empty midi message object
     Otherwise the first variable is the type of message to create,
     followed by the additional parameters for the message.

     For each message type, the timestamp value is optional.

     Inputs
     ......

     TYPE - string message type or a midimsgtype.
     TIMESTAMP - optional seconds time stamp for the event
     CHANNEL - the channel to use for the message (1..16)
     NOTE - the value of the note to play/stop
     VELOCITY - the velocity value for a note on/off, with 0 stopping a
     note from sounding.
     DURATION - seconds between starting and stopping a note when
     created a 'note' message.
     PROG - program number when doing a program change message.
     CCNUM - control change control number.
     CCVAL - control change control value.
     KEYPRESSURE - key pressure value when creating a key pressure
     message.
     CHANPRESSURE - channel pressure value when creating a
     channelpressure message.
     PITCHCHANGE - pitch change value when creating a pitch bend
     message.
     LOCALCONTROL - boolean value when creating a localcontrol message.
     MONOCHANNELS - channels specified for a mono on message.
     BYTES - array of data in range of 0 to 127 specified as part of a
     data message or system exclusive message.
     SONG - song selection number for a song selection message.
     SONGPOSITION - song position value for a song position message.
     TIMESEQ - timecode sequence number for a miditimecodequarterframe
     message.
     TIMEVALUE - timecode value number for a miditimecodequarterframe
     message.

     Outputs
     .......

     MSG - a midimsg object containing the midi data of the message

     Properties
     ..........

     TIMESTAMP - timestamp of the message, or an array or timestamps if
     the the message is a compound message.
     MSGBYTES - the raw message bytes that make up the MIDI message.
     NUMMSGBYTES - the number of message bytes that make up the MIDI
     message.
     TYPE - string or midimsgtype that represents the message type.
     CHANNEL - the channel number for message.
     NOTE - the note value for message (Only valid for noteon/off and
     polykeypressure).
     VELOCITY - the velocity value for message (Only valid for
     noteon/off).
     KEYPRESSURE - the keypressure value for message (Only valid for
     polykeypressure).
     CHANNELPRESSURE - the chanpressure value for message (Only valid
     for channelpressure).
     LOCALCONTROL - the localcontrol value for message (Only valid for
     localcontrol messages).
     MONOCHANNELS - channels specified for a mono on message.
     PROGRAM - program number specified for a program change message.
     CCNUMBER - control change number specified for a control change
     message.
     CCVALUE - control change value specified for a control change
     message.
     SONG - song number for a song selection message.
     SONGPOSITION - song position value for a song position message.
     PITCHCHANGE - pitch change value for a pitch bend message.
     TIMECODESEQUENCE - timecode sequence number for a
     miditimecodequarterframe message.
     TIMECODEVALUE - timecode value number for a
     miditimecodequarterframe message.

     Examples
     ........

     Create a note on/off pair with a duration of 1.5 seconds
          msg = midimsg('note', 1, 60, 100, 1.5)

     Create a separate note on/off pair with a time between them of 1.5
     seconds
          msg = [midimsg('noteon', 1, 60, 100, 0), midimsg('noteoff', 1, 60, 0, 1.5)]

     Create a system reset message
          msg = midimsg('systemreset')

     See also: midifileread, midisend, midireceive, midimsgtype.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Create a midimsg object



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
midimsgtype


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1089
 -- midimsgtype
     A midimsg type enumeration for values of the midimsg type.

     Enumeration values are:
     Data           Stop                          SongPositionPointer
     PolyOn         PolyKeyPressure               NoteOff
     EOX            ActiveSensing                 SongSelect
     MonoOn         ChannelPressure               ControlChange
     TimingClock    SystemReset                   AllSoundOff
     OmniOn         PitchBend                     ProgramChange
     Start          TuneRequest                   ResetAllControllers
     OmniOff        Undefined                     SystemExclusive
     Continue       MIDITimeCodeQuarterFrame      LocalControl
     AllNotesOff    MetaEvent

     The enumeration value can be used instead of a string in midimsg
     creation.

     Examples
     ........

     Use both a string and a midimsgtype for the type parameter of a
     midimsg.

          # both statements are equivalent
          msg = midimsg('NoteOn', 1, 60, 100);
          msg = midimsg(midimsgtype.NoteOn, 1, 60, 100);

     See also: midimsg.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
A midimsg type enumeration for values of the midimsg type.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
midiread


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 677
 -- VAL = midiread (MIDICONTROLSOBJ)
     Read current values of midi controls

     Inputs
     ......

     MIDICONTROLOBJ - control object created using midicontrols

     Outputs
     .......

     VAL single value or array of current values from the midi device.

     Examples
     ........

     Read current value of midicontrols with a ctrlid 2001 on the
     default midi device.
          ctrl = midicontrols(2001)
          val = midiread(ctrl);

     Read current value of midicontrols with a ctrlid 2001 on a non
     default midi device.
          ctrl = midicontrols(2001, 'mididevice', 1)
          val = midiread(ctrl);

     See also: midicontrols, midisync.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Read current values of midi controls



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
midireceive


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 832
 -- MIDIMSG = midireceive (DEV)
 -- MIDIMSG = midireceive (DEV, MAXMSG)
     Attempt to receive midi messages from a midi device.

     Inputs
     ......

     DEV - a octave midi device opened using mididevice.
     MAXMSG - Maximum number of messages to retrieve.  If not specified,
     the function will attempt to get all pending.

     Outputs
     .......

     MIDIMSG - a midimsg containing the messages retrieved from the
     device.
     If no messages are available, MIDIMSG will be empty.

     Examples
     ........

     Open device 0, and poll and display read messages
          dev = mididevice(0);
          while true
             mx = midireceive(dev);
             if !isempty(mx)
               % display message
               mx
             endif
          endwhile

     See also: mididevice, midisend.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Attempt to receive midi messages from a midi device.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
midisend


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 594
 -- midisend (DEV, MSG)
 -- midisend (DEV, ...)
     Send a midimsg to a midi device

     Inputs
     ......

     DEV - midi device opened using mididevice
     MSG - a midi message class with messages to send to the midi device
     If the msg isn't a midimsg class, the input data is expected to be
     in same format as the inputs to a midimsg object.

     Outputs
     .......

     None

     Examples
     ........

     Send a note on/off command to a opened midi device DEV
          midisend(dev, midimsg("note", 1, 60, 100, 2.0));

     See also: midimsg, mididevice, midireceive.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Send a midimsg to a midi device



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
midisync


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 596
 -- midisync (MIDICONTROLSOBJ)
 -- midisync (MIDICONTROLSOBJ, CTRLVALUES)
     Send the values of control object to the control, using CTRLVALUES
     values if specified instead

     Inputs
     ......

     MIDICONTROLOBJ - control object created using midicontrols
     CTRLVALUES - values to send to the controls instead of initial
     values

     Outputs
     .......

     None

     Examples
     ........

     Send sync command to a midicontrols with a ctrlid 2001 to set a
     value of 1
          ctrl = midicontrols(2001)
          midisync(ctrl, 1);

     See also: midicontrols.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Send the values of control object to the control, using CTRLVALUES
values if ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
phon2sone


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 867
 -- SONE = phon2sone (PHON)
 -- SONE = phon2sone (PHON, STANDARD)
     Convert from phon to sone

     Inputs
     ......

     PHON - Loudness level in phon

     STANDARD - Standard to use in conversion.  Options are 'ISO 532-1'
     or 'ISO 532-2'.

     'ISO 532-1' is used if no standard is provided.

     Outputs
     .......

     SONE - Loudness level in sone

     Examples
     ........

     Convert 100 phon to sone
          sone = phon2sone(100)

     References
     ..........

     International Organization for Standardization., ‘ISO 532-1
     Acoustics – Methods for calculating loudness – Part 1: Zwicker
     method.’

     International Organization for Standardization., ‘ISO 532-2
     Acoustics – Methods for calculating loudness – Part 2:
     Moore-Glasberg method.’

     https://sengpielaudio.com/calculatorSonephon.htm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Convert from phon to sone



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
sone2phon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 868
 -- PHON = sone2phon (SONE)
 -- PHON = sone2phon (SONE, STANDARD)
     Convert from sone to phon.

     Inputs
     ......

     SONE - Loudness level in sone

     STANDARD - Standard to use in conversion.  Options are 'ISO 532-1'
     or 'ISO 532-2'.

     'ISO 532-1' is used if no standard is provided.

     Outputs
     .......

     SONE - Loudness level in sone

     Examples
     ........

     Convert 100 sone to phon
          phon = sone2phon(100)

     References
     ..........

     International Organization for Standardization., ‘ISO 532-1
     Acoustics – Methods for calculating loudness – Part 1: Zwicker
     method.’

     International Organization for Standardization., ‘ISO 532-2
     Acoustics – Methods for calculating loudness – Part 2:
     Moore-Glasberg method.’

     https://sengpielaudio.com/calculatorSonephon.htm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Convert from sone to phon.





