vitasdk
Documentation of the vitasdk

Exports for User. More...

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.
 

Variables

void * SceNgsBufferInfo::data
 Buffer base address.
 
SceSize SceNgsBufferInfo::size
 Buffer size in bytes.
 
SceInt32 SceNgsSystemInitParams::max_racks
 Maximum number of racks; must be from 1 through 64.
 
SceInt32 SceNgsSystemInitParams::max_voices
 Maximum number of voices; must be from 1 through 256.
 
SceInt32 SceNgsSystemInitParams::granularity
 Number of samples processed per update; a multiple of 64 from 64 through 512.
 
SceInt32 SceNgsSystemInitParams::sample_rate
 System sample rate; must be 48000 on FW 3.60.
 
SceInt32 SceNgsSystemInitParams::reserved
 Must be at least zero; otherwise ignored on FW 3.60.
 
const SceNgsVoiceDefinition * SceNgsRackDescription::voice_definition
 Immutable definition returned by a sceNgsVoiceDefGet* function.
 
SceInt32 SceNgsRackDescription::voice_count
 Number of voices to allocate; must be greater than zero.
 
SceInt32 SceNgsRackDescription::channels_per_voice
 Audio channels per voice; must be 1 or 2.
 
SceInt32 SceNgsRackDescription::max_patches_per_input
 Patch slots for each dynamic input. Input/mixer racks require a nonzero value.
 
SceInt32 SceNgsRackDescription::patches_per_output
 Patch slots allocated for each voice output.
 
void * SceNgsRackDescription::user_data
 Value delivered to the callback passed to sceNgsRackRelease.
 
SceNgsHVoice SceNgsPatchSetupInfo::source_voice
 Source voice.
 
SceInt32 SceNgsPatchSetupInfo::source_output_index
 Source voice output index.
 
SceInt32 SceNgsPatchSetupInfo::source_output_sub_index
 Source output patch slot, or -1 to use the first free slot.
 
SceNgsHVoice SceNgsPatchSetupInfo::destination_voice
 Destination voice; it must belong to the same system as the source.
 
SceInt32 SceNgsPatchSetupInfo::destination_input_index
 Destination voice input index.
 
SceInt32 SceNgsVoicePreset::name_offset
 Offset of the preset name. Ignored when applying the preset on FW 3.60.
 
SceUInt32 SceNgsVoicePreset::name_length
 Preset-name length. Ignored when applying the preset on FW 3.60.
 
SceInt32 SceNgsVoicePreset::preset_data_offset
 Offset of the variable-length module parameter records, or zero.
 
SceUInt32 SceNgsVoicePreset::preset_data_size
 Size of the module parameter records in bytes.
 
SceInt32 SceNgsVoicePreset::bypass_flags_offset
 Offset of an array of module indices to bypass, or zero.
 
SceUInt32 SceNgsVoicePreset::bypass_flags_count
 Number of module indices in the bypass array.
 
SceNgsHVoice SceNgsCallbackInfo::voice_handle
 Voice associated with the event, or zero for a rack-release event.
 
SceNgsHRack SceNgsCallbackInfo::rack_handle
 Rack associated with the event.
 
SceNgsModuleID SceNgsCallbackInfo::module_id
 Module type associated with a module or parameter event.
 
SceUInt32 SceNgsCallbackInfo::callback_reason
 First module-defined reason value.
 
SceUInt32 SceNgsCallbackInfo::callback_reason2
 Second module-defined reason value.
 
void * SceNgsCallbackInfo::callback_ptr
 Optional module-defined pointer; valid for the duration of the callback.
 
void * SceNgsCallbackInfo::user_data
 User value registered with the callback or rack description.
 
SceNgsParamsID SceNgsParamsDescriptor::id
 
SceSize SceNgsParamsDescriptor::size
 Size beginning at id, including this field and the module-specific data.
 
SceInt32 SceNgsAT9SkipBufferInfo::start_byte_offset
 Byte offset of the first required ATRAC9 packet.
 
SceInt32 SceNgsAT9SkipBufferInfo::num_bytes
 Number of bytes to make available to the decoder.
 
SceInt16 SceNgsAT9SkipBufferInfo::start_skip
 Samples to discard at the start of the first decoded packet.
 
SceInt16 SceNgsAT9SkipBufferInfo::end_skip
 Samples to discard at the end of the last decoded packet.
 
SceInt32 SceNgsAT9SkipBufferInfo::is_super_packet
 1 for the four-frame packet layout, otherwise 0.
 
SceInt32 SceNgsModuleParamHeader::module_index
 Zero-based index in the voice definition.
 
SceInt32 SceNgsModuleParamHeader::channel_index
 Channel to update, or -1 to update every channel represented by the following parameter descriptor.
 
SceFloat32 SceNgsVolumeMatrix::matrix [SCE_NGS_MAX_SYSTEM_CHANNELS][SCE_NGS_MAX_SYSTEM_CHANNELS]
 
SceInt32 SceNgsPatchRouteInfo::output_channels
 Source-rack channel count.
 
SceInt32 SceNgsPatchRouteInfo::input_channels
 Destination-rack channel count.
 
SceNgsVolumeMatrix SceNgsPatchRouteInfo::volume_matrix
 Current output-to-input gain matrix.
 
SceUInt32 SceNgsVoiceInfo::voice_state
 Bitwise OR of SceNgsVoiceState values.
 
SceUInt32 SceNgsVoiceInfo::num_modules
 Number of modules in the voice definition.
 
SceUInt32 SceNgsVoiceInfo::num_inputs
 Number of dynamic input modules in the voice definition.
 
SceUInt32 SceNgsVoiceInfo::num_outputs
 Number of outputs exposed by the voice definition.
 
SceUInt32 SceNgsVoiceInfo::num_patches_per_output
 Patch slots allocated for each output.
 
SceUInt32 SceNgsVoiceInfo::update_passed
 Number of processing updates completed for this voice since its most recent initialization or play.
 
