background image

Version 3.01

Developer's Information

Pack

Creative Technology Ltd.

Creative Technology Ltd.

Copyright © Creative Technology Ltd., 1994-96.  All rights reserved.

Summary of Contents for AWE32

Page 1: ...Version 3 01 Developer s Information Pack Creative Technology Ltd Creative Technology Ltd Copyright Creative Technology Ltd 1994 96 All rights reserved...

Page 2: ...e 13 awe32Terminate 13 MIDI Services 13 awe32InitMIDI 14 awe32InitNRPN 14 awe32NoteOn 14 awe32NoteOff 15 awe32ProgramChange 15 awe32PitchBend 16 awe32Controller 16 awe32ChannelPressure 17 awe32PolyKey...

Page 3: ...g selections 79 Issuing selections 80 PART IV MIDI NRPN Implementation 83 What Is MIDI Non Registered Parameter Number 83 How do I use SBAWE32 NRPN 83 The EMU8000 Sound Architecture 84 EMU8000 Sound E...

Page 4: ...LSB 24 Envelope 1 to Filter Cutoff 93 NRPN LSB 25 Chorus Effects Send 93 NRPN LSB 26 Reverb Effects Send 93 PART V 3D Positional Audio API 94 Library Overview 94 3D Positional Audio Overview 94 SB AW...

Page 5: ...uld the software and or Licensee application prove defective you as licensee and not Creative Technology Ltd its suppliers distributors dealers or agents assume the entire cost of all necessary correc...

Page 6: ...apply to you Information in this document is subject to change without notice Creative Technology Ltd shall have no obligation to update or otherwise correct any errors in the manual and software even...

Page 7: ...the SB AWE32 DOS real and protected mode API Hardware Detection And Initialization provides interfaces to prepare the EMU8000 subsystem for use MIDI Services provides interfaces to process MIDI events...

Page 8: ...iable names library functions or commands These are case sensitive Bold letters are also used for terms intended as keywords or for emphasis in certain phrases BOLD_CAPS All bold capital letters indic...

Page 9: ...s the focus in this document is on highly technical aspects of the cards This developer information pack supports the following programming tools Microsoft Visual C version 1 0 and 1 5 Microsoft C ver...

Page 10: ...Phone Out Functional Block Diagram of Sound Blaster AWE32 The EMU8000 subsystem consists of the following parts ROM The ROM contains 1MB of General MIDI sound samples DRAM This is the supplied 512 KB...

Page 11: ...the SB16 This is generally true for legacy ISA SB AWE32 cards However with the introduction of Plug and Play cards the relationships between X Y and Z and SB16 may not be true Please refer to the chap...

Page 12: ...ndFont helper module 1 SFHELP2 OBJ SoundFont helper module 2 shared by SBKLOAD OBJ and WAVLOAD OBJ EMBED OBJ General MIDI preset module MIDIVAR OBJ MIDI variables used by all modules HARDWARE OBJ EMU8...

Page 13: ...SB AWE32 sound card that may have the EMU8000 at different I O addresses Please refer to chapter CTPNP CFG Sample for details on obtaining base I O addresses for SB AWE32 PnP cards Return The return v...

Page 14: ...rminate VOID Actions Restore the EMU8000 chip to a known state Parameters None Return Return 0 if the EMU8000 subsystem had been properly terminated and non zero if otherwise Remarks The EMU8000 will...

Page 15: ...and to link in the NRPN OBJ and NRPNVAR OBJ modules Parameters None Return Return 0 upon successful initialization and non zero if otherwise Remark NRPN is not supported for SoundFont2 library awe32No...

Page 16: ...this variable is from 0 to 15 decimal wNoteNumber Specify the MIDI note number Valid range for this variable is from 0 to 127 wVelocity Specify the MIDI note s velocity Valid range for this variable i...

Page 17: ...e for this variable is from 0 to 127 Return The return value is 0 if the MIDI pitch bend is successful non zero otherwise awe32Controller WORD PASCAL awe32Controller WORD wMIDIChannel WORD wControlNum...

