<GMT>

FAQ's


source-zip

Topic index:


GMT Setup Window

Q.: How to set up your applications such that the setup screen allows you to select the externally connected midi devices you want to use?

A.:

Open GMT_***.INI with any ASCII editor (Notepad, Dos edit, Wordpad etc... all do fine). Search the section delimited with [MIDI] and [MIDI_END]. (These delimiters are known as declared constants in GMT).
Now suppose you have equipment of following brands and types:


UnTechBrand
LogoTronics
Mayaha


Lets add pop-up menu groups to allow us to select these brands. After [MIDI] we type (exactly):


nrgroups, 3
0, UnTechBrand
1, Logotronics
2, MayaHa

The 'nrgroups' is a keyword and should be followed by the number of categories we want to become selectable. This deterimes the number of pop-up menus in the setupup window.
Thus we created Untechbrand as menuchoice group 0, Logotronics as menuchoice group 1 and Mayaha as menuchoice group 2.
Now we have to enumerate all the devices we have in each brand-group or category. Suppose we have following devices:


UnTechBrand:
PQ3 PainoSynth
SW2 pitch to midi converter

LogoTronics
PlayerPiano
Piperola

Mayaha
GS10 GranuSynth 1
GS10 GranuSynth 2



After our data section, we go on adding, as follows. Pay attention to keywordcase and commas when entering the data...


[MIDI]
nrgroups, 3
0, UnTechBrand
1, Logotronics
2, MayaHa

GROUP 0
nrdevs, 2
0, PQ3 PainoSynth
1, SW2 pitch to midi converter

GROUP 1
nrdevs, 2
0, PlayerPiano
1, Piperola

GROUP 2
nrdevs, 2
0, GD10 GranuSynth 1
1, GD10 GranuSynth 2

[MIDI_END]


We are almost done now, but we still have to add 3 parameters for each piece of equipment we want to implement. The first parameter, the first number to follow the name of a piece of equipment, reflects the MIDI-IN port this device is connected to. If you have only a single port, this number should be 0. If you do not expect this device to be connected to any midi input port, enter the number -1. The second parameter quite analogue, specifies the midi-output port the piece of equipment is connected to. Again, if not connected to a midi-out port, you should enter -1. The third and very last parameter lets you specify the ID number you might have setup internally for you piece of equiment. Synthesizers ofter use ID numbers such that we can have many of the same brand and still program then individually using sysex's. If you do not plan to use this number, you can enter 0.
So, with these additions, the data section becomes complete and should look and read like:


[MIDI]
nrgroups, 3
0, UnTechBrand
1, Logotronics
2, MayaHa

GROUP 0
nrdevs, 2
0, PQ3 PainoSynth, -1, 0, 0
1, SW2 pitch to midi converter, 0,-1,0

GROUP 1
nrdevs, 2
0, PlayerPiano, -1,1,0
1, Piperola, -1,1,0

GROUP 2
nrdevs, 2
0, GD10 GranuSynth 1,0,0,0
1, GD10 GranuSynth 2,0,0,1

[MIDI_END]


You can always consult sample INI files as found on our website.


Audio Mixer

Q.: I cannot get the audio mixer, or my favorite audio mixer, displayed from GMT?

A.: The mixer display used by GMT can be any mixer working under Windows. As default <GMT> tries to use the standard mixer that comes with Windows98 and Windows 2000. It runs this applet using a shell command calling the executable for the mixer. This program is normally "sndvol32.exe" and should reside under the normal windows directory (C:\Windows). If you want to use GMT with another default mixer, you should change the constant in the constant declaration file for GMT. Look for the string constant $WinMix, in the file gmt_kons.bi and replace it with the name (and full path to) of the mixer program you want to use. Recompile the program.


NiDAQ test panel

Q.: Although I installed Ni-DAQ properly, I cannot select/run the test panel for my devices.

A.: We assume you did install NiDAQ version 6.90 or higher (you can download it from National Instruments website, but be prepared that the zips are some 24MByte large!) on the default locations on your C: drive. If you installed the soft somewere else, you have to change the declared constant in the constant declaration file for <GMT> (gmt_kons.bi) accordingly. Look for the constant named $NiDAQtestpanel. The program name is normally "C:\Windows\System\NITPan32.exe". After you made changes, you must recompile GMT.


Data Acquisition

Q.: Can I use GMT with data acquisition devices other than National Instruments

A.: We have developed <GMT> and its data acquisition components specially to work in combination with National Instruments hard- and software. Although we have also code supporting Arcom, TiePie and Contec devices, we do not continue supporting these, mainly because either their devices still use ISA busses, or, their support software is'nt 32-bit Windows compatible nor open. Of course you can use other brands and devices but you will have to provide your own low level code. We know National Instruments are'nt the cheapest in the market place, but they definitely are amongst the most reliable and professional brands.