SceUInt32 SceSulphaNgsConfig::max_named_samples
 Maximum sample-memory ranges that can be named; the FW 3.60 default is 1024.
 
SceUInt32 SceSulphaNgsConfig::api_trace_buffer_size
 NGS API-call trace buffer size in bytes; only complete 16-byte records are used. The FW 3.60 default is 4096.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:

#include <psp2/ngs.h>


Link the library to the executable:

SceNgsUser_stub




Data Structure Documentation

◆ SceNgsBufferInfo

struct SceNgsBufferInfo

Buffer owned by the caller and used by NGS in place.

Data Fields
void * data Buffer base address.
SceSize size Buffer size in bytes.

◆ SceNgsSystemInitParams

struct SceNgsSystemInitParams

System sizing and processing configuration.

Data Fields
SceInt32 max_racks Maximum number of racks; must be from 1 through 64.
SceInt32 max_voices Maximum number of voices; must be from 1 through 256.
SceInt32 granularity Number of samples processed per update; a multiple of 64 from 64 through 512.
SceInt32 sample_rate System sample rate; must be 48000 on FW 3.60.
SceInt32 reserved Must be at least zero; otherwise ignored on FW 3.60.

◆ SceNgsRackDescription

struct SceNgsRackDescription

Description used to size and create a rack.

Data Fields
const SceNgsVoiceDefinition * voice_definition Immutable definition returned by a sceNgsVoiceDefGet* function.
SceInt32 voice_count Number of voices to allocate; must be greater than zero.
SceInt32 channels_per_voice Audio channels per voice; must be 1 or 2.
SceInt32 max_patches_per_input Patch slots for each dynamic input. Input/mixer racks require a nonzero value.
SceInt32 patches_per_output Patch slots allocated for each voice output.
void * user_data Value delivered to the callback passed to sceNgsRackRelease.

◆ SceNgsPatchSetupInfo

struct SceNgsPatchSetupInfo

Endpoints used to create one voice-to-voice patch.

Data Fields
SceNgsHVoice source_voice Source voice.
SceInt32 source_output_index Source voice output index.
SceInt32 source_output_sub_index Source output patch slot, or -1 to use the first free slot.
SceNgsHVoice destination_voice Destination voice; it must belong to the same system as the source.
SceInt32 destination_input_index Destination voice input index.

◆ SceNgsVoicePreset

struct SceNgsVoicePreset

Voice preset header.

Offsets are relative to the start of this structure.

Data Fields
SceInt32 name_offset Offset of the preset name. Ignored when applying the preset on FW 3.60.
SceUInt32 name_length Preset-name length. Ignored when applying the preset on FW 3.60.
SceInt32 preset_data_offset Offset of the variable-length module parameter records, or zero.
SceUInt32 preset_data_size Size of the module parameter records in bytes.
SceInt32 bypass_flags_offset Offset of an array of module indices to bypass, or zero.
SceUInt32 bypass_flags_count Number of module indices in the bypass array.

◆ SceNgsCallbackInfo

struct SceNgsCallbackInfo

Information delivered to an NGS callback.

A voice-finished callback receives the voice, rack, and user-data fields. A rack-release callback receives the rack and user-data fields. A module callback additionally receives the module ID, two module-defined reason values, and an optional module-defined pointer. Parameter-range callbacks receive the voice, rack, and module ID; the remaining fields are zero on FW 3.60.

Data Fields
SceNgsHVoice voice_handle Voice associated with the event, or zero for a rack-release event.
SceNgsHRack rack_handle Rack associated with the event.
SceNgsModuleID module_id Module type associated with a module or parameter event.
SceUInt32 callback_reason First module-defined reason value.
SceUInt32 callback_reason2 Second module-defined reason value.
void * callback_ptr Optional module-defined pointer; valid for the duration of the callback.
void * user_data User value registered with the callback or rack description.

◆ SceNgsParamsDescriptor

struct SceNgsParamsDescriptor

Header shared by every module-specific parameter structure.

Data Fields
SceNgsParamsID id
SceSize size Size beginning at id, including this field and the module-specific data.

◆ SceNgsAT9SkipBufferInfo

struct SceNgsAT9SkipBufferInfo

Byte range and samples to skip at each end when decoding an ATRAC9 sample interval.

Data Fields
SceInt32 start_byte_offset Byte offset of the first required ATRAC9 packet.
SceInt32 num_bytes Number of bytes to make available to the decoder.
SceInt16 start_skip Samples to discard at the start of the first decoded packet.
SceInt16 end_skip Samples to discard at the end of the last decoded packet.
SceInt32 is_super_packet 1 for the four-frame packet layout, otherwise 0.

◆ SceNgsModuleParamHeader

struct SceNgsModuleParamHeader

Header of one record accepted by sceNgsVoiceSetParamsBlock.

Data Fields
SceInt32 module_index Zero-based index in the voice definition.
SceInt32 channel_index Channel to update, or -1 to update every channel represented by the following parameter descriptor.

◆ SceNgsVolumeMatrix

struct SceNgsVolumeMatrix

Gain matrix indexed as matrix[outputChannel][inputChannel].

Data Fields
SceFloat32 matrix[SCE_NGS_MAX_SYSTEM_CHANNELS][SCE_NGS_MAX_SYSTEM_CHANNELS]

◆ SceNgsPatchRouteInfo

struct SceNgsPatchRouteInfo

Current route and gain information returned by sceNgsPatchGetInfo.

Data Fields
SceInt32 output_channels Source-rack channel count.
SceInt32 input_channels Destination-rack channel count.
SceNgsVolumeMatrix volume_matrix Current output-to-input gain matrix.

◆ SceNgsVoiceInfo

struct SceNgsVoiceInfo

Current voice and voice-definition information.

