Table of Contents

Class MusicalInstrumentBehaviour

Namespace
GrindFest
Assembly
GrindFest.dll

Provides MIDI instrument functionality for playable musical items.

public class MusicalInstrumentBehaviour : MonoBehaviour
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
MusicalInstrumentBehaviour

Remarks

Musical Note Syntax:

  • Individual notes: "C4", "G3", "F#4", "Bb3"
  • Note with duration: "C4:1/2", "G3:1/4", "F#4:1/8"
  • Multiple notes (chord): "C4 E4 G4" (C major chord)
  • Chord with duration: "C4:1/2 E4:1/2 G4:1/2"

Duration Format:

  • :1 = whole note
  • :1/2 = half note
  • :1/4 = quarter note (default)
  • :1/8 = eighth note
  • :1/16 = sixteenth note

Note Format:

  • [Note Letter][Accidental(optional)][Octave]
  • Note Letter: A through G
  • Accidental: # (sharp) or b (flat)
  • Octave: 0 through 8

Examples:

  • "C4" = Middle C
  • "F#3" = F sharp in octave 3
  • "Bb4" = B flat in octave 4
  • "C4 E4 G4" = C major chord
  • "D4 F4 A4" = D minor chord

Usage:

  • Speak the notes to play them
  • Multiple notes spoken together will play as a chord
  • Double-click to play the default pattern
  • Can be played when equipped or when targeting the instrument

Fields

Chorus
CurrentPlayback
DefaultPattern
Equipable
InstrumentProgram
Interactive
Item
NoteLength
NotePressure
PlayingAnimation
Reverb
Volume

Properties

OutputDevice

Methods

Awake()
IsProbablyMusicCommand(string)
OnDestroy()
PlayMidiPattern(Pattern)
PlayNotePattern(string)
StopPlayback()