vitasdk
Documentation of the vitasdk
ngs.h File Reference

Go to the source code of this file.

Data Structures

struct  SceNgsBufferInfo
 Buffer owned by the caller and used by NGS in place. More...
 
struct  SceNgsSystemInitParams
 System sizing and processing configuration. More...
 
struct  SceNgsRackDescription
 Description used to size and create a rack. More...
 
struct  SceNgsPatchSetupInfo
 Endpoints used to create one voice-to-voice patch. More...
 
struct  SceNgsVoicePreset
 Voice preset header. More...
 
struct  SceNgsCallbackInfo
 Information delivered to an NGS callback. More...
 
struct  SceNgsParamsDescriptor
 Header shared by every module-specific parameter structure. More...
 
struct  SceNgsAT9SkipBufferInfo
 Byte range and samples to skip at each end when decoding an ATRAC9 sample interval. More...
 
struct  SceNgsModuleParamHeader
 Header of one record accepted by sceNgsVoiceSetParamsBlock. More...
 
struct  SceNgsVolumeMatrix
 Gain matrix indexed as matrix[outputChannel][inputChannel]. More...
 
struct  SceNgsPatchRouteInfo
 Current route and gain information returned by sceNgsPatchGetInfo. More...
 
struct  SceNgsVoiceInfo
 Current voice and voice-definition information. More...
 
struct  SceSulphaNgsConfig
 Sulpha NGS trace-agent capacities. More...
 

Macros

#define SCE_NGS_MAX_SYSTEM_CHANNELS   2
 

Typedefs

typedef struct SceNgsVoiceDefinition SceNgsVoiceDefinition
 Opaque immutable voice definition.
 

Enumerations

enum  SceNgsErrorCode {
  SCE_NGS_OK = 0x00000000 , SCE_NGS_ERROR = 0x804A0001 , SCE_NGS_ERROR_INVALID_PARAM = 0x804A0002 , SCE_NGS_ERROR_INVALID_ALIGNMENT = 0x804A0003 ,
  SCE_NGS_ERROR_NOT_IMPL = 0x804A0004 , SCE_NGS_ERROR_DEPENDENCY = 0x804A0005 , SCE_NGS_ERROR_OUT_OF_ASSETS = 0x804A0006 , SCE_NGS_ERROR_MODULE_NOT_AVAIL = 0x804A0007 ,
  SCE_NGS_ERROR_RESOURCE_LOCKED = 0x804A0008 , SCE_NGS_ERROR_PARAM_OUT_OF_RANGE = 0x804A0009 , SCE_NGS_ERROR_INVALID_VOICE_TYPE = 0x804A000A , SCE_NGS_ERROR_SYSTEM_MISMATCH = 0x804A000B ,
  SCE_NGS_ERROR_INVALID_HANDLE = 0x804A000C , SCE_NGS_ERROR_SIZE_MISMATCH = 0x804A000D , SCE_NGS_ERROR_PATCH_NOT_AVAIL = 0x804A000E , SCE_NGS_ERROR_PARAM_TYPE_MISMATCH = 0x804A000F ,
  SCE_NGS_ERROR_INVALID_STATE = 0x804A0010 , SCE_NGS_ERROR_INTERNAL_ALLOC = 0x804A0011 , SCE_NGS_ERROR_INTERNAL_PROCESSING = 0x804A0012 , SCE_NGS_ERROR_INVALID_BUFFER = 0x804A0013
}
 Error codes returned by the FW 3.60 NGS implementation. More...
 
enum  SceNgsSystemFlag { SCE_NGS_SYSTEM_FLAG_CHECK_PARAMS = 0x00000001 }
 Flags accepted by sceNgsSystemSetFlags. More...
 
enum  SceNgsVoiceInitFlag {
  SCE_NGS_VOICE_INIT_BASE = 0x00000000 , SCE_NGS_VOICE_INIT_ROUTING = 0x00000001 , SCE_NGS_VOICE_INIT_PRESET = 0x00000002 , SCE_NGS_VOICE_INIT_CALLBACKS = 0x00000004 ,
  SCE_NGS_VOICE_INIT_ALL = 0x00000007
}
 Reset operations selected by sceNgsVoiceInit. More...
 