Page 18: ...ber MSB CC120 All Sound Off CC121 Reset All Controllers CC123 All Notes Off RPN recognizes controller value 0 pitch bend sensitivity Reset All Controllers resets the following Pitch Wheel Modulation W...

Page 19: ...from 0 to 127 wData Specify the polyphonic key pressure data value Valid range for this variable is from 0 to 127 Return This function will always return 0 Remarks This function is a dummy place holde...

Page 20: ...ed The valid values for XX are 0 Room 1 1 Room 2 2 Room 3 3 Hall 1 4 Hall 2 5 Plate 6 Delay 7 Panning Delay Chorus Sysex macro F0 41 10 42 12 40 01 38 XX CS F7 again XX denotes the chorus variation to...

Page 21: ...WORD wMIDIChannel WORD wBank WORD wPreset WORD wNote Actions Check if a MIDI note is still playing Parameters wMIDIChannel Specify from which MIDI channel the note off originated Valid range for this...

Page 22: ...FAR presets Allocated memory for preset data LONG sample_size Sample size i e number of samples LONG samples_per_sec Samples per second SHORT bits_per_sample Bits per sample 8 or 16 SHORT no_channels...

Page 23: ...or equal to the total amount of patch RAM which may be obtained by calling awe32TotalPatchRam The AWE32 uses only 16 bit samples internally all 8 bit sample data are converted to 16 bit by the library...

Page 24: ...ition before reading the preset data preset_read_size This number of bytes the client should read for the presets Remarks The function requires that the entire SoundFont bank header be read into the b...

Page 25: ...Font bank so you must not free it unless the library is terminated with awe32Terminate or the presets are reset with a call to awe32ReleaseBank Return If successful awe32SetPresets returns zero otherw...

Page 26: ...data is later load into the bank by calling awe32WPStreamWave or awe32WPLoadWave So the wave data may reside in a file memory or any other place the client has the responsibility of retrieving the dat...

Page 27: ...on number of bits per sample of the sample object This should have the same value as it did when awe32WPLoadRequest was called Return If successful awe32WPLoadWave returns zero otherwise it returns no...

Page 28: ..._sec Holds the frequency of the wave data Supported frequencies are 8000Hz 11025Hz 22050Hz and 44100Hz looping Holds zero if there is no loop in the sample Otherwise holds non zero and the start and e...

Page 29: ...flat memory model library the FAR keyword has been defined away LPBYTE is the same as PBYTE Initialization The SB AWE32 EMU8000 subsystem must be properly initialized prior to any MIDI playback Two st...

Page 30: ...we32SoundPad SPad7 awe32SPad7Obj if awe32InitMIDI Error MIDI engine initialisation failed The awe32SoundPad is of type SOUNDPAD and is defined in MIDIVAR OBJ and the awe32SPadXObj variables are define...

Page 31: ...t synthesizer SoundFont bank such as SYNTHGM SBK loads as Bank 0 Loading wave data as an instrument The steps are similar to those of loading a SoundFont bank except that WAVE_PACKET functions are use...

Page 32: ...e32WPStreamWave wp To build SoundFont presets wp presets char malloc wp preset_size if awe32WPBuildSFont wp Error cannot build SoundFont presets if awe32InitMIDI Error MIDI engine initialization faile...

Page 33: ...odule files are marked Module Start End Symbols MIDIENG OBJ CODE Start __midieng_code CODE End __midieng_ecode DATA Start int __midieng_code DATA End int __midieng_ecode SYSEX OBJ CODE Start __sysex_c...

Page 34: ...ers that make use of hardware interrupts in protected mode all modules except HARDWARE OBJ and SBKLOAD OBJ and any additional preset buffers must be page locked If NRPN is not used NRPN OBJ and NRPNVA...

Page 35: ...nd Play Configuration Manager may choose to assign any I O windows to the SB AWE32 PnP card and hence breaking all the relationships of a typical legacy ISA card As a result the device detection based...

Page 36: ...the relationships of the libraries and drivers for the Sound Blaster AWE32 Windows Application Control Panel MMSYSTEM AWE Manager SBAWE32 MIDI Driver Registration Database Sound Blaster AWE32 Hardware...

Page 37: ...er communicates with the driver directly Application Programmer Interface The current implementation of API is via message based system different from Windows WM_USER The API provides parent applicati...