Data Fields
SceUInt32 voice_state Bitwise OR of SceNgsVoiceState values.
SceUInt32 num_modules Number of modules in the voice definition.
SceUInt32 num_inputs Number of dynamic input modules in the voice definition.
SceUInt32 num_outputs Number of outputs exposed by the voice definition.
SceUInt32 num_patches_per_output Patch slots allocated for each output.
SceUInt32 update_passed Number of processing updates completed for this voice since its most recent initialization or play.

◆ SceSulphaNgsConfig

struct SceSulphaNgsConfig

Sulpha NGS trace-agent capacities.

Data Fields
SceUInt32 max_named_samples Maximum sample-memory ranges that can be named; the FW 3.60 default is 1024.
SceUInt32 api_trace_buffer_size NGS API-call trace buffer size in bytes; only complete 16-byte records are used. The FW 3.60 default is 4096.

Macro Definition Documentation

◆ SCE_NGS_MAX_SYSTEM_CHANNELS

#define SCE_NGS_MAX_SYSTEM_CHANNELS   2

Typedef Documentation

◆ SceNgsVoiceDefinition

Opaque immutable voice definition.

On FW 3.60, this pointer holds an encoded value, not an address. Do not dereference it; store it in SceNgsRackDescription::voice_definition.

Enumeration Type Documentation

◆ SceNgsErrorCode

Error codes returned by the FW 3.60 NGS implementation.

Enumerator
SCE_NGS_OK 
SCE_NGS_ERROR 
SCE_NGS_ERROR_INVALID_PARAM 
SCE_NGS_ERROR_INVALID_ALIGNMENT 
SCE_NGS_ERROR_NOT_IMPL 
SCE_NGS_ERROR_DEPENDENCY 
SCE_NGS_ERROR_OUT_OF_ASSETS 
SCE_NGS_ERROR_MODULE_NOT_AVAIL 
SCE_NGS_ERROR_RESOURCE_LOCKED 
SCE_NGS_ERROR_PARAM_OUT_OF_RANGE 
SCE_NGS_ERROR_INVALID_VOICE_TYPE 
SCE_NGS_ERROR_SYSTEM_MISMATCH 
SCE_NGS_ERROR_INVALID_HANDLE 
SCE_NGS_ERROR_SIZE_MISMATCH 
SCE_NGS_ERROR_PATCH_NOT_AVAIL 
SCE_NGS_ERROR_PARAM_TYPE_MISMATCH 
SCE_NGS_ERROR_INVALID_STATE 
SCE_NGS_ERROR_INTERNAL_ALLOC 
SCE_NGS_ERROR_INTERNAL_PROCESSING 
SCE_NGS_ERROR_INVALID_BUFFER 

◆ SceNgsSystemFlag

Flags accepted by sceNgsSystemSetFlags.

Enumerator
SCE_NGS_SYSTEM_FLAG_CHECK_PARAMS 

Validate parameter ranges when parameter blocks are unlocked or applied.

◆ SceNgsVoiceInitFlag

Reset operations selected by sceNgsVoiceInit.

Enumerator
SCE_NGS_VOICE_INIT_BASE 
SCE_NGS_VOICE_INIT_ROUTING 

Remove every input and output patch connected to the voice.

SCE_NGS_VOICE_INIT_PRESET 

Apply the supplied preset, or the voice definition's default preset when it is NULL.

SCE_NGS_VOICE_INIT_CALLBACKS 

Clear the module and voice-finished callbacks.

SCE_NGS_VOICE_INIT_ALL 

◆ SceNgsVoiceState

Bitfield reported by SceNgsVoiceInfo::voice_state.

Enumerator
SCE_NGS_VOICE_STATE_AVAILABLE 
SCE_NGS_VOICE_STATE_ACTIVE 
SCE_NGS_VOICE_STATE_FINALIZE 
SCE_NGS_VOICE_STATE_UNLOADING 
SCE_NGS_VOICE_STATE_PENDING 
SCE_NGS_VOICE_STATE_PAUSED 
SCE_NGS_VOICE_STATE_KEY_OFF 

◆ SceNgsModuleBypassFlag

Values accepted and returned by the module-bypass functions.

Enumerator
SCE_NGS_MODULE_FLAG_NOT_BYPASSED 
SCE_NGS_MODULE_FLAG_BYPASSED 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/13]

VITASDK_BUILD_ASSERT_EQ ( 0x8  ,
SceNgsBufferInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/13]

VITASDK_BUILD_ASSERT_EQ ( 0x14  ,
SceNgsSystemInitParams   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/13]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceNgsRackDescription   
)

◆ VITASDK_BUILD_ASSERT_EQ() [4/13]

VITASDK_BUILD_ASSERT_EQ ( 0x14  ,
SceNgsPatchSetupInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [5/13]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceNgsVoicePreset   
)

◆ VITASDK_BUILD_ASSERT_EQ() [6/13]

VITASDK_BUILD_ASSERT_EQ ( 0x1C  ,
SceNgsCallbackInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [7/13]

VITASDK_BUILD_ASSERT_EQ ( 0x8  ,
SceNgsParamsDescriptor   
)

◆ VITASDK_BUILD_ASSERT_EQ() [8/13]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceNgsAT9SkipBufferInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [9/13]

VITASDK_BUILD_ASSERT_EQ ( 0x8  ,
SceNgsModuleParamHeader   
)

◆ VITASDK_BUILD_ASSERT_EQ() [10/13]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceNgsVolumeMatrix   
)

◆ VITASDK_BUILD_ASSERT_EQ() [11/13]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceNgsPatchRouteInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [12/13]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceNgsVoiceInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [13/13]

VITASDK_BUILD_ASSERT_EQ ( 0x8  ,
SceSulphaNgsConfig   
)

◆ sceNgsAT9GetSectionDetails()

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.