enum  SceNgsVoiceState {
  SCE_NGS_VOICE_STATE_AVAILABLE = 0x00000000 , SCE_NGS_VOICE_STATE_ACTIVE = 0x00000001 , SCE_NGS_VOICE_STATE_FINALIZE = 0x00000004 , SCE_NGS_VOICE_STATE_UNLOADING = 0x00000008 ,
  SCE_NGS_VOICE_STATE_PENDING = 0x00000010 , SCE_NGS_VOICE_STATE_PAUSED = 0x00000020 , SCE_NGS_VOICE_STATE_KEY_OFF = 0x00000040
}
 Bitfield reported by SceNgsVoiceInfo::voice_state. More...
 
enum  SceNgsModuleBypassFlag { SCE_NGS_MODULE_FLAG_NOT_BYPASSED = 0 , SCE_NGS_MODULE_FLAG_BYPASSED = 2 }
 Values accepted and returned by the module-bypass functions. More...
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x8, SceNgsBufferInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x14, SceNgsSystemInitParams)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceNgsRackDescription)
 
 VITASDK_BUILD_ASSERT_EQ (0x14, SceNgsPatchSetupInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceNgsVoicePreset)
 
 VITASDK_BUILD_ASSERT_EQ (0x1C, SceNgsCallbackInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceNgsParamsDescriptor)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceNgsAT9SkipBufferInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceNgsModuleParamHeader)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceNgsVolumeMatrix)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceNgsPatchRouteInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceNgsVoiceInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceSulphaNgsConfig)
 
SceInt32 sceNgsAT9GetSectionDetails (SceInt32 start_sample_offset, SceInt32 num_samples, SceInt32 config_data, SceNgsAT9SkipBufferInfo *at9_info_buffer)
 Compute the encoded byte range and samples to skip at each end for an ATRAC9 sample range.
 
SceInt32 sceNgsModuleGetNumPresets (SceNgsHSynSystem system_handle, SceNgsModuleID module_id, SceUInt32 *num_presets)
 Return the number of built-in presets provided by a module type.
 
SceInt32 sceNgsModuleGetPreset (SceNgsHSynSystem system_handle, SceNgsModuleID module_id, SceUInt32 preset_index, SceNgsBufferInfo *params_buffer)
 Copy one built-in module preset into a caller-owned buffer.
 
SceInt32 sceNgsPatchCreateRouting (const SceNgsPatchSetupInfo *patch_info, SceNgsHPatch *patch_handle)
 Create a route from one voice output to one voice input.
 
SceInt32 sceNgsPatchGetInfo (SceNgsHPatch patch_handle, SceNgsPatchRouteInfo *route_info, SceNgsPatchSetupInfo *setup)
 Get the current source/destination channel counts and gains of a patch.
 
SceInt32 sceNgsPatchRemoveRouting (SceNgsHPatch patch_handle)
 Remove a voice-to-voice patch and release its source output slot.
 
SceInt32 sceNgsRackGetRequiredMemorySize (SceNgsHSynSystem system_handle, const SceNgsRackDescription *rack_desc, SceSize *size)
 Compute the rack-buffer size required for a description.
 
SceInt32 sceNgsRackGetVoiceHandle (SceNgsHRack rack_handle, SceUInt32 index, SceNgsHVoice *voice_handle)
 Return one voice allocated by a rack.
 
SceInt32 sceNgsRackInit (SceNgsHSynSystem system_handle, const SceNgsBufferInfo *rack_buffer, const SceNgsRackDescription *rack_desc, SceNgsHRack *rack_handle)
 Create a rack and all of its voices in caller-owned memory.
 
SceInt32 sceNgsRackRelease (SceNgsHRack rack_handle, SceNgsRackReleaseCallbackFunc callback_func_ptr)
 Stop every voice, remove every connected patch, and release a rack.
 
SceInt32 sceNgsRackSetParamErrorCallback (SceNgsHRack rack_handle, SceNgsParamsErrorCallbackFunc callback_func_ptr)
 Set the parameter-range callback for one rack.
 
SceInt32 sceNgsSystemGetRequiredMemorySize (const SceNgsSystemInitParams *synth_params, SceSize *size)
 Compute the system-buffer size required by an initialization configuration.
 
SceInt32 sceNgsSystemInit (void *synth_sys_memory, SceSize mem_size, const SceNgsSystemInitParams *synth_params, SceNgsHSynSystem *system_handle)
 Initialize an NGS system in caller-owned memory.
 