Note that our data acquisition modules in <GMT> cannot run nor even be compiled without both NI hardware and NiDAQ software. For musicians-use we strongly advize you to consider following devices: (newer devices may of course come out...)


DLL Library use

Q.: Can I use the library functions and procedures in g_lib.dll, g_indep.dll, g_mus.dll... in other software projects than the <GMT> framework?

A.: Yes. Our libraries were designed to be truly stand alone. So, if you include the essential declaration files, including the Win32 api itself, you can call in any procedure contained in our libraries..

As an example we give here a small program written for the Power Basic console compiler, wherein midi functions and procedures are used. As you will see, we wrote the utility to evaluate and annotate quickly all patches provided by the EMU Proteus2000 synthesizer. Of course you can modify the program to the hardware you happen to own. Note that the compiled program should be put in your C:\b\pb\gmt directory in order to run properly.

' *********************************************
' * Simple Patch evaluator *
' * 05.01.2000 *
' * by *
' * Dr.Godfried-Willem Raes *
' *********************************************

#INCLUDE "C:\B\pb\Winapi\win32api.inc"
' meta-compiler statement - include Windows functions
#INCLUDE "C:\B\pb\gmt\gmt_kons.bi"
' include constants for GMT
#INCLUDE "C:\B\pb\gmt\gmt_type.bi"
' include structures
#INCLUDE "C:\B\pb\gmt\g_lib.bi"
' include DLL library via the declarations

GLOBAL prg AS WORD
GLOBAL Mq AS MidiEquipment
GLOBAL n&
GLOBAL pStop AS BYTE

DECLARE SUB KeyHandler (k$)

FUNCTION PBMAIN


LOCAL i AS LONG
LOCAL hmo AS LONG

CONSOLE SCREEN 34,80
CONSOLE NAME "Patch Evaluator"
Mq.naam = "PROTEUS2000"
Mq.id = %False

n& = FREEFILE
OPEN "Patch_Evaluations.txt" FOR OUTPUT AS #n&

PRINT# n&, "Patch evaluation - annotation file"
PRINT# n&, Mq.naam, DATE$, TIME$
PRINT# n&, "**********************************"
hmo = OpenMidiOutputDevice (0)
IF ISFALSE hmo THEN
LOCATE 1,1 :PRINT "Cannot open midi output device" : EXIT FUNCTION
ELSE
LOCATE 1,1: PRINT "Midi device opened succesfully"
END IF
prg = %False


Proteuspatch Mq,0, prg
' if you have another synth you can use the ProgChange procedure in the library
ModeMess 0,10,64
ModeMess 0,7, 120
DO
FOR i = 36 TO 82
LOCATE 5,1
PRINT "Patch=";prg, "Note="; i
Play 0,Gray(i), 64
SLEEP 250
NoteOff 0,Gray(i)
Keyhandler INKEY$
NEXT i
INCR prg
Proteuspatch Mq,0, prg
LOOP UNTIL ISTRUE Pstop
CLOSE #n&
midiInClose hmo
' winAPI mode - we should close the devices

END FUNCTION


SUB KeyHandler (k$)


LOCAL comment AS STRING

SELECT CASE k$
CASE ""
EXIT SUB
CASE "+"
INCR prg
Proteuspatch Mq,0, prg
CASE "-"
IF prg > 0 THEN DECR prg
Proteuspatch Mq,0, prg
CASE " "
' record a comment, and write it to the file...
comment = ""
LOCATE 10,1
PRINT STRING$(70," ");
DO
k$=INKEY$
IF k$ <> "" THEN
comment = comment & k$
LOCATE 10,1 : PRINT comment;
END IF
LOOP UNTIL k$ = CHR$(13)
PRINT# n&, "PATCH Nr=";prg,"Comment: ";comment
CASE "*"
CLOSE
Pstop = %True
END SELECT


END SUB


Using the DLL library with other 32-bit programming languages and compilers

Q.: Can I use the library functions and procedures with Visual Basic?

Definitely yes. However you have to edit some of the declarations. Read the appendices in the help files that come with Power Basic. You can also find the information on their website. Visual Basic is pretty good at designing visual interfaces, exactly something we did not take much care off, since we concentrated on speed and performance. However, by using Visual Basic for anything else than creating an interface you risk ruining the advantages of the very fast compiler Power Basic offers as well as of the inherent speed of our library.

Q.: Can I use the library functions and procedures with a C compiler?