The output is cleared before validation. FW 3.60 accepts ATRAC9 frame-duration codes 1, 4, and 7 and requires the low byte of config_data to be 0xFE. Bit 31 of start_sample_offset requests one frame of decoder preroll; the remaining 31 bits contain the sample offset and are backed up by 64, 128, or 256 samples according to the frame-duration code, clamped at zero.

Parameters
[in]start_sample_offset- First requested decoded sample.
[in]num_samples- Number of requested samples; must be at least zero.
[in]config_data- Packed ATRAC9 configuration word.
[out]at9_info_buffer- Receives the required byte range and sample skips.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsModuleGetNumPresets()

SceInt32 sceNgsModuleGetNumPresets ( SceNgsHSynSystem  system_handle,
SceNgsModuleID  module_id,
SceUInt32 *  num_presets 
)

Return the number of built-in presets provided by a module type.

Parameters
[in]system_handle- Initialized system handle.
[in]module_id- Module type ID, not a module index in a voice.
[out]num_presets- Receives the preset count.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsModuleGetPreset()

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.

Initialize both members of params_buffer before the call. Its data buffer must be large enough for the selected preset; the function does not allocate memory or change the buffer-size member.

Parameters
[in]system_handle- Initialized system handle.
[in]module_id- Module type ID, not a module index in a voice.
[in]preset_index- Zero-based preset index.
[in,out]params_buffer- Destination pointer and capacity in bytes.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsPatchCreateRouting()

SceInt32 sceNgsPatchCreateRouting ( const SceNgsPatchSetupInfo *  patch_info,
SceNgsHPatch *  patch_handle 
)

Create a route from one voice output to one voice input.

Both voices must belong to the same system. A source sub-index of -1 selects the first free patch slot. The route is initialized with zero gains. NGS rejects a route that would create a dependency cycle it cannot process.

Parameters
[in]patch_info- Source and destination endpoints.
[out]patch_handle- Receives the new patch handle.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsPatchGetInfo()

SceInt32 sceNgsPatchGetInfo ( SceNgsHPatch  patch_handle,
SceNgsPatchRouteInfo *  route_info,
SceNgsPatchSetupInfo *  setup 
)

Get the current source/destination channel counts and gains of a patch.

Parameters
[in]patch_handle- Patch handle.
[out]route_info- Receives current channel counts and matrix information.
[out]setup- Optional destination for the original patch setup.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsPatchRemoveRouting()

SceInt32 sceNgsPatchRemoveRouting ( SceNgsHPatch  patch_handle)

Remove a voice-to-voice patch and release its source output slot.

Parameters
[in]patch_handle- Patch handle to remove.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsRackGetRequiredMemorySize()

SceInt32 sceNgsRackGetRequiredMemorySize ( SceNgsHSynSystem  system_handle,
const SceNgsRackDescription *  rack_desc,
SceSize *  size 
)

Compute the rack-buffer size required for a description.

Parameters
[in]system_handle- System that will own the rack.
[in]rack_desc- Rack description.
[out]size- Receives the required number of bytes.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsRackGetVoiceHandle()

SceInt32 sceNgsRackGetVoiceHandle ( SceNgsHRack  rack_handle,
SceUInt32  index,
SceNgsHVoice *  voice_handle 
)

Return one voice allocated by a rack.

Parameters
[in]rack_handle- Initialized rack handle.
[in]index- Zero-based voice index, less than the rack's voice count.
[out]voice_handle- Receives the voice handle.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsRackInit()

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.

The buffer base must be 16-byte aligned and its capacity must be at least the value returned by sceNgsRackGetRequiredMemorySize. NGS retains and modifies this memory until the rack has been released. Initialization uses one rack slot and SceNgsRackDescription::voice_count voice slots from the system limits.

Parameters
[in]system_handle- Owning system handle.
[in]rack_buffer- Rack buffer pointer and capacity.
[in]rack_desc- Rack configuration and allocation limits.
[out]rack_handle- Receives the rack handle.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsRackRelease()

SceInt32 sceNgsRackRelease ( SceNgsHRack  rack_handle,
SceNgsRackReleaseCallbackFunc  callback_func_ptr 
)

Stop every voice, remove every connected patch, and release a rack.

With a NULL callback, the rack is released before this function returns. With a callback, a later sceNgsSystemUpdate completes the release, and the callback receives the rack and SceNgsRackDescription::user_data.

Parameters
[in]rack_handle- Rack to release.
[in]callback_func_ptr- Optional asynchronous completion callback.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsRackSetParamErrorCallback()

SceInt32 sceNgsRackSetParamErrorCallback ( SceNgsHRack  rack_handle,
SceNgsParamsErrorCallbackFunc  callback_func_ptr 
)

Set the parameter-range callback for one rack.

This callback takes precedence over the system-wide callback and is invoked by sceNgsSystemUpdate on the thread that calls it.

Parameters
[in]rack_handle- Rack handle.
[in]callback_func_ptr- Callback, or NULL to clear it.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemGetRequiredMemorySize()

SceInt32 sceNgsSystemGetRequiredMemorySize ( const SceNgsSystemInitParams *  synth_params,
SceSize *  size 
)

Compute the system-buffer size required by an initialization configuration.

Parameters
[in]synth_params- System limits and processing configuration.
[out]size- Receives the required number of bytes.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemInit()

SceInt32 sceNgsSystemInit ( void *  synth_sys_memory,
SceSize  mem_size,
const SceNgsSystemInitParams *  synth_params,
SceNgsHSynSystem *  system_handle 
)

Initialize an NGS system in caller-owned memory.

The memory base must be 16-byte aligned and the size must be at least the result of sceNgsSystemGetRequiredMemorySize. FW 3.60 permits at most eight simultaneous systems in one process and initializes each system with SCE_NGS_SYSTEM_FLAG_CHECK_PARAMS enabled.

Parameters
[in,out]synth_sys_memory- Memory retained and modified by NGS until release.
[in]mem_size- Available bytes at synth_sys_memory.
[in]synth_params- System limits and processing configuration.
[out]system_handle- Receives the initialized system handle.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemLock()