SceInt32 sceNgsSystemLock (SceNgsHSynSystem system_handle)
 Lock the system's internal update state.
 
SceInt32 sceNgsSystemRelease (SceNgsHSynSystem system_handle)
 Release a system after all of its racks have been released.
 
SceInt32 sceNgsSystemSetFlags (SceNgsHSynSystem system_handle, SceUInt32 system_flags)
 Replace the system flags used by subsequent parameter operations.
 
SceInt32 sceNgsSystemSetParamErrorCallback (SceNgsHSynSystem system_handle, SceNgsParamsErrorCallbackFunc callback_func_ptr)
 Set the fallback parameter-range callback for a system.
 
SceInt32 sceNgsSystemUnlock (SceNgsHSynSystem system_handle)
 Unlock a system previously locked with sceNgsSystemLock.
 
SceInt32 sceNgsSystemUpdate (SceNgsHSynSystem system_handle)
 Process one audio grain and run every queued callback.
 
SceInt32 sceNgsVoiceBypassModule (SceNgsHVoice voice_handle, SceUInt32 module, SceUInt32 bypass_flag)
 Set the bypass state of one module in a voice definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetAtrac9Voice (void)
 Return the complex ATRAC9 playback voice definition with four sends.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetCompressorBuss (void)
 Return an input-mix, compressor, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetCompressorSideChainBuss (void)
 Return a two-input side-chain compressor bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetDelayBuss (void)
 Return an input-mix, modulated-delay, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetDistortionBuss (void)
 Return an input-mix, distortion, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetEnvelopeBuss (void)
 Return an input-mix, amplitude-envelope, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetEqBuss (void)
 Return an input-mix, four-band parametric-EQ, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetMasterBuss (void)
 Return the master bus definition that exposes PCM output to the caller.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetMixerBuss (void)
 Return a bus definition that mixes multiple input voices.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetPauserBuss (void)
 Return an input-mix, click-free pauser, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetPitchShiftBuss (void)
 Return an input-mix, pitch-shift, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetReverbBuss (void)
 Return an input-mix, environmental-reverb, and output bus definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetSasEmuVoice (void)
 Return the libSas-emulation voice definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetScreamAtrac9Voice (void)
 Return the Scream ATRAC9 playback voice definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetScreamVoice (void)
 Return the Scream waveform playback voice definition.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetSimpleAtrac9Voice (void)
 Return the basic ATRAC9 playback voice definition with two sends.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetSimpleVoice (void)
 Return the basic PCM/VAG playback voice definition with two sends.
 
const SceNgsVoiceDefinition * sceNgsVoiceDefGetTemplate1 (void)
 Return the complex waveform playback template with signal generation and four sends.
 
SceInt32 sceNgsVoiceGetInfo (SceNgsHVoice voice_handle, SceNgsVoiceInfo *info)
 Get one voice's current key state, module counts, and routing information.
 
SceInt32 sceNgsVoiceGetModuleBypass (SceNgsHVoice voice_handle, SceUInt32 module, SceUInt32 *bypass_flag)
 Get the bypass state of one module.
 
SceInt32 sceNgsVoiceGetModuleType (SceNgsHVoice voice_handle, SceUInt32 module, SceNgsModuleID *module_type)
 Map a zero-based module index to its module type ID.
 
SceInt32 sceNgsVoiceGetOutputPatch (SceNgsHVoice voice_handle, SceInt32 output_index, SceInt32 sub_index, SceNgsHPatch *patch_handle)
 Return the patch occupying one voice output slot.
 
SceInt32 sceNgsVoiceGetParamsOutOfRange (SceNgsHVoice voice_handle, SceUInt32 module, char *message_buffer)
 Format the most recent parameter-range result for one module.
 
SceInt32 sceNgsVoiceGetStateData (SceNgsHVoice voice_handle, SceUInt32 module, void *memory, SceSize mem_size)
 Copy one module's runtime state snapshot.
 
SceInt32 sceNgsVoiceInit (SceNgsHVoice voice_handle, const SceNgsVoicePreset *preset, SceUInt32 init_flags)
 Reinitialize a stopped voice and optionally reset patches, preset, or callbacks.
 