Definitely yes. However you have to edit the declarations of all exported function and procedures. The order in which parameters are passed is normally inverted. This is clearly explained in the Microsoft documentation. Our libary follows standard conventions for passing parameters.(the same as Basic, Fortran...) If you feel unsure about the conversion compare the declarations fir the Win32Api for C with those you find in gmt_includes.zip for power basic. You should find equivalents for just about anything. Its pretty simple you write a macro that handles all find/replaces automatically. We just dont have the time providing updated C declaration files all the time as well...(Any candidates around?)


Win32 API

For some reason unknown to us, Power Basic did not include declarations for all functions and procedures exported by the Windows API in its Win32Api.INC file. Our code uses many functions not declared in PB's include file. For this reason you have to use our own version of Win32api.inc for all your GMT code development. Our file can be found by unzipping the gmt_includes.zip file available on the logos website. The minimum version to be used when compiling GMT code is in the file called g_win.inc

Exemples of functions added are: ZeroMemory, FillMemory, Wave functions.

Also some type declarations as well as constants required to work with the win32api are missing in PB's file.

If you upgraded GMT to version 9.10 (october 2006) , you also need to upgrade your include files.


Graphics in GMT windows

Here is a complete example of how an animated graph can be coded in any GMT window having a handle in the global gh.xxx structure. Note that this code sample is written to run as a task.


SUB RadarTriangle () EXPORT

STATIC Tr AS RadarTriangleType
LOCAL Ti AS RadarTriangleType
LOCAL WndRect AS FOURLONGS
STATIC Wr AS FOURLONGS
LOCAL point AS POINTL ' two longs
LOCAL hDC AS LONG
LOCAL hp AS LONG ' drawing pen handle

IF ISFALSE gh.melpat THEN EXIT SUB ' this in we want to use the melodypattern window to draw. Any window can be used.

STATIC t AS SINGLE
LOCAL Zsig AS SINGLE
LOCAL Ysig AS SINGLE
LOCAL xsig AS SINGLE

GetClientRect gh.melpat, WndRect ' now we have WndRect.x , WndRect.y is always 0,0 !
' the WndRect.h , WndRect.b fields return is the window size.
IF (WndRect.b <> Wr.b) OR (WndRect.h <> Wr.h) THEN
' triangle will always fit in window...
IF WndRect.h -10 < WndRect.b * 0.866 THEN ' SQR(3) / 2
Tr.z = (WndRect.h * 1.155) - 10 ' 2 / SQR(3)
ELSEIF WndRect.b - 10 > (WndRect.h * 1.155) - 10 THEN
Tr.z = (WndRect.h * 1.155)-10
ELSE
Tr.z = (WndRect.b) - 10
END IF
Tr.h = (Tr.z * 0.866) ' heigth of the triangle
Tr.Tx = WndRect.b / 2
Tr.Ty = (WndRect.h - Tr.h)/ 2
Tr.Lx = (WndRect.b - Tr.z) /2
Tr.Ly = ((WndRect.h - Tr.h) / 2) + Tr.h
Tr.Rx = ((WndRect.b - Tr.z) / 2 ) + Tr.z
Tr.Ry = ((WndRect.h - Tr.h) / 2) + Tr.h
Tr.Cx = (Tr.Lx + Tr.Rx + Tr.Tx) / 3 ' coordinates center.
Tr.Cy = (Tr.Ly + Tr.Ry + Tr.Ty) / 3
Wr.b = WndRect.b
Wr.h = WndRect.h
END IF

' for demo:
t = t + 0.01
Zsig = ABS(SIN(t))
Ysig = ABS(SIN(t * 0.75))
Xsig = ABS(SIN(t * 0.5))

hDC = GetDC(gh.melpat)
PatBlt hDC,WndRect.x,WndRect.y,WndRect.b, WndRect.h, %WHITENESS ' wipe existing drawing
' draw a triangle in the window...
DIM pt(0 TO 2) AS LOCAL pointl
pt(0).x = Tr.Lx : pt(0).y = Tr.Ly
pt(1).x = Tr.Rx : pt(1).y = Tr.Ry
pt(2).x = Tr.Tx : Pt(2).y = Tr.Ty
DPtoLP hDC, pt(0), 3
PolyGon hDC, pt(0), 3

