Creative AWE32 Manual

Creative AWE32 Manual

Developer's information pack
Table of Contents

Advertisement

Version 3.01
Developer's Information
Pack
Creative Technology Ltd.
Creative Technology Ltd.
Copyright © Creative Technology Ltd., 1994-96. All rights reserved.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AWE32 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Creative 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: Table Of Contents

    26 awe32WPStreamWave....................26 awe32WPBuildSFont ....................27 Real and Protected Mode API Programming Guide..............27 Using the libraries ...................... 28 Initialization........................ 28 Contents • • i SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 3 Volume Envelope ....................... 87 Pitch and Filter Envelope ................... 87 Pitch/Filter Envelope Modulation ................88 SB AWE32 MIDI NRPN List ....................88 NRPN LSB 0 (Delay before LFO1 starts) ..............88 NRPN LSB 1 (LFO1 Frequency)................88 NRPN LSB 2 (Delay before LFO2 starts) ..............88 NRPN LSB 3 (LFO2 Frequency)................
  • Page 4 NRPN LSB 26 (Reverb Effects Send)................ 93 PART V 3D Positional Audio API Library Overview ........................94 3D Positional Audio Overview ....................94 SB AWE32 DOS 3D Positional Audio Library ................ 96 Types and Structures......................... 96 System Functions........................97 c3daInit........................97 c3daEnd........................
  • Page 5: Part I Introduction

    RESTRICTIONS ON USE Creative Technology Ltd. retains title and ownership of the manual and software as well as ownership of the copyright in any subsequent copies of the manual and software, irrespective of the form of media on or in which the manual and software are recorded or fixed.
  • Page 6: This Package

    Creative Technology Ltd. is aware of such errors and Creative Technology Ltd. shall be under no obligation to provide to Licensee any updates, corrections or bug-fixes which Creative Technology Ltd. may elect to prepare.
  • Page 7: Using This Manual

    Embedded MIDI applications We at Creative Labs has spent much effort in creating the drivers and libraries to save your development time. We have taken great care to meet the requirements of the various types of developers and to reduce the possibilities of clashes with other TSRs or Windows system drivers.
  • Page 8: Document Conventions

    In this document, "you" refers to you the developer or sometimes your application. The word "user" refers to the person who uses your application. PART I Introduction • • 7 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 9: Getting Assistance

    A flat model protected mode library is also provided. Before you proceed to Part II, III and IV of this manual, you need to familiarize yourself with the hardware functional blocks of the Sound Blaster AWE32 audio card. A diagram of the functional blocks is provided below.
  • Page 10 • The ROM contains 1MB of General MIDI sound samples. • DRAM This is the supplied 512 KB of DRAM on Sound Blaster AWE32 and Sound Blaster AWE32 Value Edition for custom sound samples and GS support. • SIMM Socket 2 optional SIMM sockets for DRAM expansion.
  • Page 11 X, Y, and Z = 2, 4, 6, or 8. They follow the base I/O address of 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.
  • Page 12: Part Ii Dos Real/Protected Mode Api

    HARDWARE.OBJ, SBKLOAD.OBJ, WAVLOAD.OBJ and SFHELP2.OBJ are discardable after they have been used. For example, in a TSR program, after you have initialized the SB AWE32 hardware and loaded your SoundFont bank file, you can mark portions of your code that must stay resident (the MIDI engine, the embedded General MIDI preset data and any SoundFont preset data), and discard the hardware and the SoundFont loader module.
  • Page 13: Hardware Detection And Initialization

    BLASTER environment variable with a 'E' prefix. For example, E620. The ‘E’ BLASTER environment parameter is introduced to cater for future derivatives of the 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.
  • Page 14: Awe32Inithardware

    • awe32NoteOff • awe32ProgramChange • awe32PitchBend • awe32Controller • awe32ChannelPressure • awe32PolyKeyPressure • awe32Sysex • __awe32NoteOff PART II DOS Real/Protected Mode API • • 13 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 15: Awe32Initmidi

    Specify the MIDI note's velocity. Valid range for this variable is from 0 to 127. Return The return value is 0 if the MIDI note on is successful, non-zero if otherwise. PART II DOS Real/Protected Mode API • • 14 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 16: Awe32Noteoff

    Specify the desired program value. Valid range for this variable is from 0 to 127. Return The return value is 0 if the MIDI program change is successful, non-zero if otherwise. PART II DOS Real/Protected Mode API • • 15 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 17: Awe32Pitchbend

    The return value is 0 if the MIDI control change is successful, non-zero if otherwise. Remarks Supported controllers are: • Bank Select • Modulation Wheel PART II DOS Real/Protected Mode API • • 16 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 18: Awe32Channelpressure

    Specify the channel pressure data value. Valid range for this variable is from 0 to 127. PART II DOS Real/Protected Mode API • • 17 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 19: Awe32Polykeypressure

    Specify the size of the Sysex buffer. Return The return value is 0 if the MIDI Sysex command is successful, non-zero if otherwise. PART II DOS Real/Protected Mode API • • 18 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 20 Turn off a MIDI note. You would use this function to turn off a specific user bank note. PART II DOS Real/Protected Mode API • • 19 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 21: Soundfont Bank And Downloadable Dram Services

    API when you want to customize the MIDI instruments and sound effects in your application. These API use the following data structures : PART II DOS Real/Protected Mode API • • 20 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 22: Awe32Totalpatchram

    WORD PASCAL awe32TotalPatchRam(SOUND_PACKET FAR* SP) Actions Determine the total amount of RAM on the AWE32. This is not the amount of “unused” RAM but the total amount of RAM. awe32TotalPatchRam assumes the AWE32 card has been detected and initialized. Parameters Points to the SOUND_PACKET.
  • Page 23: Awe32Definebanksizes

    PASCAL awe32DefineBankSizes(SOUND_PACKET FAR* SP) Action Divide the AWE32’s RAM into banks. All previous bank divisions are forgotten. You would normally invoke this API at the beginning of your application. Parameters Points to the SOUND_PACKET data object in which the size of each bank and the number of banks is specified.
  • Page 24: Awe32Streamsample

    Points to the buffer that contains PACKETSIZE bytes of data SoundFont data. Return If successful, awe32StreamSample returns zero; otherwise, it returns non-zero. PART II DOS Real/Protected Mode API • • 23 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 25: Awe32Setpresets

    Points to the SOUND_PACKET in which the bank number is specified. awe32ReleaseBank assumes SP is not NULL. PART II DOS Real/Protected Mode API • • 24 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 26: Awe32Releaseallbanks

    The number of wave packets of PACKETSIZE bytes, each, that must be passed to awe32WPStreamWave; if it is used. PART II DOS Real/Protected Mode API • • 25 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 27: Awe32Wploadwave

    This should have the same value as it did when awe32WPLoadRequest was called. Return If successful, awe32WPStreamWave returns zero; otherwise, it returns non-zero. PART II DOS Real/Protected Mode API • • 26 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 28: Awe32Wpbuildsfont

    Using the libraries • Initialization • Termination • Using embedded GM presets • Loading a SoundFont Bank PART II DOS Real/Protected Mode API • • 27 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 29: Using The Libraries

    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 steps are required for initialization as shown below. The first example assumes that the base I/O addresses of the EMU8000 subsystem is at 0x620 and are spaced 0x400 apart.
  • Page 30: Termination

    Termination The SB AWE32 EMU8000 subsystem must be properly terminated when your application wishes to quit. Failure to do so may render any subsequent playing of FM music inaudible. if ( awe32Terminate() ) { // Error, termination failed Using embedded GM presets General MIDI presets are included in this package, EMBED.OBJ.
  • Page 31: Loading Wave Data As An Instrument

    = 2; // Total no. of banks if ( awe32DefineBankSizes(&sp) ) { // Error, invalid sizes PART II DOS Real/Protected Mode API • • 30 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 32: Using Awe32Definebanksizes

    • To define additional banks. The new banks have to be added beyond the last bank. Assume that the RAM on the SB AWE32 is divided into 3 banks of 128 kilobytes each. LONG banks[4]; /* reserve for 4 banks */ SOUND_PACKET sp;...
  • Page 33: Starting And Ending Addresses

    CODE End __sfhelp2_ecode() DATA Start int* __sfhelp2_code() DATA End int* __sfhelp2_ecode() SBKLOAD.OBJ CODE Start __sbkload_code() CODE End __sbkload_ecode() PART II DOS Real/Protected Mode API • • 32 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 34: Significance Of Awe32Numg Variable

    As a result, if the pan positions are updated in real-time, PART II DOS Real/Protected Mode API • • 33 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 35: Ctpnp.cfg Sample

    The file is introduced because the relationships between the 3 EMU8000 I/O windows and SB16 base I/O address may not be true for the SB AWE32 PnP card. In fact, even the 3 EMU8000 I/O windows themselves may not be related at all, i.e. not 0x400 apart. The Plug and 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.
  • Page 36: Part Iii Windows Driver Api

    AWE Manager will relay the request to the SBAWE32.DRV driver. This driver will download the required effect microcodes into the AWE32. The diagram below depicts the relationships of the libraries and drivers for the Sound Blaster AWE32.
  • Page 37: Application Programmer Interface

    The current implementation of API is via message-based system (different from Windows' WM_USER). The API provides parent applications with a set of messages, accessing the features of AWE32. The API exports one function call AWEManager. Applications communicate to AWEMAN.DLL through this function using the pre-defined messages.
  • Page 38: Awe Manager Message Function

    Windows, the manager's message function can be accessed using a pointer to a function. It is important to realize that AWE Manager will only support one user application accessing the AWE32 per hardware device. It is the task of user application to 'release' the device before it can be accessed by other user application.
  • Page 39: Manager Messages

    } CDevObject; The CDevObject structure can be used to identify the capabilities of available SB AWE32 devices on the system. Some of the fields are only meaningful in certain platform. All the above mentioned structures are already provided in the AWE_DLL.H header file. Hence, by including this header file in your application, the AWE Manager will be ready for accessing.
  • Page 40 Play/Stop user samples AWE_VIENNA_LOAD_PRESET Load SoundFont2 preset AWE_VIENNA_FREE_PRESET Free SoundFont2 preset AWE_VIENNA_NOTE_ON Play a note preset loaded using AWE_VIENNA_LOAD_PRESET PART III Windows Driver API • • 39 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 41: Message Reference

    The return value would be AWE_NO_ERR if the operation is successful and an error code otherwise. Possible error messages are: AWE_ERR_DEVICE_DRV_INVALID PART III Windows Driver API • • 40 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 42 AWE_ERR_ACCESS_NOT_PERMITTED AWE_ERR_VERSION_INVALID See Also AWE_CLOSE AWE_CLOSE Actions An application sends this message to AWE Manager when it wishes to release control of the acquired AWE32 device to other applications. Parameters lParam1 Unused. lParam2 Unused. hUserID Current ID assigned to the application by AWE Manager during initialization.
  • Page 43 Unused. Remarks The returned number gives an indication of how many AWE32 devices are actually supported by the MIDI driver. This is dependent on the different Windows platforms. Currently, only Windows 95 supports multiple devices. For other platforms, the number returned will always be 1 if the driver is successfully initialized.
  • Page 44 Current ID assigned to the application by the AWE Manager during initialization. Remarks The followings are some important points to note when using this function. PART III Windows Driver API • • 43 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 45 String Equivalent Vari-Index Type Sub-Index "Room 1" "Room 2" "Room 3" "Hall 1" "Hall 2" "Plate" PART III Windows Driver API • • 44 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 46 Indicates the size of buffer available. m_Buffer Far pointer to a buffer area. The Manager upon returning, will fill the following fields: PART III Windows Driver API • • 45 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 47 Member Remarks m_TypeIndex The effect types index. m_SubIndex Number of variations index returned. m_VariIndex[..] The type variations index. PART III Windows Driver API • • 46 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 48 String Type Sub-Index "Reverb & Chorus" 0 - Reverb 1 - Chorus PART III Windows Driver API • • 47 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 49 String Type Sub-Index "Reverb & Chorus" 0 - Reverb 1 - Chorus 2 - Bass PART III Windows Driver API • • 48 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 50 The size returned includes the '\0's used to delimit two entries. The current version of MIDI driver supports the following Synthesizer Emulation: PART III Windows Driver API • • 49 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 51 The path specified by the user can be found in the SBWIN.INI file under "AWE32" section. The entry name for each respective synthesizer emulation are listed in the table. Hence, [AWE32] GM = C:\SBANK\USER1.SBK...
  • Page 52 Synthesizer Emulation. The following shows a list of available Emulations loadable into Synthesizer Bank: String Entry File "General MIDI" SYNTHGM.SBK "GS" SYNTHGS.SBK PART III Windows Driver API • • 51 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 53 " SOUND ". The default name is used whenever a user specified file cannot be located. The path specified by the user can be found in the SBWIN.INI file under the "AWE32" section. The entry name for each respective synthesizer emulation is listed in the table. Hence, [AWE32] GM = C:\SBANK\USER1.SBK...
  • Page 54 Possible errors are: AWE_ERR_USERID_INVALID AWE_ERR_DEVICE_BUSY AWE_ERR_PATHNAME_INVALID AWE_ERR_USER_OBJ_INVALID AWE_ERR_UBANK_INVALID AWE_ERR_RESOURCE_INSUFFICIENT AWE_ERR_SYSMEM_INSUFFICIENT AWE_ERR_DRAM_INSUFFICIENT See Also AWE_LOAD_USER_INSTR, AWE_CLEAR_USER_BANK PART III Windows Driver API • • 53 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 55 AWE_LOAD_USER_BANK, AWE_CLEAR_USER_BANK AWE_CLEAR_USER_BANK Actions An application sends this message to remove a loaded User Bank from memory. Parameters lParam1 PART III Windows Driver API • • 54 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 56 Current ID assigned to the application by the AWE Manager during initialization. Remarks The following are some important points to note when using this function. PART III Windows Driver API • • 55 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 57 The return value will be AWE_NO_ERR if the operation is successful, and an error code otherwise. Possible errors are: AWE_ERR_USERID_INVALID AWE_ERR_DEVICE_BUSY AWE_ERR_PATHNAME_INVALID AWE_ERR_USER_OBJ_INVALID AWE_ERR_UBANK_INVALID AWE_ERR_RESOURCE_INSUFFICIENT AWE_ERR_SYSMEM_INSUFFICIENT AWE_ERR_DRAM_INSUFFICIENT PART III Windows Driver API • • 56 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 58 Possible errors are: AWE_ERR_USERID_INVALID AWE_ERR_DEVICE_BUSY AWE_ERR_PATHNAME_INVALID AWE_ERR_USER_OBJ_INVALID AWE_ERR_UBANK_INVALID AWE_ERR_RESOURCE_INSUFFICIENT AWE_ERR_SYSMEM_INSUFFICIENT AWE_ERR_DRAM_INSUFFICIENT See Also AWE_LOAD_WAVEFX, AWE_CLEAR_WAVEFX PART III Windows Driver API • • 57 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 59 The return value would be AWE_NO_ERR if the operation is successful, and an error code otherwise. Possible errors are: PART III Windows Driver API • • 58 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 60 The buffer area will be filled by the manager with the descriptor of the instrument. hUserID Current ID assigned to the application by the AWE Manager during initialization. PART III Windows Driver API • • 59 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 61 The return value would be AWE_NO_ERR if the operation is successful, and an error code otherwise. Possible errors are: AWE_ERR_USERID_INVALID AWE_ERR_DEVICE_BUSY AWE_ERR_INSTR_INVALID AWE_ERR_UBANK_INVALID See Also AWE_LOAD_USER_INSTR PART III Windows Driver API • • 60 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 62 The unit for both lParam1 and lParam2 is words. That is, the return size is in terms of number of words. PART III Windows Driver API • • 61 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 63 Specify the status byte. bbbbbbb: Specify the first data byte. (0-127) ccccccc: Specify the second data byte. (0-127) lParam2 Unused hUserID PART III Windows Driver API • • 62 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 64 Application may wish to do so before attempting to open the device. Parameters lParam1 PART III Windows Driver API • • 63 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 65 Application sends this message to AWE Manger when it wishes to release control of Vienna API to other applications. Parameters lParam1 Unused lParam2 Unused. PART III Windows Driver API • • 64 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 66 This is the place holder where the actual samples are stored iSample starting from here. lParam2 Unused. hUserID PART III Windows Driver API • • 65 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 67 Application sends this message to AWE Manager when it want to play/stop sample which was loaded using AWE_VIENNA_LOAD_SAMPLE. PART III Windows Driver API • • 66 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 68 Specifies a far pointer to a memory locations where a valid SoundFont2 presets is stored. lParam2 Unused. hUserID Curerent ID assigned to the application by AWE Manager during initialization. PART III Windows Driver API • • 67 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 69 Valid range for Note Number and Velocity is from 0 to 127. lParam2 Unused. hUserID Curerent ID assigned to the application by AWE Manager during initialization. PART III Windows Driver API • • 68 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 70 The valid range from Controller Number and Controller Value is from 0 to 127. Supported controllers are : Bank Select Modulation Wheel PART III Windows Driver API • • 69 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 71 The return value would be AWE_NO_ERR if the operation is successful, and an error code otherwise. See Also AWE_VIENNA_LOAD_PRESET PART III Windows Driver API • • 70 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 72 The return value would be AWE_NO_ERR if the operation is successful, and an error code otherwise. See Also None PART III Windows Driver API • • 71 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 73 The return value would be AWE_NO_ERR if the operation is successful, and an error code otherwise. See Also AWE_QUERY_DRAM_SIZE PART III Windows Driver API • • 72 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 74: Error Messages

    (or single instrument) into a specific User Bank area. This module uses the SBK format. PART III Windows Driver API • • 73 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 75 Notifies the application that driver has detected insufficient system memory. AWE_ERR_INVALID_MESSAGE Indicates that a message not recognised by the driver was sent. PART III Windows Driver API • • 74 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 76: Windows Programming Guide

    This chapter provides you with examples on how to use the API provided by AWEMAN. The examples provided, in fragments of code, are sufficient to let you start 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.
  • Page 77: Querying For Supports

    The following function retrieves the available support and updates the global variables. This example can be added in your program's initialization routine. PART III Windows Driver API • • 76 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 78 // Add into the EfxType buffer for ( i=0; i<buffer.m_Flag; i++ ) strcpy(&cEffectType[i][0],(const char*) GetElement(&scratch[0],i, (int)buffer.m_SizeUsed)); // REVERB TYPE VARIATIONS PART III Windows Driver API • • 77 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 79 AWE Manager to return the error AWE_ERR_RESOURCE_INSUFFICIENT. From the CBufferObject, the member m_SizeUsed will contain the number of bytes required to contain the entire list of strings. PART III Windows Driver API • • 78 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 80: Retrieving Selections

    (LPARAM)(LPBUFFEROBJECT) &buffer); if (buffer.m_SizeUsed == 1) strcpy((char *) &cUBankDescriptor[0], (const char*)"NO DESCRIPTOR\0"); else strcpy((char *) &cUBankDescriptor[0], (const char*) &scratch[0]); PART III Windows Driver API • • 79 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 81: Issuing Selections

    LRESULT lResult; lResult = AWEManager(hID, AWE_SELECT_SYN_BANK, (LPARAM)(WORD)nSNum, 0L); if (lResult != AWE_NO_ERR) // TO DO: // DisplayErrorMsg( lResult ); PART III Windows Driver API • • 80 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 82 // nFINum - Instrument number from the SBK file to download from. // nINum - Instrument number in the nUBNum bank to download to. char scratch[BUF_SIZE]; PART III Windows Driver API • • 81 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 83 // DisplayErrorMsg( lResult ); else // TO DO: Update the instrument descriptor if necessary! // TO DO: Restore normal arrow cursor PART III Windows Driver API • • 82 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 84: Part Iv Midi Nrpn Implementation

    How do I use SBAWE32 NRPN? For SB AWE32 NRPN to be functional, NRPN MSB has to be 127, and NRPN LSB set to the desired parameter to be controlled (see the following for a list of available NRPN LSB for each parameter).
  • Page 85: The Emu8000 Sound Architecture

    Reverb/chorus level signals to produce the final mix. The diagram on the next page shows the typical blocks of an EMU8000 sound element. PART IV MIDI NRPN Implementation • • 84 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 86 P a r a m e t e r s G e n e r a t o r PART IV MIDI NRPN Implementation • • 85 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 87: Emu8000 Sound Elements

    A filter alone would be like an equaliser, making a bright audio signal duller, but the addition of resonance greatly increases the creative potential of a filter. Increasing the resonance of a filter makes it emphasis signal at the cutoff frequency, giving the audio signal a subtle “wah-wah”, i.e., imagine a siren sound going from bright to dull and bright again periodically.
  • Page 88: Lfo1 To Pitch (Vibrato)

    The filter envelope, on the other hand, is useful in creating synthetic sci-fi sound textures. An example of a GM instrument that makes use of the filter envelope is instrument number 86, Pad 8 (Sweep). PART IV MIDI NRPN Implementation • • 87 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 89: Pitch/Filter Envelope Modulation

    NRPN LSB 3 (LFO2 Frequency) Realtime : Yes Range : [0, 127] Unit : 0.084Hz LFO2 frequency from 0Hz to 10.72 Hz. PART IV MIDI NRPN Implementation • • 88 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 90: Nrpn Lsb 4 (Envelope 1 Delay Time)

    : No Range : [0, 5940] Unit : 4 milliseconds Envelope 1 release time from 0.023 to 23.7 seconds. PART IV MIDI NRPN Implementation • • 89 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 91: Nrpn Lsb 10 (Envelope 2 Delay Time)

    : No Range : [0, 5940] Unit : 4 milliseconds Envelope 2 release time from 0.023 to 23.7 seconds. PART IV MIDI NRPN Implementation • • 90 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 92: Nrpn Lsb 16 (Initial Pitch)

    (from 0 to minimum) volume modulation via LFO1 with magnitude of 12 dB at LFO peak. PART IV MIDI NRPN Implementation • • 91 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 93: Nrpn Lsb 21 (Initial Filter Cutoff)

    3 octave at LFO peak. On the other hand, negative data value causes a negative phase (from 0 to minimum) filter modulation via LFO1 with magnitude of 3 octave at LFO peak. PART IV MIDI NRPN Implementation • • 92 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 94: Nrpn Lsb 24 (Envelope 1 To Filter Cutoff)

    Reverb send, with 0 being the driest (no reverb effects processing), and 255 being the wettest (full reverb effect processing). PART IV MIDI NRPN Implementation • • 93 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 95: Part V 3D Positional Audio Api

    The 3D Positional Audio Library provides programmers a low-level access to audio spatialization algorithms implemented on the SB AWE32. The library provides programmers the ability to create and move in 3D space basic audio spatialization objects such as sound emitters and receivers. The library attempts to control the apparent location of sound emitters relative to a receiver by modeling a small set of physical and psycho-acoustic phenomena.
  • Page 96 (or a receiver) is moving, then the change in spatial location will create a much stronger impression than a sound that is fixed, relative to a receiver. PART V 3D Positional Audio API • • 95 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 97: Sb Awe32 Dos 3D Positional Audio Library

    Typical sounds that will localize poorly include pure steady tones and simple waveforms. SB AWE32 DOS 3D Positional Audio Library The SB AWE32 implementation of the 3D Positional Audio Library imposes some limits because of its tight integration with the MIDI engine.
  • Page 98: System Functions

    Parameters None. Return Return c3daSUCCESS upon success and c3daFAILURE otherwise. PART V 3D Positional Audio API • • 97 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 99: C3Dasetdopplereffect

    This group of API consists of the following : • c3daCreateEmitter • c3daDestroyEmitter • c3daSetEmitterPosition • c3daSetEmitterOrientation • c3daSetEmitterSoundState • c3daSetEmitterGain • c3daSetEmitterPitchInc PART V 3D Positional Audio API • • 98 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 100: C3Dacreateemitter

    Specify a far pointer to an emitter object. Return Return c3daSUCCESS upon success and c3daFAILURE otherwise. PART V 3D Positional Audio API • • 99 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 101: C3Dasetemitterposition

    Specify a far pointer to an emitter object. x, y, z Specify the orientation vector. Return Return c3daSUCCESS upon success and c3daFAILURE otherwise. PART V 3D Positional Audio API • • 100 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 102: C3Dasetemittersoundstate

    Increment or decrement the pitch of an emitter. Parameters lpEm Specify a far pointer to an emitter object. PART V 3D Positional Audio API • • 101 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 103: C3Dasetemitterdelay

    Specify a far pointer to an emitter object. uBank, uProgram, uKeynum Specify the MIDI source. Return Return c3daSUCCESS upon success and c3daFAILURE otherwise. PART V 3D Positional Audio API • • 102 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 104: Receiver Functions

    Specify a far pointer to a receiver object. Return Return c3daSUCCESS upon success and c3daFAILURE otherwise. PART V 3D Positional Audio API • • 103 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 105: C3Dasetactivereceiver

    Place a receiver in 3D space. Correspondingly, the positions of all existing emitters are updated internally. Parameters lpRx Specify a far pointer to a receiver object. x, y, z PART V 3D Positional Audio API • • 104 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 106: Programming Example

    SB AWE32\n"); return -1; awe32InitHardware(); if (awe32DramSize == 0) { printf("Not enough DRAM\n"); return -1; PART V 3D Positional Audio API • • 105 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 107 = preset; /* SoundFont preset space */ awe32WPBuildSFont(&wp); Initialize the 3D Positional Audio Library and creative an emitter base on the loaded sound sample. c3daInit(); c3daCreateEmitter(&em, 1, 0, 60); c3daSetEmitterMIDISource(&em, 1, 0, 60); c3daSetEmitterSoundState(&em, c3daSTART); Save current interrupt vector and hook on to interrupt 1CH.
  • Page 108: Implementing Receiver Orientation

    /* rotation matrix for yaw, pitch, roll */ /* A = | a[0] a[1] a[2] | PART V 3D Positional Audio API • • 107 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 109 ) float yaw_f; float pitch_f; float roll_f; * convert yaw, pitch, and roll to radians PART V 3D Positional Audio API • • 108 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...
  • Page 110 * loop over the emitters letting them use the new orientation for ( i = 0; i < NUMBER_OF_EMITTERS; i++ ) setEmitterPosition( &Em[i], Em[i].x, Em[i].y, Em[i].z ); PART V 3D Positional Audio API • • 109 SB AWE32 Developer's Information Pack Copyright © © Creative Technology Ltd., 1994-1996 Version 3.00...

Table of Contents

Save PDF