' ********************************************************** ' * < G > * ' * declaration of all user types (structures) * ' * version 10.05 * ' ********************************************************** ' do not change the order of these type declarations. #INCLUDE THIS ONCE TYPE HarmType Vel AS STRING * 128 ' complete harmony descriptor - this first, such that the pointer ' to this structure looks into the first byte C(11) AS SINGLE ' fuzzy shepard chord descriptor Dis AS SINGLE ' fuzzy dissonance of the harmony Kon AS SINGLE ' fuzzy consonance of the harmony - con is a reserved word for ' the MAT function in PB , so we have to use Kon here... Iprop(6) AS SINGLE ' interval property strenghts flag AS DWORD ' set when all fields have been updated (NOT of flag passed as param) END TYPE 'new type since 19.09.2006: TYPE QHarmType Vel AS STRING * 256 ' complete harmony descriptor - this first, such that the pointer ' to this structure looks into the first byte ' even places are 'normal' notes, odd places the quartertones. ' to get fractional midi, divide the stringposition pointer by 2 C(23) AS SINGLE ' fuzzy shepard chord descriptor, filled with GetPsiQChord procedure. Dis AS SINGLE ' acoustic dissonance of the harmony Kon AS SINGLE ' acoustic consonance of the harmony Iprop(12) AS SINGLE ' interval property strenghts flag AS DWORD ' set when all fields have been updated. (NOT of flag passed as param) END TYPE ' following is used as an array of 256 elements, one for every quartertone: DIM Qdipole(255) as QakuHartype ' new since 01.10.2006 TYPE QakuHarType Dis(255) AS SINGLE ' contains the acoustical dissonance for the dipole i,j in Qdipole(i).Dis(j) Kon(255) AS SINGLE ' acoustical consonance END TYPE TYPE RitmeType minduur AS SINGLE ' minimum duration for a sound event in this part (shortest note value) ' expressed in seconds maxduur AS SINGLE ' maximum duration for a sound event in this part (longest note duration) ' expressed in seconds pattern (%RitmArraySize) AS SINGLE ' positive values are sound, negatives are silence. ' The pattern ends when a zero is ' encountered. Values are proportional and have to be scaled by the user. END TYPE TYPE HarryType 'added 06/06/06 Rit AS Ritmetype Har(%RitmArraySize) AS Harmtype ' 256 strings, 128 bytes each = 32768 bytes END TYPE TYPE ExtraInfo nrsliders AS BYTE ' number of sliders in the parameter control dialog window for a task nrupdowns AS BYTE ' number of UP-Down controlls in the dialog window for a task nrTexts AS BYTE ' fixed to 2x12 in resource file nrButtons AS BYTE ' nr of buttons in the buddy window... hIcon AS DWORD ' handle for task-specific Icon - sometimes misused to pass pointers... SliderNumbers (11) AS BYTE ' these refer to the position in Slider() changed: was 0 to 63 ! UpDownNumbers (11) AS BYTE ' if there are none of the corresponding controls, these arrays should ButtonNumbers (11) AS BYTE ' contain only zeros. - not yet implemented. StartCptr AS DWORD ' contains a pointer to a procedure handling initialisation of a task StopCptr AS DWORD ' contains a pointer to a procedure handling clean up after stopping a task` ' these two added 15.10.2000 on request of Kristof Lauwers. END TYPE TYPE Taak DWORD swit AS DWORD ' switches tasks on or off . Unipolar bit variable. - use bit0 ' takes the values %True (=1) or %False (=0) ' If a task is done we can check the return value from the callback. ' If the task is released, bit 1 will be reset. ' 01.12.2002 changed to DWORD from BYTE for speed tog AS DWORD ' toggle switch for task initialisation and reset ' 01.12.2002 changed to DWORD from BYTE for speed rsi AS DWORD ' reschedule interval, or time last done in RT-mode - in ms - do not change manually freq AS SINGLE ' frequency in occurences per second - in Hz or cps ' max. freq = 1000 Hz, since Windows time resolution is 1 ms. tempo AS WORD ' tempo of the global period (bar) - expressed in MM channel AS WORD ' HIBYT= midi port, LOBYT = midi channel changed to WORD 10.12.1999 ' HIBIT(HIBYT) = UDP/IP network support patch AS WORD ' midi patch if applicable - changed to WORD 17.01.1999 (For Proteus...) level AS BYTE ' midi level for music tasks (scaled to 90dB scale for audio) pan AS BYTE ' midi/audio panning naam AS STRING * 8 ' make this similar to the procedure name - has to fit into space in cockpit starttime AS LONG ' starttime in %% for the task, used in autoscheduling mode stoptime AS LONG ' stoptime in %% for the task, for autoscheduling Har AS HarmType ' ref. see HarmonyLibrary Rit AS RitmeType ' used for storing rhythm information. cfr. lib manual. duur AS LONG ' task duration, for auto-switch OFF - used also to store tstart Cptr AS DWORD ' code pointer - = CODEPTR(taskprocedurename) hparam AS LONG ' handle of the window that handles parameter control - opened with right mouse button pX AS ExtraInfo PTR ' pointer to additional structure with parameter information & handles flags AS DWORD ' 15.09.1999 %MIDI_TASK = %d0 cfr declared constants. ' 20.04.2000 new flag added: %DLL_TASK, for tasks residing in the DLL ' 01.12.2002: New: you can no longer use hParam for anything else than as param.window handle. ' Putting hCockpit here, will crash GMT. '%MIDI_TASK = 1 ' bit 0 these tasks use midi I/O '%HARM_TASK = 2 ' bit 1 these tasks contribute to the global harmony context of the piece '%AUDIO_TASK = 4 ' bit 2 these tasks make use of the audio subsystem '%SCORE_TASK = 8 ' bit 3 the output of these tasks should be routed to the score seq file procedure '%AUTO_TASK = 16 ' bit 4 tasks flagged as auto cannot be started/stopped by the user from the cockpit. '%THREAD_TASK = 32 ' bit 5 the task runs as a separate thread '%PERTIM_TASK = 64 ' bit 6 the task is scheduled using a periodic timer event. ' ' Task().freq can only be changed after stopping the task. '%DLL_TASK = 128 ' bit 7 The task code resides in a gmt *.dll library '%HIDDEN_TASK = 256 ' bit 8 the task will not appear in the user cockpit. '%QUEUE_TASK = &H100 ' bit 9 use queued timer - experimental! only works if as well the executable s g_lib.dll are compiled with the ' %choose_timer_mode flag END TYPE TYPE GMT_HANDLES DWORD ' known in the DLL via the pointer: @gh. - 21.04.2000 Cockpit AS DWORD ' cockpit-window handle Setup AS DWORD ' main setup window handle Instdll AS DWORD ' instance handle for the g_lib.DLL Inst AS DWORD ' instance handle for the GMT application's executable (created in Winmain) HarVel AS DWORD ' handle for harvel draw window HarPsy AS DWORD ' handle for the harpsy chord window MelPat AS DWORD ' handle for music notation window Spec AS DWORD ' handle for wave or spectrum display window Graph AS DWORD VU AS DWORD ' handle for the DAQ bargraph display window List AS DWORD ' handle for list window used for debugging etc... wMix AS DWORD ' handle for the selected windows mixer device gnh AS DWORD ' instance handle for g_n*h.dll ' 09.07.2001 file AS DWORD ' instance handle for g_file.dll ' 22.11.2001 mus AS DWORD ' instance handle for g_mus.dll ' 10.01.2002 mm AS DWORD ' ctrl window for M&M robots ' 16.01.2005 hmix AS DWORD ' instance handle for g_wmix.dll ' 22.06.2006 END TYPE TYPE EVENT TimerId AS WORD ' obtained with timeSetEvent Cptr AS DWORD ' codepointer to the procedure handling the event END TYPE TYPE GMT_SYSEX_THREAD DWORD h AS DWORD ' holds the midiIn handle (hMidiI(0)) length AS DWORD ' length of the received string pSXBuf AS BYTE PTR ' DWORD pointer to the secondary buffer, BYTE PTR to first element of string. flags AS DWORD ' to be used to send the data to a file, to an array, to block sys-ex ... ID AS LONG ' handle . value returned by: thread create ... to ... cnt AS DWORD ' Counts received sysex msg's. Incremented in MidiInProc callback. END TYPE ' dll library - orchestration support - also used for M&M orchestra TYPE Musician naam AS STRING * 16 ' name for the instrument lowtes AS BYTE ' lowest possible midi note hightes AS BYTE ' highest possible midi note centr AS BYTE ' common note centre (average ambitus center) minvel AS BYTE ' lowest midi velocity value to trigger note ON's maxvel AS BYTE ' maximum allowable velo for some instruments (puff...) new 18.04.2009 minduur AS SINGLE ' minimum sound duration in milliseconds maxduur AS SINGLE ' maximum sound duration in milliseconds channel AS WORD ' midi port/channel - same structure as corresponding field in Taak polyphony AS WORD ' maximum number of simultaneous notes patch AS WORD ' midi patch to use - for midi robots this may get another meaning. Har(1) AS HarmType ' previous sounds, actual sound Dur(1) AS DWORD ' durations for previous field, expressed in milliseconds Ctrl(127) AS BYTE ' new 28.07.2003: 128 continuous controllers can now be implemented. cptrOffProc AS DWORD ' codepointer to panic procedure - should allways be checked before calling it!! cptrOnProc AS DWORD ' id. with default initialisation. ' 20.11.2004 Qhar(1) AS QHarmType ' added 20070323, so we can make the QInstrumPlay function to behave the same way as InstrumPlay END TYPE ' introduced for our real time music pattern recognition code TYPE PatternSequenceType Noot(15) AS INTEGER ' positive byte values= midi-notes, 0= silences, negative=anything else Velo(15) AS INTEGER ' only used sofar in , and Duur(15) AS SINGLE ' duration, expressed in seconds Lengte AS BYTE ' length of the pattern Score AS BYTE ' holds the number of flags set, so Score always points to the next note to ' be recognized. The maximum value is 15, or Lengte-1, whichever is smaller. Tempo AS INTEGER ' tempo in MM units Duurfout AS BYTE ' percentage of allowable error on durations NootFout AS BYTE ' nr. of semitones around given notes VeloFout AS BYTE ' percentage of allowable error on velocity Flags(15) AS BYTE ' recognition flags for individual entries in the pattern ' Flags are used in Cohiba and OboTek. Not in CelloPi. Later we may ' use them for storage of fuzzy values. AltNoot(15) AS INTEGER ' kl addition 030213 - alternative pattern for unreliable midi conversion END TYPE 'for aut9omatic glissandi on the robots - function gliss in g_midi TYPE Glisstype van AS CURRENCY tot AS CURRENCY duur AS DWORD 'ms velo AS BYTE 'although we probably better fix velo 127 if we want a propper gliss without attack artifacts 'for internal use ONLY startt AS DWORD 'ms endt AS DWORD lastval AS CURRENCY lastnote AS CURRENCY lastbend AS BYTE busy AS DWORD cb AS DWORD 'user callback for when gliss finished sf AS LONG 'flag to surpress fingerings END TYPE TYPE RecognitionHandler DWORD nr AS INTEGER ' id number for the recognized event. cPtr AS DWORD ' codepointer to the procedure where consequences of recognition are handled END TYPE TYPE StaffType hor AS INTEGER ' horizontal coordinate for start of staff (upper left corner) ver AS INTEGER ' vertical coordinate for start of staff length AS WORD ' horizontal length of staff clef AS STRING * 2 ' G, F, C clef... the second character may be the staffline used for C-clefs lijnafstand AS WORD ' for music graphics procedures akkoordraster AS WORD ' horizontal raster size for chordnumbers nh AS BYTE ' note height nb AS BYTE ' note width END TYPE TYPE DataAcquisitionParameters WORD ' alignment on word boundaries. DO NOT CHANGE THIS ChannelVector(15) AS INTEGER ' for channelremapping 'pointer + 0 to pointer + 31 GainVector(15) AS INTEGER ' for NiDAQ 'pointer + 32 to pointer + 63 samplingrate(15) AS WORD ' samplingrate per channel 'pointer + 64 to pointer + 95 scanRateDivisorVector(15) AS INTEGER ' for NiDAQ 'pointer + 96 to pointer + 127 voltagerange(15) AS SINGLE ' in volts (absolute range) 'pointer + 128 to pointer + 191 polarity(15) AS BYTE ' 0= bipolar, 1 = unipolar 'pointer + 192 to pointer + 207 device AS ASCIIZ * 24 ' name of the hardware device used: Arcom, NiDAQ, NiDAQmx ... adr AS WORD ' I/O adres for ISA cards - taboo under Win2000/NT nrchannels AS BYTE ' number of channels on the ADC converter inputconfig AS BYTE ' 0= differential, 1= referenced single ended, 2= nonref. single ended rate AS DWORD ' total samplingrate for the device (nr. of conversions per second) scanfreq AS DWORD ' scanning frequency in nr. of scans per second. pADCBuffer AS INTEGER PTR ' pointer to data acquisition buffer ADCbuffer(0) pDAQBuffer AS INTEGER PTR ' pointer to data acquisition receivebuffer (in callback) Buffersize AS DWORD ' size of ADCbuffer in points (samples). bBitsPerSample AS BYTE ' resolution of ADC device datarefreshrate AS LONG ' daq timeframe - expressed in Hz - task frequency for updates datatimeframe AS SINGLE ' total DAQ timeframe expressed in seconds MODE AS DWORD ' zero if device not initialised,otherwize contains bit constants DAQ_... ref: GMT_KONS.BI ID AS INTEGER ' id attributed to NiDAQ devices by NiDAQ's configuration utility channel AS DWORD ' holds the constants %DAQ_S07 etc... 02.12.2000 daqstopped AS INTEGER ' set in callbackfunction and/or DAQ_Monitor function '20.11.2000 taskhandle AS DWORD ' for NiDAQmx devices taskname AS ASCIIZ * 20 ' for NiDAQmx devices ' sizeoffstruct AS DWORD ' sizeoff DataAcquisitionParameters : for DLL support END TYPE ' the type above is not suited to also cover DIO devices... ' so we created a specific type ' Can replace former use of printerports as 8 adress DIO devices... 26.09.2000 ' Also used for USBUART and ActiveWire USB devices. [2002] TYPE DigitalIOparameters DWORD nrports AS WORD ' number of 8 bit ports device AS ASCIIZ * 24 ' name of the hardware device used: NiDAQ , USBUART, AWUSB... flags AS DWORD ' operational mode setting / flags for hardware specifics mode AS DWORD ' zero if device not initialized adr AS WORD ' I/O adres for ISA cards - taboo under Win2000/NT irq AS BYTE ' Irq number for ISA cards ID AS INTEGER ' id attributed to NiDAQ devices by NiDAQ's configuration utility END TYPE TYPE USB_DIO_TYPE DWORD ' in g_n*h.dll we use an array of this type to support many devices. [10.01.2002] h AS DWORD ' handle obtained on opening the device Security AS SECURITY_ATTRIBUTES gOverlapped AS OVERLAPPED END TYPE ' 17.06.1999 - for real time user interface. TYPE UpDownController h AS DWORD ' Handle for the controll hBuddy AS DWORD ' Handle for the buddy controll or window hParent AS DWORD ' Handle of the owner window or dialog value AS LONG ' actual value maxval AS LONG ' maximum value minval AS LONG ' minimum value resetval AS LONG ' value to take on creation of the control ID AS LONG ' control id constant stap AS LONG ' default is 1 Cptr AS DWORD ' adress of procedure handling the data tag AS ASCIIZ * 8 END TYPE ' 20.06.1999 TYPE SliderController h AS DWORD ' Handle for the controll hBuddy AS DWORD ' Handle for the buddy controll or window hparent AS DWORD ' Handle for the sliders parent window (the owner) value AS INTEGER ' last updated value maxval AS INTEGER ' maximum value for range minval AS INTEGER ' minimum value for range resetval AS INTEGER ' value used on startup and reset ID AS LONG ' control id constant stap AS INTEGER ' increment size for keyboard control Cptr AS DWORD ' codepointer to procedure handling the data (if not set, you have to poll) tag AS ASCIIZ * 8 ' descriptive text for function of slider END TYPE ' changed to create 2 categories: ON/OFF-switches and ONESHOT-switch TYPE SwitchController DWORD h AS LONG ' Handle for the controll hparent AS LONG ' handle for the buttons parent window (owner) ID AS LONG ' control id constant flag AS DWORD ' bit 0 = on or off, for toggle switch buttons cPtr AS DWORD ' adress of procedure handling this individual button tag0 AS ASCIIZ * 10 ' text to display when flag is 0 ' changed 22.02.2003 tag1 AS ASCIIZ * 10 ' text to display when flag is 1 END TYPE TYPE OneShotController DWORD h AS LONG ' Handle for the controll hparent AS LONG ' handle for the buttons parent window (owner) ID AS LONG ' control id constant cPtr AS DWORD ' adress of procedure handling this individual button tag AS ASCIIZ * 10 ' text displayed in the button - changed to 10, 22.02.2003 END TYPE ' 15.07.1999 TYPE FunctionKeyController DWORD hParent AS LONG ' handle of window active the moment the function was pressed flag AS DWORD ' on or off tag AS ASCIIZ * 8 ' function description for the functionkeys cPtr AS DWORD ' 07.04.2000 END TYPE TYPE KeyboardController DWORD hParent AS LONG ' handle of window active the moment the function was pressed key AS WORD ' ASCII code of key pressed. flag AS WORD ' 1 = event not handled, 0= event handled. cPtr AS DWORD ' codepointer to procedure handling keyboard events. ' the default is: CODEPTR(Keyboardhandler) END TYPE ' types added to create static arrays for audiostreaming: ' doing this guarantees allocation at compile time. ' These types are only used in the DLL (g_wave.inc) - 28.03.2000 ' Size of any type is theoretically restricted to 16kB in Power Basic! TYPE StreamMixBuffer DWORD Mtrack0 (%lStreamOutLatencyM1) AS DWORD ' packed left/Right integers. Mtrack1 (%lStreamOutLatencyM1) AS DWORD ' alternating wave buffers END TYPE TYPE StreamChannels DWORD MixLeft (%lStreamOutLatencyM1) AS LONG ' real long's used for adding channels. (32 bits) MixRight (%lStreamOutLatencyM1) AS LONG END TYPE TYPE StreamHeaders DWORD mWbh (1) AS WAVEHDR ' for alternating wavebuffers.(used for input and output) END TYPE TYPE StreamInBuffer DWORD InTrack0 (%lStreamInLatencyM1) AS DWORD 'LONG ' 14.04.2000 - for dll only InTrack1 (%lStreamInLatencyM1) AS DWORD 'LONG END TYPE TYPE WaveProperties DWORD ' 27.04.2000 - used for internal pitch to midi conversion. freq AS SINGLE ' frequency pospeak AS SINGLE ' peak positive value negpeak AS SINGLE ' peak negative value POS AS SINGLE ' integral of positive half neg AS SINGLE ' integral of negative half correlation AS SINGLE ' normalized correlation with a sine wave of the same frequency amplitude AS SINGLE ' rms amplitude - SQR(pp/2) (0 to 1) symmetry AS SINGLE ' difference between positive and negative surface (-1 to + 1) note AS LONG ' nearest midi note equivalent velo AS LONG ' midi velocity equivalent END TYPE ' new type introduced since composition of CelloPi using realtime audio [24.08.1999] TYPE AudioType DWORD ToDisk AS BYTE ' %True = recording to disk files DelayLine AS BYTE ' If %True, recordings will be played back immediately from memory, the delay ' time being set by the time given for starting a recording. ' If delayline is active, other wave-output functions are disabled. DelayTime AS DWORD ' delay time in milliseconds hWi AS DWORD ' wave input handle hWo AS DWORD ' wave output handle hInstMix AS DWORD ' instance handle for the asynchronous mixer program SND32VOL iCnt AS WORD ' input samplefile counter : incremented after writing sample file to disk. ' Incremented in the WaveInCallback procedure oCnt AS WORD ' output samplefile counter END TYPE TYPE AudioTrackStatus ' 04.02.2000 ' a pointer to this structure is passed to the wave procs. ' in the DLL on opening of the wave devices. lastrecordedtrack AS LONG ' -1= none , 0-15 for track - this is set in the waveincallback lastplayedtrack AS LONG ' -1= none , 0-15 for track - this is set in the waveoutcallback StreamOut AS LONG ' hold the ID for the wave out thread if ON, if false, no streaming is used ' if = %True, callback mixing is used. StreamIn AS LONG ' holds the ID for the wave in thread if ON, if false, no streaming is used ' if = %True, callback input streaming is used. Playing(15) AS BYTE Recording(15) AS BYTE Processing(15) AS BYTE ' used for streaming mixer: stream flag is bit0 END TYPE TYPE AudioMixerLineType ' h AS LONG ' handle = gh.wMix ID AS DWORD ' 0 for output mixer, 1 for input mixer ' tag AS ASCIIZ * 12 ' label as returned by driver nrfaders AS DWORD ' number of faders in the mixer linetag(15) AS ASCIIZ * 12 ' tag0 = master tag, name of mixer lineid(15) AS DWORD ' id's for elements in mixer channels(15) AS DWORD ' nr. of audiochannels controls(15) AS DWORD ' nr. of controls. componenttype(15) AS DWORD 'win constant for component type added kl 010830 END TYPE ' following type is used to handle auxilliary audio devices available on the computer: ' 14.12.1999 ' we define AudioFader() as an array of faders for aux devices. ' we define WaveFader() as an array of faders for waveoutput devices TYPE AudioFaderType ' now used as an array! mixID AS DWORD ' filled in WndProc- id in the windows mixer (retrieved with mixerGetID) hMix AS DWORD ' filled in WndProc filled with openMixer (handle for the mixer element) ID AS DWORD ' set to -1 if device is not available, otherwize device id. tasknr AS LONG ' number of task handling fader movements leftvolume AS WORD ' last updated value for the actual fader position rightvolume AS WORD ' last updated value for the actual fader position leftendvolume AS WORD ' soll value for programmed fader task rightendvolume AS WORD ' soll value for programmed fader task tag AS ASCIIZ * 10 ' label END TYPE TYPE MCIdeviceType CDid AS LONG ' cd player AVIid AS LONG ' AVIvideo / animation SEQid AS LONG ' midi sequencer WAVid AS LONG ' wave-audio DATid AS LONG ' dat player VCRid AS LONG ' video recorder SCANid AS LONG ' scanner VDISCid AS LONG ' video disk OVLid AS LONG ' video overlay DVIDid AS LONG ' digital video h AS DWORD ' window handle for callback END TYPE TYPE AudioCDType NrTracks AS BYTE ' nr of music tracks on the inserted audio CD Busy AS BYTE ' %True as long as the CD is playing, %False if free CanEject AS BYTE ' %True if it can eject under software control CanTime AS BYTE ' %True if it can retrieve durations of individual tracks END TYPE ' type added such that all modules know what the application is... TYPE ApplicationType DWORD id AS LONG ' this should be the id constant as defined in the resource file hIcon AS LONG ' handle for the associated icon hMonitor AS LONG ' handle for the monitor window (non-modal dialog for text display) MonitorCptr AS LONG ' callback address for the monitor window ButnSwCptr AS DWORD ' pointer to the procedure handling switch controls in the cockpit. ButnSwParam AS DWORD ' used to pass the button id to the above procedure code. ButnOsCptr AS DWORD ' pointer to the procedure handling oneshot controls in the cockpit. ButnOsParam AS DWORD ' used to pass the button id to the above procedure code. functionkeyCptr AS DWORD ' pointer to the procedure handling function keys fkParam AS LONG ' used to pass function key information to the above procedure code. NrUpDowns AS BYTE ' number of UpDown buttons in the cockpit window NrSliders AS BYTE ' number of sliders in the cockpit window tempo AS INTEGER ' replaces former Tempo% globton AS INTEGER ' replaces former GlobTon% komposduur AS DWORD ' replaces former Komposduur% SeqFileOut AS ASCIIZ * 32 ' name for output seq file (for score generation) SeqOutFileNr AS DWORD ' filenumber for the opened seq file SeqFileIn AS ASCIIZ * 32 ' name for input seq file (for playback/ manipulation) SeqInFileNr AS DWORD ' filenumber for the opened input seq file WriteSeqScoreTaskNr AS INTEGER ' tasknr. for the Seq file writing task. (default value read from INI file) ReadSeqScoreTaskNr AS INTEGER ' tasknr. for the Seq file reading task. (default value read from INI file) GlobalHarmonyTaskNr AS INTEGER ' tasknr. for global harmony tracking task (DLL tasks) ShowGlobalHarmonyTaskNr AS INTEGER ' tasknr. for display of globalharmony task PromilTog AS INTEGER MTSpeedTog AS INTEGER ' for jittercalculation of the multitasker. RunTimeTog AS INTEGER PitchWheelTaskNr AS INTEGER ' ever used??? DebugTaskNr AS INTEGER ' ever used??? SampleFileName AS ASCIIZ * 15 ' default name for input wave samplefile. ever used??? tStart AS DWORD ' replacing former global tStart - starttime application MTstart AS DWORD ' set when the start button is pushed. Autoflags AS LONG ' read from ini file. ( %Autopatch flag switches midi send patch on task on/off) pCleanup AS DWORD ' code pointer to specific cleanup procedure. '07.08.2001 audiofilepath AS STRING * 128 ' default path to search for wave files on this computer midifilepath AS STRING * 128 datafilepath AS STRING * 128 MidiPlayerTasknr AS DWORD END TYPE TYPE MidiEquipment ' 28.12.1999 used in DLL & Main setup. - in the DLL we have a pMEQ() pointer group AS ASCIIZ * 15 ' pop-up group name in menu (use for brands) naam AS ASCIIZ * 31 ' name of the device Inport AS LONG ' midi-input port/channel to which it is connected. (-1 if none) Outport AS LONG ' midi-out port/channel to which it is connected. (-1 if none) ID AS DWORD ' for sysex settings - internal ID for the synth. msgid AS LONG ' id's for Winproc & MidiGear procedure reserved AS DWORD ' ? pointer to further equipment specs. , flags - used in dll. END TYPE TYPE FourLongs x AS LONG ' created to replace the Rect type needed in the Win32Api. y AS LONG ' PB refuses the fields .right and .left in types. b AS LONG h AS LONG END TYPE TYPE CockpitLabels '21.09.99 - this is not global . The data are read from an ini file. ID(%NrOfCockpitLabels) AS DWORD ' id's as appearing in the resource. TXT(%NrOfCockPitLabels) AS STRING * 40 ' changed 11.10.2003 END TYPE TYPE Complex ' for mathlib real AS DOUBLE imag AS DOUBLE END TYPE TYPE Polar ' for mathlib mag AS DOUBLE ang AS DOUBLE END TYPE TYPE Roots ' for algebra rt1 AS Complex rt2 AS Complex END TYPE TYPE TriangleType DWORD ' for g_indep: gonio math, solving triangles. a AS SINGLE ' hoek tegenover de zijde sa (angles all in Rad) b AS SINGLE ' Tri.b ' hoek tegenover de zijde sb c AS SINGLE ' Tri.c ' hoek tegenover de zijde sc sa AS SINGLE ' zijde tegenover hoek a sb AS SINGLE ' Tri.sb sc AS SINGLE ' Tri.sc ah AS SINGLE ' hoogtelijn vanuit a naar sa, dus loodrecht op sa bh AS SINGLE ' hoogtelijn vanuit b naar sb ch AS SINGLE ' hoogtelijn vanuit c naar sc S AS SINGLE ' surface END TYPE TYPE WaveLetData ' only valid for %CD_SR - used in mathlib dta(2929) AS SINGLE ' Quart sinewave data for notes 36 to 96 pd(36 TO 96) AS SINGLE PTR ' pointers to start of waveletdata for each note ns(36 TO 96) AS DWORD ' size of data for each note END TYPE '******* types only used in composition code by Godfried-Willem Raes: ' following structure only used for TYPE ShiftsType MID(15,15) AS BYTE ' look up table, read from file cent(15,15) AS INTEGER ' cent-corrections for just intonation version trans(20) AS BYTE ' look up table read from file ins(15) AS BYTE ' patches read from cfg file bank(7) AS BYTE ' bank - only for fb01 Nte(15) AS BYTE ' 0 to 7 is enough..., 8 to 15 are the same. midi(15,15) AS INTEGER ' transposed lookup table. oldnot(15) AS BYTE vel(15) AS BYTE miparam AS BYTE ' sets midi mode notesoff AS BYTE ' flag: 1= switches old notes off, 0= leaves them hanging. tuning AS BYTE ' for proteus tunings, as in tog AS BYTE ' %true or %False sustain AS BYTE ' %true or %False END TYPE ' types defined for invisible instrument pieces & TYPE BomType ' sens AS BYTE ' level for background noise in -instruments [slider0] - removed 15.04.2003 sustain AS BYTE ' %True or %False [button] tog AS BYTE ' %True or %False [button] mapping AS BYTE ' 0 - 15 [shift + function keys] algo AS INTEGER ' 0 - 38 [cockpit checkboxes] tuning AS BYTE ' 0 - 5 [buttons] subpatch AS BYTE ' 0 - 15 [function keys] ' aScale AS BYTE ' %d0 - %d8 - divide factor for acceleration math. [UD controller 12] - removed 01.11.2003 fade AS BYTE ' %True or %False [button] ' dSamp AS BYTE ' nr of samples used for acceleration measurement. [slider1] - removed 22.09.2003 hardware AS BYTE ' 0= anacomp, 1= Diana, 2= ii_2000 ' new 25.11.2000 ' dT AS WORD ' timeconstant for acceleration measurement [in ms] - removed 15.04.2003 hMonitor AS LONG ' handle for the monitor window where we display parameters. END TYPE TYPE SongbookType P2MChannel AS BYTE ' midi input channel for the pitch to midi convertor HarChannel AS BYTE ' midi channel for the Digitech TSR24-PPI2 power(15) AS SINGLE ' movement power after spectral analysis fmax(15) AS SINGLE ' strongest frequency components in the corresponding channel Harmonizer AS ASCIIZ * 15 ' TSR24 Pitch2Midi AS ASCIIZ * 15 ' GI10 END TYPE ' following structure is only used in , for the Stresso task. TYPE StressoType Starttime AS DWORD ' milliseconds StopTime AS DWORD ' milliseconds Duration AS DWORD ' milliseconds Automatic AS BYTE ' on or off flag Invert AS BYTE ' on or off flag Interact AS BYTE ' on or off flag for user interface interaction Finale AS BYTE ' on or off flag for last section in Stresso NrOfSections AS BYTE SectionCount AS BYTE Delay AS WORD END TYPE ' following structure is only used in for the Tango task. TYPE TangoType tc AS BYTE ' tonal center sectioncounter AS BYTE ' 0, 1 barcounter AS BYTE ' 0... 20 max. nrbars AS BYTE ' = 14 ' max. 20 END TYPE ' following structure is only used in for Shaman. TYPE ShamanType percussion AS BYTE ' true or false, true when subpatch = 0, else false Xchannel AS BYTE ' waiting X-dft time if true Ychannel AS BYTE ' waiting Y-dft time if true Zchannel AS BYTE ' waiting Z-dft time if true sampler AS BYTE ' sampler started. True when subpatch = 1, else false recording AS BYTE ' recording sample playback AS BYTE ' playing recorded sample delays AS BYTE ' delay mode started. True shen subpatch = 2, else false storedelays AS BYTE ' = Bom.sustain (via button) END TYPE ' type only used for , , , , , '- used in Setinputcontext / setrecordercontext / setclarinetcontext ' 09.10.2003: some fields now doubled in the Pitch2MidiType !!! TYPE SoloPiType angle AS SINGLE ' 0 - Pi2 , circles round vol AS LONG ' integrated input loudness tes AS SINGLE ' integrated pitch median of input (in frequency) dens AS SINGLE ' integrated input event density (in events/second) silencetimer AS SINGLE ' silence counter (on no-input) in ms (0= no silence) notetimer AS SINGLE ' note duration counter , in ms. rest AS SINGLE ' duration of last rest heard dur AS SINGLE ' duration of last note heard END TYPE ' ********************************************************************************************** ' Type for vector graphics used in Radar screen implementations: TYPE RadarTriangleType DWORD Tx AS LONG ' coordinates of equilateral triangle top Ty AS LONG Lx AS LONG ' coordinates of leftmost point base Ly AS LONG Rx AS LONG ' coordinates of rightmost point base Ry AS LONG Cx AS LONG ' coordinates of the center point Cy AS LONG z AS LONG ' length of side h AS LONG ' heigth of this triangle ri AS LONG ' radius of inner circle ro AS LONG ' radius of outer circle END TYPE ' Type for invisible instrument sonar devices: (cfr. Bom, Songbook, Gestrobo, TechnoFaustus) TYPE SonarType DWORD pb(15) AS INTEGER PTR ' pointer array to the 0 elements of the databuffers. (each 4 seconds deep at 64S/s) timerid AS DWORD ' internal timer id xa AS INTEGER ' integrated amplitude received by X-transducer - should become single ya AS INTEGER ' integrated amplitude received by Y-transducer za AS INTEGER ' integrated amplitude received by Z-transducer (suspended) xyza AS INTEGER ' integrated amplitude sum x+y+z xf AS INTEGER ' integrated doppler speed received by the X-transducer yf AS INTEGER ' integrated doppler speed received by the Y-transducer zf AS INTEGER ' integrated doppler speed received by the Z-transducer xyzf AS INTEGER ' integrated doppler speed sum received by the X+Y+Z transducers (? or Max value) xe AS INTEGER ' energy xa * xf, rescaled to 12 bit ye AS INTEGER ze AS INTEGER xyze AS INTEGER ' energy xyza * xyzf xac AS INTEGER ' integrated accelleration as seen from x-transducer. Bipolar value -2048 to +2047 yac AS INTEGER ' rescaling is done internally based on the value for ascale. zac AS INTEGER ' ceiling to 12 bits is always performed internally in the DAQ task. xyzac AS INTEGER ' xy AS SINGLE ' positie -1 to +1 , 0 is center between x and y, -1 is x, +1 is y ' zx AS SINGLE ' zy AS SINGLE noise AS LONG ' noise floor. Set with slider in ctrl window. dta AS LONG ' integration time for surface calculations - set by user ascale AS SINGLE ' scaling factor for accelleration amp AS INTEGER ' sum of squares of received amplitudes lxy AS SINGLE ' position on the x->y vector lyx AS SINGLE ' position on the y-> x vector = 1 - lxy lxz AS SINGLE lzx AS SINGLE lyz AS SINGLE lzy AS SINGLE sx AS INTEGER ' position independent body surface as seen from x transducer sy AS INTEGER ' position independent body surface as seen from y transducer sz AS INTEGER ' position independent body surface as seen from z transducer s AS INTEGER ' surface, non positional, average as seen from all 3 transducers. ' added for statistical data analysis: statistic AS DWORD ' toggles statistic analysis on/off, the individual bits set the channels ' 2 second buffer Stat(15) AS STRING * 128 ' string conform harmony descriptor - resolution 7 bits. END TYPE ' Type for microwave radar devices: (cfr. Quadrada) TYPE RadarType DWORD pxbuf AS INTEGER PTR ' pointer to the 0 element of the databuffer (0 to 255) pybuf AS INTEGER PTR ' at 128S/s this buffer is 2 seconds deep amp AS SINGLE ' running sum of squares (both phases together) of received signal amplitudes ' changed from dword to single 19.07.2004 dta AS SINGLE ' integration time for above calculation - single since 19.07.2004 xal AS DWORD ' amplitude of the most recent doppler signal received x-phase yal AS DWORD ' amplitude of the most recent doppler signal received y-phase l AS SINGLE ' normalized distance based on x phase and a pair of radars , 0-1 [-1--- +2] s AS SINGLE ' absolute surface moving v AS SINGLE ' absolute slow body movement velocity acc AS SINGLE ' absolute slow body accelleration (bipolar) pc AS complex ' cartesian coordinates of absolute position pl AS polar ' polar coordinates of absolute position xt AS SINGLE ' doppler period - counted - for internal use yt AS SINGLE ' doppler period - counted - for internal use xf AS SINGLE ' doppler frequency without cosine correction! yf AS SINGLE ' doppler frequency without cosine correction vf AS SINGLE ' absolute fast body movement based on doppler shift (non vectorial) - in Hz acf AS SINGLE ' absolute fast accelleration (bipolar) phase AS SINGLE ' phase difference between both phases - for internal use timerId AS DWORD ' internal use (in g_nih.dll) for periodic sampling timer noise AS LONG ' noise floor sfakt AS SINGLE ' scaling factor for surface calculation. dt AS DWORD ' number of samples below noise floor before doppler analysis becomes invalid params AS DWORD ' now only %Zerocross left over. %ISOLWAVE, %DFT, %ZEROCROSS, %SIGNCHANGE setup AS DWORD ' %SQUARE, %TETRAHEDRON, %FREE END TYPE TYPE RadarTetrahedronType DWORD ' Tetrada ax AS SINGLE ' amplitudes ay AS SINGLE az AS SINGLE ah AS SINGLE sx AS SINGLE ' moving surface as seen from this vertex sy AS SINGLE sz AS SINGLE sh AS SINGLE fx AS SINGLE ' frequencies fy AS SINGLE fz AS SINGLE fh AS SINGLE xy AS SINGLE ' normalized distance to other vertex xz AS SINGLE xh AS SINGLE yx AS SINGLE yz AS SINGLE yh AS SINGLE zx AS SINGLE zy AS SINGLE zh AS SINGLE hx AS SINGLE hy AS SINGLE hz AS SINGLE sr AS SINGLE ' 3-dimensional angle in sterrad mag AS SINGLE ' vectorsize END TYPE ' new type 08.05.2004, for 10GHz radar devices with PIC controller and midi output ' type modified in accordance with new PIC firmware. 10.07.2004 / 17.07.2004 TYPE RadarPicController DWORD pabuf AS INTEGER PTR ' pointer to the 0 element of the databuffer (0 to 255) ptbuf AS INTEGER PTR ' at 100S/s this buffer is 2.5 seconds deep amp AS SINGLE ' amplitude of doppler signal - 7 bit ' was: 14 bit (10 significant) per AS SINGLE ' period of doppler signal - 14 bit (10 significant) f AS SINGLE ' frequency / velocity da AS SINGLE ' integration time for surface - nr. of samples dv AS SINGLE ' integration time for velocity - nr. of samples channel AS WORD 'DWORD ' midi channel as set with dip switch on startup (Version 1.1) listentasknr AS DWORD ' added 21.07.2004, for placement in g_midi.inc --> g_lib.dll END TYPE ' new type for hybrid sonar distance and radar 2.4GHz sensor HY1 05.10.2007 ' this is a midi device with a sampling rate of 10S/s over 5 data channels. ' so data delivery is 50 midi messages a second. TYPE HybridSensor_HY1 DWORD pdistancebuf AS INTEGER PTR ' Pepperl+Fuchs sonar - distance data 10 bit pxamp AS INTEGER PTR ' 2.4GHz radar phase 1 surface data - 10 bit pyamp AS INTEGER PTR ' id. phase 2 pxf AS INTEGER PTR ' 2.4GHz radar phase 1: doppler frequency data 10 bit pyf AS INTEGER PTR ' id. phase 2 distance AS SINGLE ' integrated value normalized 0-1 amplitude AS SINGLE ' integrated value normalized 0-1 speed AS SINGLE ' integrated value normalized 0-1 angle AS SINGLE ' derived from amplitude phase -Pi to + Pi, in rad. phase AS SINGLE ' derived from tacho phase -Pi to +Pi, in rad. valid AS LONG ' false when distance cannot be retreived, else number of valid data in buffer slowspeed AS SINGLE ' movement speed in m/s (signed!) sign = direction of movement channel AS WORD ' midi channel as set with dip switch on startup nearlimit AS DWORD ' normally set to 1 , since 0 is out of range -near side farlimit AS DWORD ' normally set to 1022 , since 1023 os out of range - far side listentasknr AS DWORD ' for inclusion in g_midi.inc --> g_lib.dll samplingrate AS SINGLE ' scan samling rate. Channel samples are at 1/5th of this value. END TYPE TYPE HandySensor DWORD ' added 30.12.2007 a0 AS INTEGER PTR ' rechterpink a1 AS INTEGER PTR ' rechterringvinger a2 AS INTEGER PTR ' rechtermiddelvinger a3 AS INTEGER PTR ' rechterwijsvinger a4 AS INTEGER PTR ' linkerwijsvinger a5 AS INTEGER PTR ' linkermiddelvinger a6 AS INTEGER PTR ' linkerringvinger a7 AS INTEGER PTR ' linkerpink ' swl AS BYTE ' linkerduimschakelaar = a(5) ' swr AS BYTE ' rechterduimschakelaar = a(6) a(10) AS BYTE ' in vingervolgorde 1-10, gereduceerd tot 7 bit channel AS WORD ' midi channel as set with dip switch on startup listentasknr AS DWORD ' for inclusion in g_midi.inc --> g_lib.dll samplingrate AS SINGLE ' scan rate END TYPE ' following is only used in the automatic instrument module g_n*h.inc/dll and in g_midi for our specific ' midi robots. TYPE Akeys BYTE ' makes a single 128-bit variable, if adressed by its pointer. b000007 AS BYTE ' contents of latch 1 b008015 AS BYTE ' contents of latch 2 b016023 AS BYTE ' contents of latch 3 b024031 AS BYTE ' contents of latch 4 b032039 AS BYTE ' contents of latch 5 b040047 AS BYTE ' contents of latch 6 b048055 AS BYTE ' contents of latch 7 b056063 AS BYTE ' contents of latch 8 b064071 AS BYTE ' contents of latch 9 b072079 AS BYTE ' contents of latch 10 b080087 AS BYTE ' contents of latch 11 b088095 AS BYTE ' contents of latch 12 b096103 AS BYTE ' contents of latch 13 b104111 AS BYTE ' contents of latch 14 b112119 AS BYTE ' contents of latch 15 b120127 AS BYTE ' contents of latch 16 END TYPE TYPE KlungType DWORD ' changed 19.08.2006 Vel(49 TO 69) AS SINGLE ' velocity scaling Note(49 TO 69) AS DWORD ' busy flags. RES(49 TO 69) AS SINGLE ' pendulum resonant frequency Rep(49 TO 69) AS SINGLE ' optimum shaking frequency Cnt(49 TO 69) AS SINGLE ' for project only - Klungels flags(49 TO 69) AS DWORD seqfiletask AS WORD ' tasknr for seqfile playing task END TYPE TYPE KlokType DWORD map AS BYTE ' hardware mapping minvel AS BYTE ' minimum velocity required for the bell to sound maxvel AS BYTE ' maximum meaningfull velocity pitch AS SINGLE ' frekwentie van de grondtoon Har AS HarmType ' spectral data in chromatic format nf AS SINGLE ' fractional midi note duur AS DWORD ' average reverberation time in ms. dbmin AS DWORD ' minimum dynamic in dB dbmax AS DWORD ' maximum dynamic in dB maxfreq AS SINGLE ' maximum repetition speed (at low velocities) END TYPE TYPE BellyType DWORD ' changed 19.08.2006 - is this one still used? absmaxvel AS BYTE ' max velo of loudest bell - computed by Initklokparams absminvel AS BYTE ' min " " " " " " " RANGE AS BYTE ' absmaxvel - absminvel " " " klok(47) AS KlokType END TYPE ' type added for robot: used in g_mm.inc TYPE LlorSpecType DWORD ' describes a single bell midi AS INTEGER ' midi note number as we have to send it out (36-47) spek(4) AS SINGLE ' fractional midi: note + cents - 5 spectral lines. splitpoint AS BYTE ' velocity value for the switch between soft piano hammers and hard beaters END TYPE TYPE FlexType DWORD padr AS WORD pinp AS WORD ' not used preg AS WORD reg(7) AS BYTE hlatch(8) AS BYTE ' we use only 3,4,5,6,7,8 3 & 4 = bowmotorspeed, 5= 2 bits for bow solenoids,7-8: softshifts channel AS WORD ' defaults to %Flex_Channel listentask AS WORD ' tasknumber for the midi-listentask simulator AS BYTE pMessagehandler AS DWORD ' implemented 10.06.2003 MessageValue AS WORD PiPos AS DWORD ' position of thread stepping motor 1 - Pi saw 0-100 ePos AS DWORD ' position of thread stepping motor 2 - e saw 0-100 PiRange AS DWORD ' set on calibration at startup or on command eRange AS DWORD ' id. FrontbowPos AS DWORD ' flags for front bow position: %Flex_PiSaw ,%Flex_eSaw , %Flex_center BackbowPos AS DWORD ' flags for back bow %Flex_PiSaw ,%Flex_eSaw , %Flex_center FrontbowDir AS LONG ' %Flex_clock = 1 or %Flex_counterclock = -1 or stop = %False BackBowDir AS LONG ' %Flex_clock = 1 or %Flex_counterclock = -1 or stop = %False TimId(23) AS LONG ' for internal use (timerId's for softshift solenoids) pushdur AS DWORD ' duration in milliseconds for activation of softshift solenoids for bow movement ' if not set by the user, it defaults to 500ms END TYPE TYPE DisplayType DWORD ' 07.02.2002 padr AS WORD ' selects the data port the display is connected to. pinp AS WORD ' selects the input port (if used) preg AS WORD ' selects the register port reg(7) AS BYTE ' register constants dev AS DWORD ' device type constant '%Bom1_Display = &H0000 '%Bom2_Display = &H1000 '%Giant_Display = &H2000 END TYPE ' following type only used for the implementation of the sonar ranging device. 'TYPE SonarRangerType DWORD ' This structure has same size as TAAK. It forms a UNION with it. ' dummy(3) AS DWORD ' switch, tog, rsi, freq ' distance AS DWORD ' in cm ' ' direction +1 , 0 or -1 = SGN(delta) ' speed AS LONG ' movement velocity in cm/s (signed!) ' delta AS LONG ' in cm (signed!) ' nearlimit AS DWORD ' farlimit AS DWORD ' naam AS STRING * 8 ' as in Taak - type ' mintime AS LONG ' replaces starttime ' maxtime AS LONG ' replaces stoptime ' Har AS HarmType ' ref. see HarmonyLibrary ' Rit AS RitmeType ' used for storing rhythm information. cfr. lib manual. ' duur AS LONG ' task duration ' Cptr AS DWORD ' code pointer - = CODEPTR(taskname) ' hparam AS LONG ' handle of the window that handles parameter control - opened with right mouse button ' pX AS ExtraInfo PTR ' pointer to additional structure with parameter information & handles ' flags AS DWORD 'END TYPE ' revision of sonarrangertype 14.04.2004: [ will be placed in g_n*h.dll ] TYPE SonarRangerType DWORD ' This structure has same size as TAAK. It forms a UNION with it. ' dummy(3) AS DWORD ' switch, tog, rsi, freq padr AS WORD ' selects the data port the display is connected to. pinp AS WORD ' selects the input port (if used) preg AS WORD ' selects the register port distance AS DWORD ' in cm ' direction +1 , 0 or -1 = SGN(delta) SPEED AS LONG ' movement velocity in cm/s (signed!) delta AS LONG ' in cm (signed!) nearlimit AS DWORD farlimit AS DWORD RANGE AS DWORD ' = farlimit - nearlimit normdist AS SINGLE ' normalized distance within range (0-1) naam AS STRING * 8 ' as in Taak - type mintime AS LONG ' 1ms maxtime AS LONG ' replaces stoptime dT AS DWORD ' integration setting for distance ' 14.04.2004 dv AS DWORD ' integration setting for speed ' 14.04.2004 tasknr AS WORD ' number of its data acquisition task in the cockpit. rate AS DWORD ' data acquisition rate ' Har AS HarmType ' ref. see HarmonyLibrary ' Rit AS RitmeType ' used for storing rhythm information. cfr. lib manual. ' duur AS LONG ' task duration ' Cptr AS DWORD ' code pointer - = CODEPTR(taskname) ' hparam AS LONG ' handle of the window that handles parameter control - opened with right mouse button ' pX AS ExtraInfo PTR ' pointer to additional structure with parameter information & handles ' flags AS DWORD END TYPE ' new 15.01.2001 TYPE FormantType DWORD fc AS LONG ' center frequency for a single formant component nc AS BYTE ' corresponding note heigth AS SINGLE ' normalized strength (0-1) Q AS WORD ' Q in number of semitones left and right of fc. ' if we set 0, only the note corresponding to fc will we selected. ' if we set one, we get 1 semitone below and one above the fc note END TYPE 'for seq-player; added 16.07.01 kl TYPE SequencerType DWORD RES AS DWORD 'resolution. fixed to centiseconds for now map(%NumberOfTasks-1) AS WORD 'mapping of track to channel, 0 to 63 flags AS QUAD 'bits for track played or not (1/O) speedfactor AS SINGLE 'scales speed at which seqfile is read 1 = normal END TYPE TYPE IOportsType DWORD padr AS DWORD ' printer port - if zer: not available, else IO adres NiDAQ_Dio AS DWORD ' NIDAQ device - if zer: not available NiDAQ_Daq AS DWORD ' the constant %PortUsed, if set, means what it says. USB(9) AS DWORD ' Elektor USB UART devices AwUsb(31) AS DWORD ' ActiveWire USB ports msg AS DWORD ' used to pass listbox selections from callback to dialog. msblsb(31) AS WORD ' for 8-bit transfers with activewire devices only END TYPE ' for CQT device - created 17.11.2002 , extended 09.10.2003 , so that we can use the type to ' store and follow general properties of the received ' midi flow ' since 28.08.2005 the listentask itself resides in the DLL: CQT_Listen TYPE Pitch2MidiType DWORD outchannel AS WORD ' port + channel inchannel AS WORD ' port + channel lowtes AS BYTE hightes AS BYTE naam AS ASCIIZ * 15 ' device name 'CQT' for cqt device Ctrl(127) AS BYTE ' new 09.10.2003: 128 continuous controllers can now be implemented. vol AS LONG ' integrated input loudness tes AS SINGLE ' integrated pitch median of input (in frequency, Hz) dens AS SINGLE ' integrated input event density (in events/second) silencetimer AS SINGLE ' silence counter (on no-input) in ms (0= no silence) notetimer AS SINGLE ' note duration counter , in ms. rest AS SINGLE ' duration of last rest heard dur AS SINGLE ' duration of last note heard listentasknr AS INTEGER ' added 28.08.2005 such that the listen-task can reside in the DLL (g_lib / g_main) END TYPE ' for ADXL202 acceleration sensor devices with PIC controller (supported in g_n*h.dll) 30.01.2003 ' left here for compatibility with older hardware. Now replaced with the midi device Axe3. TYPE AccelsensDevice DWORD hsio AS DWORD ' filehandle for opened serial port COM AS DWORD ' 1= com1, 2=com2, 3=com3 etc... samplingrate AS DWORD ' samples per second timerId AS DWORD ' for multimedia timer callback.- do not set nor change manually. Xval AS WORD ' most recent x-value read Yval AS WORD ' most recent y-value read Xbuf AS STRING * 1024 '(1023) as word = 16 seconds buffer Ybuf AS STRING * 1024 '(1023) as word Xavg AS DWORD ' running average Yavg AS DWORD Xref AS DWORD ' Xmax + Xmin / 2 or set on callibration command. Yref AS DWORD ' Ymax + Ymin / 2 or set on callibration command. tiltx AS SINGLE ' bipolar -90 to + 90 degrees tilty AS SINGLE ' bipolar accX AS SINGLE ' absolute x acceleration in g (bipolar) -2g to + 2g accY AS SINGLE ' absolute y acceleration in g (bipolar) daX AS SINGLE ' relative differential acceleration X daY AS SINGLE ' relative differential acceleration Y naam AS ASCIIZ * 15 END TYPE ' for ADXL202 dual acceleration sensor with midi output [10.2007] ' device name: 'Axe3' - replaces earlier serial devices as well as the egg. TYPE Axe_Type DWORD plx AS INTEGER PTR ' left hand x-vector 10 bit data buffers 512 is center value ply AS INTEGER PTR ' left hand y-vector prx AS INTEGER PTR ' right hand x-vector pry AS INTEGER PTR ' right hand y-vector avglx AS WORD ' average over 1 second interval avgly AS WORD avgrx AS WORD avgry AS WORD mmlx AS SINGLE ' tempo mm = f/60 periodicity, for conductor mmly AS SINGLE ' set to 0 if undeterminable mmrx AS SINGLE ' mmry AS SINGLE ' channel AS WORD ' midi send channel as set with dip switch on startup on the sensor listentasknr AS DWORD ' for inclusion in g_midi.inc --> g_lib.dll samplingrate AS SINGLE ' scan sampling rate. Channel samples are at 1/4th of this value. tiltLx AS SINGLE ' bipolar in rad. (previous sensor was -90 to + 90 degrees) tiltLy AS SINGLE ' bipolar (-Pi/2 to +Pi/2) averaged over 1 second accLX AS SINGLE ' absolute x acceleration in g (bipolar) -2g to + 2g accLY AS SINGLE ' absolute y acceleration in g (bipolar) daLX AS SINGLE ' relative differential acceleration X daLY AS SINGLE ' relative differential acceleration Y tiltRx AS SINGLE ' bipolar angle in rad tiltRy AS SINGLE ' bipolar accRX AS SINGLE ' absolute x acceleration in g (bipolar) -2g to + 2g accRY AS SINGLE ' absolute y acceleration in g (bipolar) daRX AS SINGLE ' relative differential acceleration X daRY AS SINGLE ' relative differential acceleration Y Qlx AS QUAD ' bit patterns used for metrum derivation Qlx2 AS QUAD ' 20071114: 64 bits was not enough, so we interleave an extra quad Qly AS QUAD Qly2 AS QUAD Qrx AS QUAD Qrx2 AS QUAD Qry AS QUAD Qry2 AS QUAD END TYPE ' for our PIR gesture detection device 17.11.2007 - 18.11.2007 gwr. TYPE PIR_Type DWORD pleft AS INTEGER PTR ' left PIR sensor 10 bit data buffers 512 is center value pcenter AS INTEGER PTR ' center PIR sensor pright AS INTEGER PTR ' right PIR sensor dleft AS DWORD ' duration of positive pulse in 40ms units dcenter AS DWORD ' id. - this is the time movement is detected under a 10 degree angle dright AS DWORD ' id. fleft AS SINGLE ' frequency - calculated over a full period. Always <= Sampling rate. fcenter AS SINGLE ' note: this can only be angular speed!!! fright AS SINGLE lefttrain AS QUAD ' pulsetrains 64 bits = 2.56 sekonden centertrain AS QUAD ' this has a deterministic 25S/a sampling rate. righttrain AS QUAD avgl AS SINGLE ' average amplitude over 480ms second interval - proportional to distance avgc AS SINGLE ' same for the center channel - to normalize: take SQR and divide by 22. avgr AS SINGLE ' same for the right channel angle AS SINGLE ' left= negative, central = 0, right = positive in radians (-Pi/2 to +Pi/2) distance AS SINGLE ' normalized 0-1, follows quadratic law. Infinity = 1, close= 0 channel AS WORD ' midi send channel as set with dip switch on startup of the sensor listentasknr AS DWORD ' for inclusion in g_midi.inc --> g_lib.dll samplingrate AS SINGLE ' scan sampling rate. This is normally 25S/s (firmware prg 0) END TYPE 'voor USB sonar TYPE USBSonarDevice pbEnergy AS DWORD 'pointer to buffer with last n energies pbSpeed AS DWORD ' speeds - log rescaled from actual input!! - note that energy = byte and speed = integer!! pbAccell AS DWORD ' acceleration buffersize AS DWORD 'of energy en speed buffers - in samples hsio AS DWORD COM AS DWORD tasknr AS DWORD 'data aquisition task montasknr AS DWORD 'monitor task - sets it's own frequency! slnr AS DWORD MODE AS DWORD '%USBSONAR_PULSEMODE of %USB_SONAR_DOPPLERMODE = 2 'for pulse mode RxDur AS BYTE UpdRxdur AS BYTE 'for communication between sliders in g_main and task in g_h - set by control task when slider changed TxDur AS BYTE UpdTxDur AS BYTE noise AS BYTE dist AS SINGLE 'voor't moment in zeemijl of zo- uitmeten en omzetten naar meter nog te doen amp AS BYTE 'bruikbaar?rescaled: [noisefloor-256] -> [0, 127]? 'for doppler mode FilterCoef AS BYTE updFilterCoef AS BYTE Bias AS BYTE updBias AS BYTE OutputFilterCoef AS BYTE updOutputFilterCoef AS BYTE OutputDownSampling AS BYTE updOutputDownSampling AS BYTE PowerTresh AS BYTE updPowerTresh AS BYTE Energy AS BYTE SPEED AS SINGLE 'log rescaled from actual input [-64 - 64] Accelleration AS SINGLE 'derived from speed [-127 - 127] - good for trigger detection lasttime AS DWORD 'sinds we in dopplermode data ontvangen hebben sps AS SINGLE 'samples per second in dopplermode - dependent on downsampling slider hwMon AS DWORD 'handle to monitorwindow - in doppler mode only!!! END TYPE 'UNION SonarTaskUnion ' occupies the same place in memory as Task ' Task AS Taak ' SonarRanger AS SonarRangerType 'END UNION ' 'TYPE SonarRanger ' U AS SonarTaskUnion 'END TYPE 'for web strikes back '-------------------- 'UAF contains the useractions done in simu mode to be mailed out ' TYPE UserActionFollowUpType 'should be moved to a specific .INC ' time AS DWORD 'elapsed since start of piece ' dwAction AS DWORD 'number identifying an action or param for an action ' ascAction AS ASCIIZ * 8 'string descr of an action ' END TYPE ' for networking support under GMT: ' this type holds the complete networked configuration. TYPE g_net_type DWORD names(25) AS ASCIIZ * %MAX_COMPUTERNAME_LENGTH + 1 ' computernames on the network. names(0) is always the host ip(25) AS LONG dotip(25) AS STRING * 15 ports(25) AS DWORD usage(25) AS STRING * 30 cfg AS DWORD ' number of config in ini file config AS STRING * 20 ' name of configuration portin AS LONG servercptr AS DWORD ' added by KL 30.01.2003 END TYPE UNION HarVelFormat vel AS STRING * 128 n(127) AS BYTE END UNION TYPE ParsedMidiType time AS DOUBLE 'ms 'was DWORD 030915 - with double we have .005 ms deviation on a huge test file.. tempo AS DWORD 'tempo from midi file at this place bStat AS BYTE 'status byte bDat1 AS BYTE 'data bytes bDat2 AS BYTE track AS BYTE marker AS STRING * 20 'we only foresee 20 characters for markers - should be more then enough for what we want to use them for 'OBSOLETE (?) extra AS DWORD 'new 20070126, added for time signature and future extensions.. ' channel AS BYTE 'part of bStat END TYPE TYPE FromToType ' timed process object 21.09.2003 ' starts a periodic timer in the dll and stops automatically. van AS LONG ' waarde van de parameter bij het begin van het proces tot AS LONG ' waarde van de parameter waarbij het proces moet stoppen cnt AS DWORD ' counter,calculated on start, decrements everytime the process is activated. duur AS DWORD ' in milliseconds (duur waarover het proces moet lopen) cptr AS DWORD ' codepointer voor de in het proces uit te voeren taken. ' de periodetijd is steeds duur / (van-tot) tId AS DWORD ' id for the timer used (Internal use) - wanneer dit %False wordt is het proces gedaan. END TYPE TYPE TimedEvent DWORD ' timed event object 09.10.2003 cptr AS DWORD ' codepointer to procedure to be called after time milliseconds. time AS DWORD ' timer setting in milliseconds tID AS DWORD ' internal use. If tID becomes %False, the event is passed. param1 AS DWORD 'tested as word on 18.12.2005, but there is no reason for such a change... '2008.07.31 now used by different functions, also as codepoiter, so this should stay dword param2 AS DWORD ' tested as byte, but there is no reason for this. repeat AS DWORD ' repeat period in ms - 0 for no repeat hQueue AS DWORD ' new 17.07.2008 handle to timer queue for the new TimerQueue functions that eplace the TimeSetEvent from former windows versions.. END TYPE TYPE TimedHar DWORD ' timed event object 09.10.2003 time AS DWORD ' timer setting in milliseconds tID AS DWORD ' internal use. If tID becomes %False, the event is passed. h AS harmtype 'tested as word on 18.12.2005, but there is no reason for such a change... hQueue AS DWORD ' new 17.07.2008 handle to timer queue for the new TimerQueue functions that replace the TimeSetEvent from former windows versions.. END TYPE TYPE TemaType DWORD ' new 04.11.2004 noot AS INTEGER ' positive 0-127 = note velo AS BYTE ' 0 - 127 duur AS DWORD ' duur in tiks voor die noot of rust tc AS INTEGER ' optioneel tonaal centrum maatlengte AS DWORD ' aantal tiks per maat tijdlengte AS DWORD ' aantal tiks per tijd tempo AS DWORD ' MM getal voor tijdlengte cnt AS DWORD ' calculated on reading file data. Sum of tik durations maatnr AS DWORD ' normaal maatnummer: 1,2,3,4... berekend bij inlezen file tijdnr AS DWORD ' normaal tijdnummer: 1,2,3,4 berekend bij inlezen file tiknr AS DWORD ' tik binnen een tijd: 0,1,..... tijdlengte-1 berekend bij inlezen file maatdd AS BYTE ' time sig nominator maatnn AS BYTE ' time sigdenominator END TYPE TYPE HarTimeType 'similar to TemaType, but polyphonic. not voice-aware - just uses harmonystrings h AS harmtype ' noot AS INTEGER ' positive 0-127 = note ' velo AS BYTE ' 0 - 127 'doen we iets met de duren? - voorlopig overslaan, mar mscch kan dat wel nuttig zijn.. ' duur AS DWORD ' duur in tiks voor die noot of rust tc AS INTEGER ' optioneel tonaal centrum maatlengte AS DWORD ' aantal tiks per maat tijdlengte AS DWORD ' aantal tiks per tijd tempo AS DWORD ' MM getal voor tijdlengte cnt AS DWORD ' calculated on reading file data. Sum of tik durations maatnr AS DWORD ' normaal maatnummer: 1,2,3,4... berekend bij inlezen file tijdnr AS DWORD ' normaal tijdnummer: 1,2,3,4 berekend bij inlezen file tiknr AS DWORD ' tik binnen een tijd: 0,1,..... tijdlengte-1 berekend bij inlezen file maatdd AS BYTE ' time sig nominator maatnn AS BYTE ' time sigdenominator END TYPE TYPE DopplerType DWORD ' new 14.06.2009, for ii_2000 with NiDAQmx - essential for Namuda xa AS SINGLE ' gereflekteerde amplitude voor de x-vektor ya AS SINGLE za AS SINGLE xf AS SINGLE ' frekwentie van het doppler signaal voor de x-vektor yf AS SINGLE zf AS SINGLE xac AS SINGLE ' accelleratie yac AS SINGLE zac AS SINGLE pxfast AS DOUBLE PTR ' pointer naar x-vektor data(0). Meest recente data in data(255) 250ms buffer 1024 S/s pyfast AS DOUBLE PTR pzfast AS DOUBLE PTR pxm AS DOUBLE PTR ' 1s buffer, sampling rate 256 S/s pym AS DOUBLE PTR pzm AS DOUBLE PTR pxslow AS DOUBLE PTR ' 4s buffer, sampling rate 64 S/s pyslow AS DOUBLE PTR pzslow AS DOUBLE PTR pxfbuf AS SINGLE PTR ' 64 values for the frequency measurement, used for calculation of accelleration pyfbuf AS SINGLE PTR ' sampling rate: 256 S/s pzfbuf AS SINGLE PTR ' most recent data in data(63) dtacc AS WORD ' dt for accelleration derivation. Valid values: 1-63. Do not exceed range! dta AS WORD ' amplitude integration depth (0-255) noise AS SINGLE ' noise level threshold (1E-3, default) hpf AS WORD ' high pass filter differenciation depth END TYPE TYPE Radar24GHzTetrahedronType DWORD ' new 07.09.2009 - for 24GHz radar - sampling rate 2048 S/s xa AS SINGLE ' gereflekteerde amplitude voor de x-vektor ya AS SINGLE za AS SINGLE ca AS SINGLE xf AS SINGLE ' frekwentie van het doppler signaal voor de x-vektor yf AS SINGLE zf AS SINGLE cf AS SINGLE xac AS SINGLE ' accelleratie yac AS SINGLE zac AS SINGLE cac AS SINGLE pxfast AS DOUBLE PTR ' pointer naar x-vektor data(0). Meest recente data in data(511) 250ms buffer pyfast AS DOUBLE PTR pzfast AS DOUBLE PTR pcfast AS DOUBLE PTR pxm AS DOUBLE PTR ' 1s buffer, sampling rate 512 S/s pym AS DOUBLE PTR pzm AS DOUBLE PTR pcm AS DOUBLE PTR pxslow AS DOUBLE PTR ' 4s buffer, sampling rate 128 S/s pyslow AS DOUBLE PTR pzslow AS DOUBLE PTR pcslow AS DOUBLE PTR pxfbuf AS SINGLE PTR ' 64 values for the frequency measurement, used for calculation of accelleration pyfbuf AS SINGLE PTR ' sampling rate: 256 S/s pzfbuf AS SINGLE PTR ' most recent data in data(63) pcfbuf AS SINGLE PTR dtacc AS WORD ' dt for accelleration derivation. Valid values: 1-63. Do not exceed range! dta AS WORD ' amplitude integration depth (0-255) noise AS SINGLE ' noise level threshold (1E-3, default) hpf AS WORD ' high pass filter differenciation depth bufpos AS DWORD 'for new implementation with big circular buffer: position of last aquired sample END TYPE TYPE Spectrum128Singletype DWORD freq(127) AS SINGLE pow(127) AS SINGLE END TYPE TYPE Spectrum128Doubletype DWORD freq(127) AS SINGLE pow(127) AS DOUBLE END TYPE TYPE Spectrum128Longtype DWORD freq(127) AS SINGLE pow(127) AS LONG END TYPE TYPE Spectrum128Integertype DWORD freq(127) AS SINGLE pow(127) AS INTEGER END TYPE TYPE ConeValveType DWORD angle AS SINGLE ' top angle of the cone a orifice AS SINGLE ' d1 diam AS SINGLE ' d2 depth AS SINGLE ' milling depht hc area AS SINGLE ' equivalent windflow throughput area Sf traject AS SINGLE ' movement traject for the cone possible AS INTEGER ' set to true if the valve is possible END TYPE TYPE GestureType DWORD '03.04.2010 first introduced in 'Links' collision (3) AS SINGLE '0=X , 1=Y, 2=Z, 3= total acceleration based, the values are the correlation magnitude collision_dur (3) AS LONG 'added to avoid double triggering 17.04.2010 theacol (3) AS SINGLE 'theatrical collision acceleration based theacol_dur (3) AS LONG 'added 17.04.2010 implo (3) AS SINGLE 'surface based - normalised property strength implo_dur (3) AS LONG 'in 1/256s units 0 at the start of detection, climbing up as long as the property is valid. Else -1 implo_val (3) AS SINGLE explo (3) AS SINGLE 'surface based - normalised property strength explo_dur (3) AS LONG 'duration of the property in 1/256s units explo_val (3) AS SINGLE 'implemented 14.04.2010 speedup (3) AS SINGLE 'speed based speedup_dur (3) AS LONG speedup_val (3) AS SINGLE slowdown (3) AS SINGLE 'speed based slowdown_dur (3) AS LONG slowdown_val (3) AS SINGLE periodic (3) AS SINGLE 'should give the tempo in MM units jitter (3) AS SINGLE 'should give the degree of certainty of the above tempo. flue (3) AS SINGLE 'gives the standard deviation for the surface buffer (in fact 1-s) constant body surface property flue_val (3) AS SINGLE 'gives the average value for the surface buffer (normalised 0-1) size of body surface flue_dur (3) AS LONG 'implemented 14.04.2010 edgy (3) AS SINGLE 'FFT based, implemented 05.05.2010 edgy_dur (3) AS LONG edgy_val (3) AS SINGLE 'power derived from the spectral transform , upper part smooth (3) AS SINGLE 'FFT based smooth_dur (3) AS LONG smooth_val (3) AS SINGLE 'power derived from the spectral transform, lower part fixspeed (3) AS SINGLE 'speed based, gives standard deviation for the frequency buffer fixspeed_val (3) AS SINGLE 'gives the average value of the constant speed fixspeed_dur (3) AS LONG 'ímplemented 14.04.2010 impact (3) AS SINGLE 'surface of the body on the moment of detected collision (not a gesture property!) freeze (3) AS SINGLE 'property set when no movement is detected above the noise level freeze_dur (3) AS LONG 'implemented 14.04.2010 freeze_val (3) AS SINGLE 'ádded 17.04.2010 normally = 1- freeze, value always set airborne (3) AS SINGLE 'property added 11.05.2010 airborne_dur (3) AS LONG 'resolution to be checked, cannot be very good. distance (3) AS SINGLE 'requires the combination of radar and sonar. pspf (3) AS DOUBLE PTR 'pointers to the DFT on the fast buffer (0-128) 4Hz to 512Hz pspm (3) AS DOUBLE PTR 'pointers to the DFT on the medium buffer (0-128) 1Hz to 128Hz psps (3) AS DOUBLE PTR 'pointer to the DFT on the slow buffer (0-128) 0.25Hz to 32Hz algo AS DWORD 'parameter for algorithm to use 0= use Gesture_analyse, 1= use FIR approach Sorder AS DWORD 'FIR filter order for the surface related properties Forder AS DWORD 'FIR filter order for the speed related properties flag AS LONG 'flag to switch off the FFT thread. END TYPE TYPE GestureRecognitionParameters DWORD algo AS DWORD 'allowing us to compare the performance of different recognition algorithms Sorder AS DWORD 'FIR filter order for the surface related properties Forder AS DWORD 'FIR filter order for the speed related properties median AS DWORD 'number of the frequency band used for edgy-smooth discrimination END TYPE '[EOF]