' calculate coordinates for inner movingtriangle:
Ti.Tx = Tr.Cx
Ti.Ty = Tr.Ty + (Tr.Cy - (Tr.Cy * Zsig))
IF Ti.Ty > Tr.Cy THEN Ti.Ty = Tr.Cy
Ti.Lx = Tr.Lx + (Tr.z * (1-Xsig) / 2 )
IF Ti.Lx > Tr.Cx THEN Ti.Lx = Tr.Cx
Ti.Ly = Tr.Ly - (Tr.h * (1-Xsig)/ 3 )
IF Ti.Ly < Tr.Cy THEN Ti.Ly = Tr.Cy
Ti.Rx = Tr.Rx - (Tr.z * (1-Ysig) / 2 )
IF Ti.Rx < Tr.Cx THEN Ti.Rx = Tr.Cx
Ti.Ry = Tr.Ry - (Tr.h * (1-Ysig)/3)
IF Ti.Ry < Tr.Cy THEN Ti.Ry = Tr.Cy
' find point of gravity of this new triangle:
Ti.Cx = (Ti.Tx + Ti.Lx + Ti.Rx) /3
Ti.Cy = (Ti.Ty + Ti.Ly + Ti.Ry) /3
' draw height-lines in outer triangle:
' from top to base:
MoveToEx hDC, Tr.Tx,Tr.Ty, point ' startpunt top
LineTo hDC, Ti.Tx, Ti.Ty
' from left corner:
MoveToEx hDC, Tr.Lx, Tr.Ly, point
LineTo hDC, Ti.Lx, Ti.Ly
' from right corner:
MoveToEx hDC, Tr.Rx, Tr.Ry, point
LineTo hDC, Ti.Rx, Ti.Ry

'DRAW CONNECTING INNER TRIANGLE:
pt(0).x = Ti.Lx : pt(0).y = Ti.Ly
pt(1).x = Ti.Rx : pt(1).y = Ti.Ry
pt(2).x = Ti.Tx : Pt(2).y = Ti.Ty
DPtoLP hDC, pt(0), 3
PolyGon hDC, pt(0), 3

hp = CreatePen (%PS_SOLID, 2, RGB(40,40,255)) ' blue
SelectObject hDC, hp
' draw center circle...
Ellipse hDC, Ti.Cx-5, Ti.Cy-5, Ti.Cx+5,Ti.Cy+5
' draw connection lines:
MoveToEx hDc, Ti.Lx, Ti.Ly, point
LineTo hDc, Ti.Cx, Ti.Cy
LineTo hDc, Ti.Rx, Ti.Ry
MoveToEx hDC, Ti.Tx, Ti.Ty, point
LineTo hDC, Ti.Cx,Ti.Cy

ReleaseDC gh.melpat, hDC
DeleteObject hp
END SUB


Limitations

MIDI & Networking limits

As the number of midi channels is , as set in the midi-standard, limited to 16 channels, we provided support for using multiple midi ports under GMT. However, the number of midi-ports you can select is also limited to 16, even though your Windows version may support more.

Likewise, if you prefer to use our UDP/IP communication support to replace MIDI, you are limited to a network of no more than 16 PC's. Note that the PC's in the network you want to use have to be enumerated in the INI file. Note that the UDP/IP alternative for midi is only implemented in GMT versions higher than nr. 6.05 (11/2002).

Audio limits

As for now, the number of audiochannels in our mixer is limited to 16.


What is GMT...

It is a public domain software project for Intel PC's that allows the making of personal tools for music, sound and interactive real-world creation. GMT is dedicated to composers that are looking for an environment allowing them to elaborate tools that are both powerful and original tools, beyond the rigidity of common computer music tools (sequencers, synthesizers, plug-ins, etc.). Developed at the Logos Foundation in Ghent, by Prof.Dr.Godfried-Willem Raes, in the late seventies and originally a multitasking system running under DOS, GMT has been used by quite a few musicians, composers, improvisers, sound and sound installations designers, etc. It has been benefiting from a constant and important development ever since and constitutes today a tool that, through its wide scope and its flexibility, is unique. Whether you are composer of electroacoustic, of instrumental or of techno music, GMT allows you to build setups that generate, transform and deliver MIDI and audio events according to various methods. For the creation of harmony (there is a very specialised musical harmony library) , as well as that of rhythm, of morphologies or of simple sounds, GMT offers a wide range of opportunities, whose main limits are the composers or musicianís imagination and his/her capacity to translate it into syntactically sound Basic statements. GMT requires the Power Basic DLL compiler. A particular strong point in GMT is its non-graphical orientation and its inherent ease of interfacing to external hardware electronics and self designed circuits (robots...) as well as its real time performance..

Main characteristics of GMT real-time environment:

Suitable for live, improvisation, interactive installations and any situation where time and gesture matter; may also work in a non real-time mode also when needed, e.g., to handle complex synthesis or analysis techniques; graphical user interfaces, both for creation and tool usage; opened to extensions made by third parties in the form of DLL libraries. The amount of such extensions is regularly growing; runs on Intel PC's only. Pentium processor required.


Visit Logos' Homepage Visit Godfried-Willem Raes' pages Get the Harmony Library for Basic

Last updated: 2007-01-20