Page 38: ...n LRESULT WINAPI AWEManager AWEHANDLE hUserID UINT unMsg LPARAM lParam1 LPARAM lParam2 The parameters descriptions for both AWEMAN and AWEMAN32 DLL are as follows hUserID Specify a user ID issued by A...

Page 39: ...the two structures is defined as LPPARAMOBJECT and LPBUFFEROBJECT typedef struct WORD m_SizeOf DWORD m_BaseAddr DWORD m_DevNode DWORD m_RomId DWORD m_RomVer DWORD m_hTask DWORD m_DevCaps char m_DevNa...

Page 40: ...oad remove WaveFx from Bank AWE_GET_WAVEFX_PATH Retrieve the path of WaveFX AWE_LOAD_USER_INSTR Load instrument presets into a User Bank AWE_GET_USER_INSTR Retrieve the descriptor attached to an instr...

Page 41: ...max device 1 hUserID Unused Remarks This message can only be called once for each hardware device during initialization The manager will check for the existence of the MIDI driver and in turn register...

Page 42: ...ds on whether anymore application is still accessing it Only when the last application issues a close message then the manager will be unloaded This is the last one off the lights metaphor When the ma...

Page 43: ...lParam2 Specify a far pointer to CDevObject LPDEVOBJECT data type The DLL will fill this structure with the capabilities of the device hUserID Unused Remarks The m_SizeOf field of CDevObject structur...

Page 44: ...ber Remarks m_SizeUsed Number of characters from buffer used m_Flag Number of entries stored in buffer m_Buffer String entries of effect types The m_SizeUsed includes the 0 s used to delimit entries C...

Page 45: ...riations Parameters lParam1 Specify a far pointer to CParamObject LPPARAMOBJECT When the application is calling the manager the following fields of the structure are used Member Remarks m_SubIndex The...

Page 46: ...2 6dB 2 0 2 4dB 3 0 2 2dB 4 0 2 0dB 5 0 2 2dB 6 0 2 4dB 7 0 2 6dB 8 0 2 8dB 9 0 2 10dB 10 0 2 12dB 11 0 2 12dB 0 0 3 8dB 1 0 3 6dB 2 0 3 4dB 3 0 3 2dB 4 0 3 0dB 5 0 3 2dB 6 0 3 4dB 7 0 3 6dB 8 0 3 8d...

Page 47: ...using this function The location passed in as pointer must be valid memory locations allocated by the parent application If the locations are invalid it is possible to trip a General Protection Fault...

Page 48: ...and an error code otherwise Possible error is AWE_ERR_USERID_INVALID See Also AWE_QUERY_EFXT_SUPPORT AWE_QUERY_EFXV_SUPPORT AWE_SELECT_EFX AWE_SELECT_EFX Actions An application sends this message to...

Page 49: ...the AWE Manager of the Effect Types and Variations that it wishes to use This is an extended version and should try to aviod using AWE_SELECT_EFX as far as possible Parameters lParam1 Specify a far p...

Page 50: ...ameters lParam1 Specify a far pointer to CBufferObject LPBUFFEROBJECT When the application calls the manager the following fields are used Member Remarks m_Size Indicates the size of buffer available...

Page 51: ...ID assigned to the application by the AWE Manager during initialization Remarks The following are some important points to note when using this function The location passed in as pointer must be valid...

Page 52: ...ssed in as pointer must be valid memory locations allocated by the parent application If the locations are invalid it is possible to trip General Protection Fault in Windows If the buffer is not suffi...

Page 53: ...s not found the driver will look for the file in Windows SYSTEM directory lParam2 Unused hUserID Current ID assigned to the application by the AWE Manager during initialization Remarks This function d...

Page 54: ...m_Flag should be either OPER_MEMORY or OPER_FILE where OPER_MEMORY indicates loading from memory buffer pointer by the m_Buffer and OPER_FILE indicates loading from a file hUserID Current ID assigned...

Page 55: ...ffer used m_Buffer String of current bank descriptor The buffer area will be filled by the manager with the descriptor of the selected User Bank The string ends with two consecutive 0 s Size returned...

