LitDev Extension API

Geography LD3DView LDArray LDBits LDBlueTooth
LDCall LDChart LDClient LDClipboard LDColours
LDCommPort LDController LDControls LDCursors LDDataBase
LDDateTime LDDebug LDDialogs LDDictionary LDEffect
LDEmail LDEncryption LDEvents LDFastArray LDFastShapes
LDFigures LDFile LDFocus LDftp LDGeography
LDGraph LDGraphicsWindow LDHashTable LDHID LDIcon
LDImage LDInline LDIOWarrior LDList LDLogic
LDMath LDMathX LDMatrix LDMusic LDNetwork
LDPhysics LDProcess LDQueue LDRegex LDResources
LDScrollBars LDSearch LDServer LDSettings LDShapes
LDShell LDSort LDSound LDSpeech LDStatistics
LDStopwatch LDText LDTextWindow LDTimer LDTranslate
LDUnits LDUtilities LDVector LDWaveForm LDWebCam
LDWindows LDxml LDZip

LDMusic
Extends the Sound.PlayMusic method to include a variety of instrument sounds.
Also, multi-channel music can be created.
Due to the large number of instrument names, it is easy to miss the following properties:
Instrument, Velocity, Volume, Pan and Channel.


Channel EndNote Instrument
InstrumentName Pan PlayMusic
PlayMusic2 PlayNote Reset
Velocity Volume

Channel
Set the MIDI channel (1 to 16, default 1).
Used by PlayMusic, Instrument, Velocity, Volume and Pan.


EndNote(value)
Stop a note being played.
value The note to stop (this is the value returned by PlayNote when the note was started).

Instrument
Set the musical instrument (1 to 128).
1 Acoustic_Grand_Piano
2 Bright_Acoustic_Piano
3 Electric_Grand_Piano
4 Honky_tonk_Piano
5 Electric_Piano_1
6 Electric_Piano_2
7 Harpsichord
8 Clavi
9 Celesta
10 Glockenspiel
11 Music_Box
12 Vibraphone
13 Marimba
14 Xylophone
15 Tubular_Bells
16 Dulcimer
17 Drawbar_Organ
18 Percussive_Organ
19 Rock_Organ
20 Church_Organ
21 Reed_Organ
22 Accordion
23 Harmonica
24 Tango_Accordion
25 Acoustic_Guitar_nylon
26 Acoustic_Guitar_steel
27 Electric_Guitar_jazz
28 Electric_Guitar_clean
29 Electric_Guitar_muted
30 Overdriven_Guitar
31 Distortion_Guitar
32 Guitar_harmonics
33 Acoustic_Bass
34 Electric_Bass_finger
35 Electric_Bass_pick
36 Fretless_Bass
37 Slap_Bass_1
38 Slap_Bass_2
39 Synth_Bass_1
40 Synth_Bass_2
41 Violin
42 Viola
43 Cello
44 Contrabass
45 Tremolo_Strings
46 Pizzicato_Strings
47 Orchestral_Harp
48 Timpani
49 String_Ensemble_1
50 String_Ensemble_2
51 SynthStrings_1
52 SynthStrings_2
53 Choir_Aahs
54 Voice_Oohs
55 Synth_Voice
56 Orchestra_Hit
57 Trumpet
58 Trombone
59 Tuba
60 Muted_Trumpet
61 French_Horn
62 Brass_Section
63 SynthBrass_1
64 SynthBrass_2
65 Soprano_Sax
66 Alto_Sax
67 Tenor_Sax
68 Baritone_Sax
69 Oboe
70 English_Horn
71 Bassoon
72 Clarinet
73 Piccolo
74 Flute
75 Recorder
76 Pan_Flute
77 Blown_Bottle
78 Shakuhachi
79 Whistle
80 Ocarina
81 Lead_1_square
82 Lead_2_sawtooth
83 Lead_3_calliope
84 Lead_4_chiff
85 Lead_5_charang
86 Lead_6_voice
87 Lead_7_fifths
88 Lead_8_bass_lead
89 Pad_1_new_age
90 Pad_2_warm
91 Pad_3_polysynth
92 Pad_4_choir
93 Pad_5_bowed
94 Pad_6_metallic
95 Pad_7_halo
96 Pad_8_sweep
97 FX_1_rain
98 FX_2_soundtrack
99 FX_3_crystal
100 FX_4_atmosphere
101 FX_5_brightness
102 FX_6_goblins
103 FX_7_echoes
104 FX_8_sci_fi
105 Sitar
106 Banjo
107 Shamisen
108 Koto
109 Kalimba
110 Bag_pipe
111 Fiddle
112 Shanai
113 Tinkle_Bell
114 Agogo
115 Steel_Drums
116 Woodblock
117 Taiko_Drum
118 Melodic_Tom
119 Synth_Drum
120 Reverse_Cymbal
121 Guitar_Fret_Noise
122 Breath_Noise
123 Seashore
124 Bird_Tweet
125 Telephone_Ring
126 Helicopter
127 Applause
128 Gunshot


InstrumentName(instrument)
Get an instrument name from its number.
instrument The instrument number.
returns
Pan
Set the key pan balance left (-100) or right (100) (default 0).

PlayMusic(notes)
Plays musical notes.
notes A set of musical notes to play. The format is a subset of the Music Markup Language supported by QBasic.
example code LDMusic.Instrument = LDMusic.Xylophone
LDMusic.PlayMusic("O5 C8 C8 G8 G8 A8 A8 G4 F8 F8 E8 E8 D8 D8 C2")


PlayMusic2(notes,instrument,velocity,volume,pan,channel)
Plays musical notes with specified instrument and MDI channel.
Also set volume, pan (balance) and velocity (key hit speed).

notes A set of musical notes to play. The format is a subset of the Music Markup Language supported by QBasic.
instrument The instrument number.
velocity The key velocity (1 to 128, default 100).
volume Volume (0 to 100, default 50).
pan Pan left (-100) or right (100) (default 0).
channel The MIDI channel (1 to 16).

PlayNote(octave,note,channel)
Play an individual note (allows multi-channel instruments).
octave The octave (0 to 8).
note The note ("A","F#","B-" etc).
channel The MIDI channel (1 to 16).
returns The note value being played.

Reset()
Reset (stop all music on all channels).

Velocity
Set the key velocity (1 to 128).
This is how hard a key was pressed (default 100).


Volume
Set the key volume (0 to 100, default 50).