SceInt32 sceNgsVoiceKeyOff (SceNgsHVoice voice_handle)
 Request release/envelope processing for a playing voice.
 
SceInt32 sceNgsVoiceKill (SceNgsHVoice voice_handle)
 Immediately stop a playing or keyed-off voice and return it to the stopped state.
 
SceInt32 sceNgsVoiceLockParams (SceNgsHVoice voice_handle, SceUInt32 module, SceNgsParamsID params_interface_id, SceNgsBufferInfo *params_buffer)
 Lock and expose one module's live parameter block.
 
SceInt32 sceNgsVoicePatchSetVolume (SceNgsHPatch patch_handle, SceInt32 output_channel, SceInt32 input_channel, SceFloat32 volume)
 Set one gain in a patch's [output][input] matrix.
 
SceInt32 sceNgsVoicePatchSetVolumes (SceNgsHPatch patch_handle, SceInt32 output_channel, const SceFloat32 *volumes, SceInt32 volume_count)
 Set the one or two input-channel gains for a patch output.
 
SceInt32 sceNgsVoicePatchSetVolumesMatrix (SceNgsHPatch patch_handle, const SceNgsVolumeMatrix *matrix)
 Replace a patch's complete 2x2 output-to-input gain matrix.
 
SceInt32 sceNgsVoicePause (SceNgsHVoice voice_handle)
 Pause voice processing without changing whether the voice is playing or keyed off.
 
SceInt32 sceNgsVoicePlay (SceNgsHVoice voice_handle)
 Start a stopped voice.
 
SceInt32 sceNgsVoiceResume (SceNgsHVoice voice_handle)
 Resume a paused voice without changing its play/key-off state.
 
SceInt32 sceNgsVoiceSetFinishedCallback (SceNgsHVoice voice_handle, SceNgsCallbackFunc callback_func_ptr, void *user_data)
 Set the callback queued when a voice reaches its finished state.
 
SceInt32 sceNgsVoiceSetModuleCallback (SceNgsHVoice voice_handle, SceUInt32 module, SceNgsModuleCallbackFunc callback_func_ptr, void *user_data)
 Set the callback for events from the module at a given index.
 
SceInt32 sceNgsVoiceSetParamsBlock (SceNgsHVoice voice_handle, const SceNgsModuleParamHeader *param_data, SceSize size, SceInt32 *error_count)
 Apply a packed sequence of module parameter records.
 
SceInt32 sceNgsVoiceSetPreset (SceNgsHVoice voice_handle, const SceNgsVoicePreset *voice_preset)
 Restore module defaults, then apply an optional voice preset.
 
SceInt32 sceNgsVoiceUnlockParams (SceNgsHVoice voice_handle, SceUInt32 module)
 Commit and unlock a module parameter block returned by sceNgsVoiceLockParams.
 
SceInt32 sceSulphaNgsGetDefaultConfig (SceSulphaNgsConfig *config)
 Fill a Sulpha NGS configuration with the FW 3.60 defaults.
 
SceInt32 sceSulphaNgsGetNeededMemory (const SceSulphaNgsConfig *config, SceSize *size_in_bytes)
 Compute all memory needed by the Sulpha NGS agent and its fixed NGS pools.
 
SceInt32 sceSulphaNgsInit (const SceSulphaNgsConfig *config, void *buffer, SceSize size_in_bytes)
 Initialize Sulpha NGS tracing for the calling process.
 
SceInt32 sceSulphaNgsSetRackName (SceNgsHRack rack_handle, const char *name)
 Assign a diagnostic Sulpha name to an initialized rack.
 
SceInt32 sceSulphaNgsSetSampleName (const void *location, SceSize length, const char *name)
 Associate a diagnostic name with a sample-memory range.
 
SceInt32 sceSulphaNgsSetSynthName (SceNgsHSynSystem synth_handle, const char *name)
 Assign a diagnostic Sulpha name to an initialized NGS system.
 
SceInt32 sceSulphaNgsSetVoiceName (SceNgsHVoice voice_handle, const char *name)
 Assign a diagnostic Sulpha name to an initialized voice.
 
SceInt32 sceSulphaNgsShutdown (void)
 Unregister the Sulpha NGS agent shared by all threads in the process and release its registrations.
 
SceInt32 sceSulphaNgsTrace (const char *message)
 Emit message as a Sulpha trace event in the Ngs category.