Page 56: ...n be any Windows acceptable PCM wave files Compressed wave files are not supported Parameters lParam1 Specify a word data type High word of lParam1 should be set to the Bank Number and low word should...

Page 57: ...T AWE_ERR_SYSMEM_INSUFFICIENT AWE_ERR_DRAM_INSUFFICIENT See Also AWE_CLEAR_WAVEFX AWE_GET_WAVEFX_PATH AWE_CLEAR_WAVEFX Actions An application sends this message to inform the AWE Manager that it wishe...

Page 58: ...a Note Only the path of WaveFXs loaded to Bank 0 can be retrieved hUserID Current ID assigned to the application by the AWE Manager during initialization Remarks The following are some important point...

Page 59: ...ointer to a buffer area The m_Flag field is used to indicate whether the User Bank will be loaded from a file or from a chunk of memory buffer The value of m_Flag should be either OPER_MEMORY or OPER_...

Page 60: ...d with appropriate values Member Remarks m_UBankIndex The index to destinate User Bank m_InstrIndex The index to an Instrument within the UBank The m_InstrIndex will be the instrument offset of the Us...

Page 61: ...LID AWE_ERR_RESOURCE_INSUFFICIENT See Also AWE_LOAD_USER_INSTR AWE_CLEAR_USER_INSTR AWE_CLEAR_USER_INSTR Actions An application sends this message to clear an instrument s presets located in the User...

Page 62: ...et lParam2 Unused Remark This message is introduced because there is no way to differentiate between a User Bank that is self loaded or loaded by other User Bank Return The return value would be AWE_N...

Page 63: ...illed with the current minor version of the AWE Manager hUserID Current ID assigned to the application by the AWE Manager during initialization Remarks None Return The return value would be AWE_NO_ERR...

Page 64: ...message to validate a handle before committed to any operations Parameters lParam1 Specify a declared handle type AWEHANDLE This is the handle used in query lParam2 Unused hUserID Current ID assigned...

Page 65: ...hen it wishes to acquire the Vienna API Parameters lParam1 Specify a pointer to a user delacred handle type AWEHANDLE The DLL fills this location with a value hUserID if the initialization is successf...

Page 66: ...cbSize Size of the stream buffer including the header information dwFlag Set to zero dwSampleHandle This field will be filled with a handle to the sample after the first call to stream sample This han...

Page 67: ...ror code otherwise Possible error is AWE_ERR_USERID_INVALID AWE_ERR_INVALID_SAMPLE AWE_ERR_OUT_OF_GCHANNEL See Also AWE_VIENNA_FREE_SAMPLE AWE_VIENNA_PLAY_SAMPLE AWE_VIENNA_LOAD_PRESET AWE_VIENNA_FREE...

Page 68: ...offset in terms of words Set to zero if no looping lParam2 Unused hUserID Curerent ID assigned to the application by AWE Manager during initialization Remarks Applications need to ensure that every s...

Page 69: ...ation will be used to store the current available amout of DRAM hUserID Curerent ID assigned to the application by AWE Manager during initialization Remarks None Return The return value would be AWE_N...

Page 70: ...rd is the Note Number The high word is the Velocity lParam2 Unused hUserID Curerent ID assigned to the application by AWE Manager during initialization Remarks None Return The return value would be AW...

Page 71: ...eter Number LSB CC101 Registered Parameter Number MSB CC120 All Sound Off CC121 Reset All Controllers CC123 All Notes Off RPN recognizes controller value 0 pitch bend sensitivitiy Reset All controller...

Page 72: ...e application by AWE Manager during initialization Remarks None Return The return value would be AWE_NO_ERR if the operation is successful and an error code otherwise See Also None AWE_VIENNA_CHANNEL_...

Page 73: ...lso None AWE_VIENNA_GET_DRAM_SIZE Actions Application sends this message to AWE Manager to request for current available and maximum DRAM size Parameters lParam1 Specifies a far pointer to a double wo...

Page 74: ...o gain access to the AWE Manager This ID should be obtained from the AWE_OPEN API call AWE_ERR_EFXT_INVALID An invalid Effect Type Index is specified This error happens when an application specifies a...