SceInt32 sceNgsSystemLock ( SceNgsHSynSystem  system_handle)

Lock the system's internal update state.

Pair each call with a call to sceNgsSystemUnlock.

Parameters
[in]system_handle- System to lock.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemRelease()

SceInt32 sceNgsSystemRelease ( SceNgsHSynSystem  system_handle)

Release a system after all of its racks have been released.

Parameters
[in]system_handle- System to release.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemSetFlags()

SceInt32 sceNgsSystemSetFlags ( SceNgsHSynSystem  system_handle,
SceUInt32  system_flags 
)

Replace the system flags used by subsequent parameter operations.

Parameters
[in]system_handle- System handle.
[in]system_flags- Bitwise OR of SceNgsSystemFlag values.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemSetParamErrorCallback()

SceInt32 sceNgsSystemSetParamErrorCallback ( SceNgsHSynSystem  system_handle,
SceNgsParamsErrorCallbackFunc  callback_func_ptr 
)

Set the fallback parameter-range callback for a system.

Parameters
[in]system_handle- System handle.
[in]callback_func_ptr- Callback, or NULL to clear it.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemUnlock()

SceInt32 sceNgsSystemUnlock ( SceNgsHSynSystem  system_handle)

Unlock a system previously locked with sceNgsSystemLock.

Parameters
[in]system_handle- System to unlock.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsSystemUpdate()

SceInt32 sceNgsSystemUpdate ( SceNgsHSynSystem  system_handle)

Process one audio grain and run every queued callback.

Callback functions execute synchronously on the thread calling this function, after the kernel-side processing update has completed.

Parameters
[in]system_handle- System to update.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceBypassModule()

SceInt32 sceNgsVoiceBypassModule ( SceNgsHVoice  voice_handle,
SceUInt32  module,
SceUInt32  bypass_flag 
)

Set the bypass state of one module in a voice definition.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index, not a SceNgsModuleID.
[in]bypass_flag- One of SceNgsModuleBypassFlag.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceDefGetAtrac9Voice()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetAtrac9Voice ( void  )

Return the complex ATRAC9 playback voice definition with four sends.

◆ sceNgsVoiceDefGetCompressorBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetCompressorBuss ( void  )

Return an input-mix, compressor, and output bus definition.

◆ sceNgsVoiceDefGetCompressorSideChainBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetCompressorSideChainBuss ( void  )

Return a two-input side-chain compressor bus definition.

◆ sceNgsVoiceDefGetDelayBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetDelayBuss ( void  )

Return an input-mix, modulated-delay, and output bus definition.

◆ sceNgsVoiceDefGetDistortionBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetDistortionBuss ( void  )

Return an input-mix, distortion, and output bus definition.

◆ sceNgsVoiceDefGetEnvelopeBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetEnvelopeBuss ( void  )

Return an input-mix, amplitude-envelope, and output bus definition.

◆ sceNgsVoiceDefGetEqBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetEqBuss ( void  )

Return an input-mix, four-band parametric-EQ, and output bus definition.

◆ sceNgsVoiceDefGetMasterBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetMasterBuss ( void  )

Return the master bus definition that exposes PCM output to the caller.

◆ sceNgsVoiceDefGetMixerBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetMixerBuss ( void  )

Return a bus definition that mixes multiple input voices.

◆ sceNgsVoiceDefGetPauserBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetPauserBuss ( void  )

Return an input-mix, click-free pauser, and output bus definition.

◆ sceNgsVoiceDefGetPitchShiftBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetPitchShiftBuss ( void  )

Return an input-mix, pitch-shift, and output bus definition.

◆ sceNgsVoiceDefGetReverbBuss()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetReverbBuss ( void  )

Return an input-mix, environmental-reverb, and output bus definition.

◆ sceNgsVoiceDefGetSasEmuVoice()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetSasEmuVoice ( void  )

Return the libSas-emulation voice definition.

◆ sceNgsVoiceDefGetScreamAtrac9Voice()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetScreamAtrac9Voice ( void  )

Return the Scream ATRAC9 playback voice definition.

◆ sceNgsVoiceDefGetScreamVoice()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetScreamVoice ( void  )

Return the Scream waveform playback voice definition.

◆ sceNgsVoiceDefGetSimpleAtrac9Voice()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetSimpleAtrac9Voice ( void  )

Return the basic ATRAC9 playback voice definition with two sends.

◆ sceNgsVoiceDefGetSimpleVoice()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetSimpleVoice ( void  )

Return the basic PCM/VAG playback voice definition with two sends.

◆ sceNgsVoiceDefGetTemplate1()

const SceNgsVoiceDefinition * sceNgsVoiceDefGetTemplate1 ( void  )

Return the complex waveform playback template with signal generation and four sends.

◆ sceNgsVoiceGetInfo()

SceInt32 sceNgsVoiceGetInfo ( SceNgsHVoice  voice_handle,
SceNgsVoiceInfo *  info 
)

Get one voice's current key state, module counts, and routing information.

Parameters
[in]voice_handle- Voice handle.
[out]info- Receives the voice snapshot.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceGetModuleBypass()

SceInt32 sceNgsVoiceGetModuleBypass ( SceNgsHVoice  voice_handle,
SceUInt32  module,
SceUInt32 *  bypass_flag 
)

Get the bypass state of one module.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index.
[out]bypass_flag- Receives one of SceNgsModuleBypassFlag.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceGetModuleType()

SceInt32 sceNgsVoiceGetModuleType ( SceNgsHVoice  voice_handle,
SceUInt32  module,
SceNgsModuleID *  module_type 
)

Map a zero-based module index to its module type ID.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index.
[out]module_type- Receives the SceNgsModuleID.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceGetOutputPatch()

