AutoGam can also help you add sound to your application, with it you can :
Some uses :
There are three main functions : AutoGamInit, AutoGamPlay, AutoGamKill. Actually the API is for C++, but you can adapt it for another langage.
pluggam.lib | Libraries for pluggam. Link with your application |
pluggam.h | Declaration for pluggam, include it in your source code (C or C++) |
pluggam.dat | This file contains declarations of all object. Don't modify
it ! It must go in the directory with your GAM file. This file is read
when you call AutoGamInit . You must
distribute this file with your application. |
All functions returns 0 if error detected.
|
---|
Initialisation of Autogam, one executable call. |
|
path
|
directory for your GAM file. You must put all your GAM files in this directory and the file pluggam.dat. Example : "." or ".\\Music" don't forget double \ if your langage is C or C++ |
|
---|
Kill Autogam, one executable call. If you want play another gam file you must call |
|
---|
Load and play music, call as you want but you must call
|
|
hDevice
|
Handle of midi device. If you don't to want select it, set this parameter to -1. Autogam will select the most interesting device for you. |
file
|
Name of your GAM file. GAM file must be constructed using Autogam. Download it ! Example : "ballade.gam" |
|
---|
Set volume for music and percussion |
|
volglob
|
Volume of note, 0 to 100 |
volpercu
|
Volume for percussion |
|
---|
Stop the music |
|
---|
Modify the tempo of the music |
|
beat
|
Value between 10 to 6000 |
|
---|
By default, all midi events are treated with a delta-time of 10 ms, but you can change this delay with this function. If you set a too big a value, music is distorted. |
|
sleep
|
Value between 10 to 6000 |
|
---|
This function is useful for modifying object properties in
real-time. First you get handle of object with If you open another GAM file you must get a new handle |
|
nomalgo
|
Algo name which contains the object : Example : "Algo 1" |
nomobjet
|
Object name you want to find Example : "Sequ1" |
|
---|
This function is useful for modifying object properties in real-time. First you get handle of object with If you open another GAM file you must get another handle |
|
objet
|
Handle of object |
entry
|
Number of entry, from 0 to max entry -1, run Autogam to see number of entry. First entry is 0. |
value
|
Value to set, run Autogam to see value limit. Exceeding the value limit will cause unpredictable results ! |
// Handle modif de la musique
HANDLE AGModif[3];
AutoGamInit(".\\musique");
AutoGamPlay(-1, "Balade.gam");
AGModif[0] = AutoGamFind("Algo 2", "Not1");
AGModif[1] = AutoGamFind("Algo 2", "Not2");
AGModif[2] = AutoGamFind("Algo 2", "Not3");
... treatment ...
AutoGamValue(AGModif[0], 3, x);
AutoGamValue(AGModif[1], 3, y);
AutoGamValue(AGModif[2], 3, z);
... treatment ...
AutoGamKill();