Page 75: ...ERR_DLL_BUSY Notifies the application that another application has already accessed the manager and is still accessing it This error message is to prevent multiple applications calling the manager sim...

Page 76: ...art accessing and manipulating the Sound Blaster AWE32 This guide will show in step by step examples how the AWE32 features can be programmed using the DLL provided This guide assumes that you are pro...

Page 77: ...se AWE Manager AWEManager hDeviceID AWE_CLOSE 0L 0L return msg wParam If the calling application is running on a system that supports multiple AWE hardware like Windows 95 it should use the AWE_GET_NU...

Page 78: ...r till a 0 is met while dest 0 dest end dest dest skip the 0 return dest return head of next string void RetrieveSupport void Retrieve Synth and Effect Type supported by the MIDI driver char scratch B...

Page 79: ...nto the Treble Buffer for i 0 i buffer m_Flag i strcpy cTrebleList i 0 const char GetElement scratch 0 i int buffer m_SizeUsed BASS TYPE VARIATIONS Get Bass Type Variations List Same buffer settings a...

Page 80: ...rrent Synthesizer Bank from AWEMAN buffer m_Size sizeof scratch buffer m_Buffer LPSTR scratch AWEManager hID AWE_GET_SYN_BANK LPARAM LPBUFFEROBJECT buffer 0L should return an error since buffer not en...

Page 81: ...maximum size of 20 bytes Issuing selections The select class API provided by the Manager allows you to instate selection to the AWE s features These API allow you to configure the AWE s Effect Types V...

Page 82: ...DO Restore normal arrow cursor void SetUserBank int nUBNum char filename int nStrlen Configure the User Bank CBufferObject buffer LRESULT lResult validate the range first m_CurUserBank min MAX_USER_B...

Page 83: ...m min MAX_INSTR max nINum 0 TO DO Display HOUR GLASS param m_UBankIndex nUBNum param m_InstrIndex nINum buffer m_SizeUsed nFINum buffer m_Size nStrlen buffer m_Flag OPER_FILE buffer m_Buffer LPSTR fil...

Page 84: ...quired 1 send NRPN MSB with MSB of sound parameter 2 send NRPN LSB with LSB of sound parameter 3 send Data Entry MSB with MSB of sound parameter value 4 send Data Entry LSB with LSB of sound parameter...

Page 85: ...filter modulation or wah wah To modulate something we would require a modulation source and a modulation destination In the EMU8000 the modulation sources are the LFOs and the envelope generators and...

Page 86: ...w Frequency Oscillator 2 Envelope Parameters Effects Engine Audio Envelope Parameters Min Max Min Max Min Max Min Max Min Max Min Max Min Max R e v e r b Chorus D e l a y Freq D e l a y Freq LFO1 to V...

Page 87: ...he pitch of the audio signal only Filter Resonance A filter alone would be like an equaliser making a bright audio signal duller but the addition of resonance greatly increases the creative potential...

Page 88: ...000 The six stages are delay attack hold decay sustain and release The stages can be described as follows Delay The time between when a key is played and when the attack phase begins Attack The time i...

Page 89: ...ote Realtime means that the parameter can also affect a sustaining note For example filter sweep on a sustaining sound can be achieved by sending continuous NRPN LSB 21 initial filter cutoff NRPN LSB...

Page 90: ...k time from 0 to 5 9 seconds NRPN LSB 6 Envelope 1 hold time Realtime No Range 0 8191 Unit Milliseconds Envelope 1 hold time from 0 to 8 seconds NRPN LSB 7 Envelope 1 decay time Realtime No Range 0 59...

Page 91: ...attack time from 0 to 5 9 seconds NRPN LSB 12 Envelope 2 hold time Realtime No Range 0 8191 Unit Millisecond Envelope 2 hold time from 0 to 8 seconds NRPN LSB 13 Envelope 2 decay time Realtime No Ran...

Page 92: ...positive from 0 to maximum of 1 octave shift at LFO peak On the other hand if data value is smaller than 0 this will cause a negative from o to minimum of 1 octave shift at LFO peak NRPN LSB 19 Envelo...