SceInt32 sceNgsVoiceGetOutputPatch ( SceNgsHVoice  voice_handle,
SceInt32  output_index,
SceInt32  sub_index,
SceNgsHPatch *  patch_handle 
)

Return the patch occupying one voice output slot.

Parameters
[in]voice_handle- Source voice handle.
[in]output_index- Zero-based output index.
[in]sub_index- Zero-based patch slot within that output.
[out]patch_handle- Receives the patch handle, or zero when the slot is empty.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceGetParamsOutOfRange()

SceInt32 sceNgsVoiceGetParamsOutOfRange ( SceNgsHVoice  voice_handle,
SceUInt32  module,
char *  message_buffer 
)

Format the most recent parameter-range result for one module.

The destination must provide at least 128 bytes. The resulting string is either a module mismatch/range diagnostic or No value was out of range\n.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index.
[out]message_buffer- Writable 128-byte string buffer.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceGetStateData()

SceInt32 sceNgsVoiceGetStateData ( SceNgsHVoice  voice_handle,
SceUInt32  module,
void *  memory,
SceSize  mem_size 
)

Copy one module's runtime state snapshot.

The requested size must exactly match that module's state-data size; otherwise SCE_NGS_ERROR_SIZE_MISMATCH is returned.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index.
[out]memory- Destination buffer.
[in]mem_size- Exact module state-data size in bytes.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceInit()

SceInt32 sceNgsVoiceInit ( SceNgsHVoice  voice_handle,
const SceNgsVoicePreset *  preset,
SceUInt32  init_flags 
)

Reinitialize a stopped voice and optionally reset patches, preset, or callbacks.

The voice must not be playing or keyed off. Bits outside SceNgsVoiceInitFlag are ignored on FW 3.60.

Parameters
[in]voice_handle- Voice to initialize.
[in]preset- Optional preset selected by SCE_NGS_VOICE_INIT_PRESET.
[in]init_flags- Bitwise OR of SceNgsVoiceInitFlag values.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceKeyOff()

SceInt32 sceNgsVoiceKeyOff ( SceNgsHVoice  voice_handle)

Request release/envelope processing for a playing voice.

This changes the key state from playing to keyed off; processing continues until the voice finishes or is killed.

Parameters
[in]voice_handle- Playing voice to key off.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceKill()

SceInt32 sceNgsVoiceKill ( SceNgsHVoice  voice_handle)

Immediately stop a playing or keyed-off voice and return it to the stopped state.

Parameters
[in]voice_handle- Voice to stop.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceLockParams()

SceInt32 sceNgsVoiceLockParams ( SceNgsHVoice  voice_handle,
SceUInt32  module,
SceNgsParamsID  params_interface_id,
SceNgsBufferInfo *  params_buffer 
)

Lock and expose one module's live parameter block.

Only one lock for a module may be active at a time. The returned pointer refers directly to the rack buffer and remains valid until the rack is released, but changes are committed by sceNgsVoiceUnlockParams.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index.
[in]params_interface_id- Expected parameter-interface ID; FW 3.60 compares its low 16 bits.
[out]params_buffer- Receives the live parameter pointer and size.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoicePatchSetVolume()

SceInt32 sceNgsVoicePatchSetVolume ( SceNgsHPatch  patch_handle,
SceInt32  output_channel,
SceInt32  input_channel,
SceFloat32  volume 
)

Set one gain in a patch's [output][input] matrix.

Parameters
[in]patch_handle- Patch handle.
[in]output_channel- Output channel, less than the source channel count.
[in]input_channel- Destination input channel; must be 0 or 1.
[in]volume- Linear gain stored without clamping on FW 3.60.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoicePatchSetVolumes()

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.

Parameters
[in]patch_handle- Patch handle.
[in]output_channel- Output row to replace.
[in]volumes- Array containing volume_count gains.
[in]volume_count- Number of gains; valid callers use 1 or 2.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoicePatchSetVolumesMatrix()

SceInt32 sceNgsVoicePatchSetVolumesMatrix ( SceNgsHPatch  patch_handle,
const SceNgsVolumeMatrix *  matrix 
)

Replace a patch's complete 2x2 output-to-input gain matrix.

A mono source uses only the first row; a stereo source uses all four values.

Parameters
[in]patch_handle- Patch handle.
[in]matrix- Replacement gain matrix.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoicePause()

SceInt32 sceNgsVoicePause ( SceNgsHVoice  voice_handle)

Pause voice processing without changing whether the voice is playing or keyed off.

Parameters
[in]voice_handle- Voice to pause.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoicePlay()

SceInt32 sceNgsVoicePlay ( SceNgsHVoice  voice_handle)

Start a stopped voice.

A voice must be initialized before it can be played.

Parameters
[in]voice_handle- Voice to start.
Returns
0 on success, or SCE_NGS_ERROR_INVALID_STATE if it is not stopped.

◆ sceNgsVoiceResume()

SceInt32 sceNgsVoiceResume ( SceNgsHVoice  voice_handle)

Resume a paused voice without changing its play/key-off state.

Parameters
[in]voice_handle- Voice to resume.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceSetFinishedCallback()

SceInt32 sceNgsVoiceSetFinishedCallback ( SceNgsHVoice  voice_handle,
SceNgsCallbackFunc  callback_func_ptr,
void *  user_data 
)

Set the callback queued when a voice reaches its finished state.

The callback runs from sceNgsSystemUpdate and receives user_data through SceNgsCallbackInfo::user_data.

Parameters
[in]voice_handle- Voice handle.
[in]callback_func_ptr- Callback, or NULL to clear it.
[in]user_data- Opaque value returned to the callback.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceSetModuleCallback()

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.

The callback runs from sceNgsSystemUpdate. Its reason and data fields are defined by the selected module type.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index.
[in]callback_func_ptr- Callback, or NULL to clear it.
[in]user_data- Opaque value returned to the callback.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceSetParamsBlock()

