PDA

View Full Version : How to play simple Midi melodies with ThinBasic using Sleep command or timers



maxer73
13-03-2013, 16:04
Hi to all,

with ThinBasic is now possible to play simple melodies with the sounds midi of Windows (Synth SW Microsoft GS Wavetable), or the sound of your sound card, or even the sounds of a hardware MIDI device connected to the MIDI port of the PC.

This can be done using timer controls or Sleep command and reading the notes stored in two string variables, one variable for notes and one for the timing of the notes.

I have attached two examples of how this can be done, one in CONSOLE mode and one in UI mode.

For now we need to use various API commands or include in project my MidiOut module, but later just use the command:

Uses "MIDI"
Eros has confirmed that has started writing the midi library and will be soon in the next versions of ThinBasic.

Hello :D
max

Petr Schreiber
13-03-2013, 21:32
Thank you Max,

this is great, worked perfectly on my PC :)


Petr

SteveOW
16-04-2013, 01:09
It worked straight away for me also, using Windows7 32 bit,i3 and ThinBasic 1.8.9.0.

Thankyou very much.