Page 93: ...gh DC Fc Hz Q dB Fc kHz Q dB Attn dB 0 92 5 Flat Flat 0 0 1 93 6 8 5 0 5 0 5 2 94 8 8 3 1 1 2 3 95 10 8 2 2 1 8 4 96 11 8 1 3 2 5 5 97 13 8 0 4 3 3 6 98 14 7 9 5 4 1 7 99 16 7 8 6 5 5 8 100 17 7 7 7 6...

Page 94: ...ctave at envelope peak On the other hand value smaller than 0 causes a negative phase from 0 to minimum filter modulation via Envelope 1 with magnitude of 6 octave at envelope peak NRPN LSB 25 Chorus...

Page 95: ...nnel stereo audio signal The systems may of course have controls which determine the degree of enhancement These systems have no possibility for real time positioning and controlled movement of sound...

Page 96: ...a head tracking system so that the position and orientation of the listener s head is known in read time the 3D audio system can provide the correct left right cues to simulate the actual behavior tha...

Page 97: ...ion with the MIDI engine The sound samples wave files have to be preloaded in a form of SoundFont It is recommended that users create SoundFonts using our Vienna SoundFont editor so that loop points o...

Page 98: ...tDopplerEffect c3daSetMaxDistance c3daInit c3daError PASCAL c3daInit VOID Actions Initialize the 3D Positional Audio Library and must be called before any other calls to the library Parameters None Re...

Page 99: ...off Doppler effects completely and a value of 255 turns on the full effects of Doppler The default value is 127 Return Return c3daSUCCESS upon success and c3daFAILURE otherwise c3daSetMaxDistance c3da...

Page 100: ...itter object x y z Specify the initial coordinates of the emitter These coordinates are relative to the active receiver Return Return c3daSUCCESS upon success and c3daFAILURE otherwise Remarks By defa...

Page 101: ...f the audio spatialization algorithms Note that all receivers have a fixed orientation where the head is facing along the positive x axis and the left ear is along the positive y axis To implement a r...

Page 102: ...3daSTOP and c3daPAUSE Return Return c3daSUCCESS upon success and c3daFAILURE otherwise c3daSetEmitterGain c3daError PASCAL c3daSetEmitterGain c3daEmitter FAR lpEm UINT uGain Actions Change the output...

Page 103: ...r PASCAL c3daSetEmitterDelay c3daEmitter FAR lpEm unsigned delay Actions Set the delay time for the reverberation channel of the emitter Parameters lpEm Specify a far pointer to an emitter object dela...

Page 104: ...nter to a receiver object x y z Specify the initial coordinates of the receiver Return Return c3daSUCCESS upon success and c3daFAILURE otherwise Remarks The position of a receiver is used by the audio...

Page 105: ...iver object Return Return c3daSUCCESS upon success and c3daFAILURE otherwise Remarks On the AWE multiple receivers can be created however there can only be one active receiver at a time c3daGetActiveR...

Page 106: ...errupt far prev_intr previous interrupt handler newintr is a interrupt handler that hooks on to interrupt 1CH to get a 18 2Hz timer interrupt The variable count is incremented and serve as an indicato...

Page 107: ...bsize awe32DefineBankSizes sp fp fopen sound raw rb if fp printf Cannot open sound raw n return 1 wp tag 0x101 wp bank_no 1 wp sample_size 49429 hard coded info about sound raw wp samples_per_sec 441...

Page 108: ...basic idea is that changing a receiver s orientation is equivalent to appropriately moving all the emitters around a receiver with a fixed orientation This example uses yaw pitch and roll to transfor...

Page 109: ...thisRx a 3 x thisRx a 4 y thisRx a 5 z new_z thisRx a 6 x thisRx a 7 y thisRx a 8 z now tell the c3da core about the new position c3daSetEmitterPosition pEm em new_x new_y new_z sample world setReceiv...

Page 110: ...1 sin yaw_f cos pitch_f thisRx a 2 sin pitch_f thisRx a 3 sin yaw_f cos roll_f cos yaw_f sin pitch_f sin roll_f thisRx a 4 cos yaw_f cos roll_f sin yaw_f sin pitch_f sin roll_f thisRx a 5 cos pitch_f...

Reviews: