Midi

From ActiveWiki
Jump to navigation Jump to search
Midi
Build

N/A

Version

4.1

The midi command allows you to directly interface with the Musical Instrument Digital Interface to play single notes or drum sounds. It should not be confused with the sound or noise commands, which can be used to play entire MIDI files. It is possible for a single object to trigger several notes or even chords at once.

Usage

midi [reset OR drumkit] instr=instr note=note vol=vol time=time [global] [omni] [reverb=reverb] [chorus=chorus] [mod=mod]

reset

The optional argument reset will reset the midi note player and passes execution to the midi file player.

drumkit

The argument drumkit will switch to the drumkit, so that different "notes" will make differing drum sounds. The arguments 'instr' and 'time' are not used with the drumkit.

instr

The argument instr defines the instrument to use. Possible numbers for instruments are in the range from 1 to 128. If no instrument, or an instrument out of range is defined, it will default to instrument 1. For a list of instruments and notes used by the drumkit look at [1].

note

The argument note defines the note to play. Possible numbers for instruments are in the range from 0 to 127. Be aware that depending on the selected instrument, the note could be out of range or not audible.

The note for Middle C, or the central note on a standard piano, is 60.

vol

The argument vol defines the volume for this note. The range from 0 to 100. If no volume is defined, it will default to the highest volume 100.

time

The argument time defines the duration the note is played in milliseconds. Possible values are in the range from 0 to 10000 (10 seconds). If no time is defined, it will default to 2000 milliseconds (2 seconds).

global

The argument global allows you to send the command to all users in visible range to the object, if the world has global commands enabled.

omni

The argument omni allows you to play the specified note exclusive. All other notes of the same instrument will be stopped before the given note is played.

mod, reverb, chorus

The arguments reverb, chorus and mod (modulation) are boolean values to toggle effects for the chosen instrument.

Notes

If no midi note is played for more than a minute, the midi note player will pass the midi functionality back to the midi file player and will issue an implicit midi reset.

The midi note player can be switched off by un-checking the 'Play effects' item on the Menu/Options/Settings/General property page.

Examples

activate midi note=51 instr=1
Object Scripting

Triggers: CreateBumpActivateAdoneAtCollideSdoneEnter ZoneExit Zone

Commands: AddforceAddtorqueAlpharefAnimateAstartAstopCameraColliderColltagColorCoronaEnviExamineFrameGroupLightLinkLockMatfxMediaMidiMoveNameNoiseOpacityPictureRotateSayScale SeqShadowShearSignSkewSkyboxSolidSoundTagTeleport / TeleportxTextureTimerURLVelocityVisibleWarpWeb nl:Commando:Midi