SceInt32 sceNgsVoiceSetParamsBlock ( SceNgsHVoice  voice_handle,
const SceNgsModuleParamHeader *  param_data,
SceSize  size,
SceInt32 *  error_count 
)

Apply a packed sequence of module parameter records.

Valid records are applied even when another record fails. If non-NULL, error_count receives the number of rejected records.

Parameters
[in]voice_handle- Voice handle.
[in]param_data- First packed record header. Each header is followed by a SceNgsParamsDescriptor and its module-specific data.
[in]size- Total byte size of the record sequence.
[out]error_count- Optional rejected-record count.
Returns
0 when every record is valid, or the error encountered while parsing or applying a record.

◆ sceNgsVoiceSetPreset()

SceInt32 sceNgsVoiceSetPreset ( SceNgsHVoice  voice_handle,
const SceNgsVoicePreset *  voice_preset 
)

Restore module defaults, then apply an optional voice preset.

A NULL preset restores the definition's module defaults and clears the preset bypass list. The voice does not have to be stopped, but locked parameter interfaces cause SCE_NGS_ERROR_RESOURCE_LOCKED.

Parameters
[in]voice_handle- Voice handle.
[in]voice_preset- Preset to apply, or NULL for module defaults.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceNgsVoiceUnlockParams()

SceInt32 sceNgsVoiceUnlockParams ( SceNgsHVoice  voice_handle,
SceUInt32  module 
)

Commit and unlock a module parameter block returned by sceNgsVoiceLockParams.

When SCE_NGS_SYSTEM_FLAG_CHECK_PARAMS is set, invalid values are rejected and the module is not marked as changed for processing.

Parameters
[in]voice_handle- Voice handle.
[in]module- Zero-based module index previously locked.
Returns
0 on success, or a negative SceNgsErrorCode value.

◆ sceSulphaNgsGetDefaultConfig()

SceInt32 sceSulphaNgsGetDefaultConfig ( SceSulphaNgsConfig *  config)

Fill a Sulpha NGS configuration with the FW 3.60 defaults.

Parameters
[out]config- Receives limits of 1024 named sample-memory ranges and a 4096-byte API-call trace buffer.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsGetNeededMemory()

SceInt32 sceSulphaNgsGetNeededMemory ( const SceSulphaNgsConfig *  config,
SceSize *  size_in_bytes 
)

Compute all memory needed by the Sulpha NGS agent and its fixed NGS pools.

Parameters
[in]config- Sulpha NGS capacities.
[out]size_in_bytes- Receives the required byte count.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsInit()

SceInt32 sceSulphaNgsInit ( const SceSulphaNgsConfig *  config,
void *  buffer,
SceSize  size_in_bytes 
)

Initialize Sulpha NGS tracing for the calling process.

All threads in the process share this tracing agent. The supplied memory must remain valid until sceSulphaNgsShutdown. Use sceSulphaNgsGetNeededMemory rather than relying on the implementation's check, which accepts a smaller minimum size.

Parameters
[in]config- Sulpha NGS capacities.
[in,out]buffer- Caller-owned tracing memory.
[in]size_in_bytes- Available bytes in buffer.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsSetRackName()

SceInt32 sceSulphaNgsSetRackName ( SceNgsHRack  rack_handle,
const char *  name 
)

Assign a diagnostic Sulpha name to an initialized rack.

Parameters
[in]rack_handle- Rack handle.
[in]name- Diagnostic name forwarded to Sulpha.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsSetSampleName()

SceInt32 sceSulphaNgsSetSampleName ( const void *  location,
SceSize  length,
const char *  name 
)

Associate a diagnostic name with a sample-memory range.

Parameters
[in]location- Non-NULL sample-data address.
[in]length- Nonzero sample-data size in bytes.
[in]name- Diagnostic name forwarded to Sulpha.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsSetSynthName()

SceInt32 sceSulphaNgsSetSynthName ( SceNgsHSynSystem  synth_handle,
const char *  name 
)

Assign a diagnostic Sulpha name to an initialized NGS system.

Parameters
[in]synth_handle- System handle.
[in]name- Diagnostic name forwarded to Sulpha.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsSetVoiceName()

SceInt32 sceSulphaNgsSetVoiceName ( SceNgsHVoice  voice_handle,
const char *  name 
)

Assign a diagnostic Sulpha name to an initialized voice.

Parameters
[in]voice_handle- Voice handle.
[in]name- Diagnostic name forwarded to Sulpha.
Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsShutdown()

SceInt32 sceSulphaNgsShutdown ( void  )

Unregister the Sulpha NGS agent shared by all threads in the process and release its registrations.

Returns
0 on success, or a negative Sulpha error code.

◆ sceSulphaNgsTrace()

SceInt32 sceSulphaNgsTrace ( const char *  message)

Emit message as a Sulpha trace event in the Ngs category.

Parameters
[in]message- Literal message; it is passed through a s format.
Returns
0 on success, or a negative Sulpha error code.

Variable Documentation

◆ data

void* SceNgsBufferInfo::data

Buffer base address.

◆ size [1/2]

SceSize SceNgsBufferInfo::size

Buffer size in bytes.

◆ max_racks

SceInt32 SceNgsSystemInitParams::max_racks

Maximum number of racks; must be from 1 through 64.

◆ max_voices

SceInt32 SceNgsSystemInitParams::max_voices

Maximum number of voices; must be from 1 through 256.

◆ granularity

SceInt32 SceNgsSystemInitParams::granularity

Number of samples processed per update; a multiple of 64 from 64 through 512.

◆ sample_rate

SceInt32 SceNgsSystemInitParams::sample_rate

System sample rate; must be 48000 on FW 3.60.

◆ reserved

SceInt32 SceNgsSystemInitParams::reserved

Must be at least zero; otherwise ignored on FW 3.60.

◆ voice_definition

const SceNgsVoiceDefinition* SceNgsRackDescription::voice_definition

Immutable definition returned by a sceNgsVoiceDefGet* function.

◆ voice_count

SceInt32 SceNgsRackDescription::voice_count

Number of voices to allocate; must be greater than zero.

◆ channels_per_voice

SceInt32 SceNgsRackDescription::channels_per_voice

Audio channels per voice; must be 1 or 2.

◆ max_patches_per_input

SceInt32 SceNgsRackDescription::max_patches_per_input

Patch slots for each dynamic input. Input/mixer racks require a nonzero value.

◆ patches_per_output

SceInt32 SceNgsRackDescription::patches_per_output

Patch slots allocated for each voice output.

◆ user_data [1/2]

void* SceNgsRackDescription::user_data

Value delivered to the callback passed to sceNgsRackRelease.

◆ source_voice

SceNgsHVoice SceNgsPatchSetupInfo::source_voice

Source voice.

◆ source_output_index

SceInt32 SceNgsPatchSetupInfo::source_output_index

Source voice output index.

◆ source_output_sub_index

SceInt32 SceNgsPatchSetupInfo::source_output_sub_index

Source output patch slot, or -1 to use the first free slot.

◆ destination_voice

SceNgsHVoice SceNgsPatchSetupInfo::destination_voice

Destination voice; it must belong to the same system as the source.

◆ destination_input_index

SceInt32 SceNgsPatchSetupInfo::destination_input_index

Destination voice input index.

◆ name_offset

SceInt32 SceNgsVoicePreset::name_offset

Offset of the preset name. Ignored when applying the preset on FW 3.60.

◆ name_length

SceUInt32 SceNgsVoicePreset::name_length

Preset-name length. Ignored when applying the preset on FW 3.60.

◆ preset_data_offset

SceInt32 SceNgsVoicePreset::preset_data_offset

Offset of the variable-length module parameter records, or zero.

◆ preset_data_size

SceUInt32 SceNgsVoicePreset::preset_data_size

Size of the module parameter records in bytes.

◆ bypass_flags_offset

SceInt32 SceNgsVoicePreset::bypass_flags_offset

Offset of an array of module indices to bypass, or zero.

◆ bypass_flags_count

SceUInt32 SceNgsVoicePreset::bypass_flags_count

Number of module indices in the bypass array.

◆ voice_handle

SceNgsHVoice SceNgsCallbackInfo::voice_handle

Voice associated with the event, or zero for a rack-release event.

◆ rack_handle

SceNgsHRack SceNgsCallbackInfo::rack_handle

Rack associated with the event.

◆ module_id

SceNgsModuleID SceNgsCallbackInfo::module_id

Module type associated with a module or parameter event.

◆ callback_reason

SceUInt32 SceNgsCallbackInfo::callback_reason

First module-defined reason value.

◆ callback_reason2

SceUInt32 SceNgsCallbackInfo::callback_reason2

Second module-defined reason value.

◆ callback_ptr

void* SceNgsCallbackInfo::callback_ptr

Optional module-defined pointer; valid for the duration of the callback.

◆ user_data [2/2]

void* SceNgsCallbackInfo::user_data

User value registered with the callback or rack description.

◆ id

SceNgsParamsID SceNgsParamsDescriptor::id

◆ size [2/2]

SceSize SceNgsParamsDescriptor::size

Size beginning at id, including this field and the module-specific data.

◆ start_byte_offset

SceInt32 SceNgsAT9SkipBufferInfo::start_byte_offset

Byte offset of the first required ATRAC9 packet.

◆ num_bytes

SceInt32 SceNgsAT9SkipBufferInfo::num_bytes

Number of bytes to make available to the decoder.

◆ start_skip

SceInt16 SceNgsAT9SkipBufferInfo::start_skip

Samples to discard at the start of the first decoded packet.

◆ end_skip

SceInt16 SceNgsAT9SkipBufferInfo::end_skip

Samples to discard at the end of the last decoded packet.

◆ is_super_packet

SceInt32 SceNgsAT9SkipBufferInfo::is_super_packet

1 for the four-frame packet layout, otherwise 0.

◆ module_index

SceInt32 SceNgsModuleParamHeader::module_index

Zero-based index in the voice definition.

◆ channel_index

SceInt32 SceNgsModuleParamHeader::channel_index

Channel to update, or -1 to update every channel represented by the following parameter descriptor.

◆ matrix

◆ output_channels

SceInt32 SceNgsPatchRouteInfo::output_channels

Source-rack channel count.

◆ input_channels

SceInt32 SceNgsPatchRouteInfo::input_channels

Destination-rack channel count.

◆ volume_matrix

SceNgsVolumeMatrix SceNgsPatchRouteInfo::volume_matrix

Current output-to-input gain matrix.

◆ voice_state

SceUInt32 SceNgsVoiceInfo::voice_state

Bitwise OR of SceNgsVoiceState values.

◆ num_modules

SceUInt32 SceNgsVoiceInfo::num_modules

Number of modules in the voice definition.

◆ num_inputs

SceUInt32 SceNgsVoiceInfo::num_inputs

Number of dynamic input modules in the voice definition.

◆ num_outputs

SceUInt32 SceNgsVoiceInfo::num_outputs

Number of outputs exposed by the voice definition.

◆ num_patches_per_output

SceUInt32 SceNgsVoiceInfo::num_patches_per_output

Patch slots allocated for each output.

◆ update_passed

SceUInt32 SceNgsVoiceInfo::update_passed

Number of processing updates completed for this voice since its most recent initialization or play.

◆ max_named_samples

SceUInt32 SceSulphaNgsConfig::max_named_samples

Maximum sample-memory ranges that can be named; the FW 3.60 default is 1024.

◆ api_trace_buffer_size

SceUInt32 SceSulphaNgsConfig::api_trace_buffer_size

NGS API-call trace buffer size in bytes; only complete 16-byte records are used. The FW 3.60 default is 4096.