15#define SCE_NGS_MAX_SYSTEM_CHANNELS 2
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
void * buffer
Definition bt.h:6
uint32_t length
Definition bt.h:7
void * user_data
Definition lsdb.h:7
SceSize size
Definition lsdb.h:11
SceNgsCallbackFunc SceNgsRackReleaseCallbackFunc
Definition ngs_internal.h:46
SceUInt32 SceNgsParamsID
Definition ngs_internal.h:29
SceUInt32 SceNgsHSynSystem
Opaque system handle valid only in the calling process.
Definition ngs_internal.h:21
void(* SceNgsCallbackFunc)(const SceNgsCallbackInfo *callback_info)
Definition ngs_internal.h:44
SceUInt32 SceNgsHRack
Opaque rack handle valid only in the calling process.
Definition ngs_internal.h:17
SceNgsCallbackFunc SceNgsParamsErrorCallbackFunc
Definition ngs_internal.h:48
SceUInt32 SceNgsModuleID
Definition ngs_internal.h:27
SceUInt32 SceNgsHVoice
Opaque voice handle valid only in the calling process.
Definition ngs_internal.h:23
SceNgsCallbackFunc SceNgsModuleCallbackFunc
Definition ngs_internal.h:47
SceUInt32 SceNgsHPatch
Opaque patch handle valid only in the calling process.
Definition ngs_internal.h:19
SceNgsVoiceState
Bitfield reported by SceNgsVoiceInfo::voice_state.
Definition ngs.h:141
SceInt32 sceNgsSystemInit(void *synth_sys_memory, SceSize mem_size, const SceNgsSystemInitParams *synth_params, SceNgsHSynSystem *system_handle)
Initialize an NGS system in caller-owned memory.
SceInt16 end_skip
Samples to discard at the end of the last decoded packet.
Definition ngs.h:162
SceInt32 sceNgsVoiceUnlockParams(SceNgsHVoice voice_handle, SceUInt32 module)
Commit and unlock a module parameter block returned by sceNgsVoiceLockParams.
SceInt32 sceNgsSystemSetParamErrorCallback(SceNgsHSynSystem system_handle, SceNgsParamsErrorCallbackFunc callback_func_ptr)
Set the fallback parameter-range callback for a system.
void * user_data
User value registered with the callback or rack description.
Definition ngs.h:91
SceInt32 sceNgsVoiceSetParamsBlock(SceNgsHVoice voice_handle, const SceNgsModuleParamHeader *param_data, SceSize size, SceInt32 *error_count)
Apply a packed sequence of module parameter records.
SceUInt32 callback_reason
First module-defined reason value.
Definition ngs.h:88
SceInt32 name_offset
Offset of the preset name. Ignored when applying the preset on FW 3.60.
Definition ngs.h:65
SceInt32 sceNgsVoicePatchSetVolume(SceNgsHPatch patch_handle, SceInt32 output_channel, SceInt32 input_channel, SceFloat32 volume)
Set one gain in a patch's [output][input] matrix.
SceSize size
Size beginning at id, including this field and the module-specific data.
Definition ngs.h:98
SceNgsModuleBypassFlag
Values accepted and returned by the module-bypass functions.
Definition ngs.h:152
SceUInt32 bypass_flags_count
Number of module indices in the bypass array.
Definition ngs.h:70
SceUInt32 num_inputs
Number of dynamic input modules in the voice definition.
Definition ngs.h:192
const SceNgsVoiceDefinition * sceNgsVoiceDefGetEqBuss(void)
Return an input-mix, four-band parametric-EQ, and output bus definition.
SceUInt32 preset_data_size
Size of the module parameter records in bytes.
Definition ngs.h:68
SceInt32 channels_per_voice
Audio channels per voice; must be 1 or 2.
Definition ngs.h:46
const SceNgsVoiceDefinition * sceNgsVoiceDefGetCompressorSideChainBuss(void)
Return a two-input side-chain compressor bus definition.
SceInt32 input_channels
Destination-rack channel count.
Definition ngs.h:183
SceNgsParamsID id
Definition ngs.h:97
SceInt16 start_skip
Samples to discard at the start of the first decoded packet.
Definition ngs.h:161
SceInt32 max_voices
Maximum number of voices; must be from 1 through 256.
Definition ngs.h:35
SceInt32 sceNgsVoicePlay(SceNgsHVoice voice_handle)
Start a stopped voice.
SceInt32 sceNgsPatchCreateRouting(const SceNgsPatchSetupInfo *patch_info, SceNgsHPatch *patch_handle)
Create a route from one voice output to one voice input.
SceUInt32 update_passed
Number of processing updates completed for this voice since its most recent initialization or play.
Definition ngs.h:195
SceInt32 max_racks
Maximum number of racks; must be from 1 through 64.
Definition ngs.h:34
SceInt32 bypass_flags_offset
Offset of an array of module indices to bypass, or zero.
Definition ngs.h:69
SceUInt32 num_modules
Number of modules in the voice definition.
Definition ngs.h:191
SceInt32 sceNgsVoiceBypassModule(SceNgsHVoice voice_handle, SceUInt32 module, SceUInt32 bypass_flag)
Set the bypass state of one module in a voice definition.
SceNgsErrorCode
Error codes returned by the FW 3.60 NGS implementation.
Definition ngs.h:103
SceInt32 sceNgsVoicePause(SceNgsHVoice voice_handle)
Pause voice processing without changing whether the voice is playing or keyed off.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetSasEmuVoice(void)
Return the libSas-emulation voice definition.
SceNgsHRack rack_handle
Rack associated with the event.
Definition ngs.h:86
SceInt32 voice_count
Number of voices to allocate; must be greater than zero.
Definition ngs.h:45
#define SCE_NGS_MAX_SYSTEM_CHANNELS
Definition ngs.h:15
struct SceNgsVoiceDefinition SceNgsVoiceDefinition
Opaque immutable voice definition.
Definition ngs.h:23
const SceNgsVoiceDefinition * sceNgsVoiceDefGetMixerBuss(void)
Return a bus definition that mixes multiple input voices.
void * user_data
Value delivered to the callback passed to sceNgsRackRelease.
Definition ngs.h:49
SceInt32 sceNgsRackGetVoiceHandle(SceNgsHRack rack_handle, SceUInt32 index, SceNgsHVoice *voice_handle)
Return one voice allocated by a rack.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetDelayBuss(void)
Return an input-mix, modulated-delay, and output bus definition.
SceInt32 sceNgsVoiceGetStateData(SceNgsHVoice voice_handle, SceUInt32 module, void *memory, SceSize mem_size)
Copy one module's runtime state snapshot.
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.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetTemplate1(void)
Return the complex waveform playback template with signal generation and four sends.
void * callback_ptr
Optional module-defined pointer; valid for the duration of the callback.
Definition ngs.h:90
SceInt32 sceNgsSystemLock(SceNgsHSynSystem system_handle)
Lock the system's internal update state.
SceInt32 preset_data_offset
Offset of the variable-length module parameter records, or zero.
Definition ngs.h:67
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 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 channel_index
Channel to update, or -1 to update every channel represented by the following parameter descriptor.
Definition ngs.h:170
SceInt32 sceSulphaNgsTrace(const char *message)
Emit message as a Sulpha trace event in the Ngs category.
SceInt32 source_output_index
Source voice output index.
Definition ngs.h:56
SceInt32 sceSulphaNgsSetSampleName(const void *location, SceSize length, const char *name)
Associate a diagnostic name with a sample-memory range.
SceInt32 sceNgsVoiceGetParamsOutOfRange(SceNgsHVoice voice_handle, SceUInt32 module, char *message_buffer)
Format the most recent parameter-range result for one module.
SceInt32 granularity
Number of samples processed per update; a multiple of 64 from 64 through 512.
Definition ngs.h:36
SceInt32 num_bytes
Number of bytes to make available to the decoder.
Definition ngs.h:160
const SceNgsVoiceDefinition * sceNgsVoiceDefGetPitchShiftBuss(void)
Return an input-mix, pitch-shift, and output bus definition.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetEnvelopeBuss(void)
Return an input-mix, amplitude-envelope, and output bus definition.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetScreamAtrac9Voice(void)
Return the Scream ATRAC9 playback voice definition.
SceInt32 sceNgsPatchGetInfo(SceNgsHPatch patch_handle, SceNgsPatchRouteInfo *route_info, SceNgsPatchSetupInfo *setup)
Get the current source/destination channel counts and gains of a patch.
SceInt32 sceNgsVoiceResume(SceNgsHVoice voice_handle)
Resume a paused voice without changing its play/key-off state.
SceNgsHVoice voice_handle
Voice associated with the event, or zero for a rack-release event.
Definition ngs.h:85
SceFloat32 matrix[SCE_NGS_MAX_SYSTEM_CHANNELS][SCE_NGS_MAX_SYSTEM_CHANNELS]
Definition ngs.h:176
SceInt32 reserved
Must be at least zero; otherwise ignored on FW 3.60.
Definition ngs.h:38
const SceNgsVoiceDefinition * sceNgsVoiceDefGetSimpleAtrac9Voice(void)
Return the basic ATRAC9 playback voice definition with two sends.
SceUInt32 num_outputs
Number of outputs exposed by the voice definition.
Definition ngs.h:193
SceInt32 sceNgsVoiceSetFinishedCallback(SceNgsHVoice voice_handle, SceNgsCallbackFunc callback_func_ptr, void *user_data)
Set the callback queued when a voice reaches its finished state.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetAtrac9Voice(void)
Return the complex ATRAC9 playback voice definition with four sends.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetDistortionBuss(void)
Return an input-mix, distortion, and output bus definition.
SceInt32 sceNgsVoiceGetInfo(SceNgsHVoice voice_handle, SceNgsVoiceInfo *info)
Get one voice's current key state, module counts, and routing information.
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.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetReverbBuss(void)
Return an input-mix, environmental-reverb, and output bus definition.
SceInt32 sceNgsVoiceGetModuleType(SceNgsHVoice voice_handle, SceUInt32 module, SceNgsModuleID *module_type)
Map a zero-based module index to its module type ID.
SceNgsVolumeMatrix volume_matrix
Current output-to-input gain matrix.
Definition ngs.h:184
const SceNgsVoiceDefinition * sceNgsVoiceDefGetPauserBuss(void)
Return an input-mix, click-free pauser, and output bus definition.
SceNgsHVoice destination_voice
Destination voice; it must belong to the same system as the source.
Definition ngs.h:58
SceInt32 sceNgsVoiceSetPreset(SceNgsHVoice voice_handle, const SceNgsVoicePreset *voice_preset)
Restore module defaults, then apply an optional voice preset.
SceNgsHVoice source_voice
Source voice.
Definition ngs.h:55
SceUInt32 voice_state
Bitwise OR of SceNgsVoiceState values.
Definition ngs.h:190
const SceNgsVoiceDefinition * sceNgsVoiceDefGetCompressorBuss(void)
Return an input-mix, compressor, and output bus definition.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetMasterBuss(void)
Return the master bus definition that exposes PCM output to the caller.
SceInt32 sceNgsPatchRemoveRouting(SceNgsHPatch patch_handle)
Remove a voice-to-voice patch and release its source output slot.
SceInt32 sceNgsSystemGetRequiredMemorySize(const SceNgsSystemInitParams *synth_params, SceSize *size)
Compute the system-buffer size required by an initialization configuration.
SceInt32 sceNgsVoicePatchSetVolumesMatrix(SceNgsHPatch patch_handle, const SceNgsVolumeMatrix *matrix)
Replace a patch's complete 2x2 output-to-input gain matrix.
SceInt32 sceNgsVoiceLockParams(SceNgsHVoice voice_handle, SceUInt32 module, SceNgsParamsID params_interface_id, SceNgsBufferInfo *params_buffer)
Lock and expose one module's live parameter block.
SceInt32 patches_per_output
Patch slots allocated for each voice output.
Definition ngs.h:48
SceInt32 sceSulphaNgsSetVoiceName(SceNgsHVoice voice_handle, const char *name)
Assign a diagnostic Sulpha name to an initialized voice.
SceInt32 sceSulphaNgsGetDefaultConfig(SceSulphaNgsConfig *config)
Fill a Sulpha NGS configuration with the FW 3.60 defaults.
SceInt32 sceNgsVoiceKeyOff(SceNgsHVoice voice_handle)
Request release/envelope processing for a playing voice.
SceInt32 sceSulphaNgsGetNeededMemory(const SceSulphaNgsConfig *config, SceSize *size_in_bytes)
Compute all memory needed by the Sulpha NGS agent and its fixed NGS pools.
SceInt32 sceNgsRackSetParamErrorCallback(SceNgsHRack rack_handle, SceNgsParamsErrorCallbackFunc callback_func_ptr)
Set the parameter-range callback for one rack.
SceNgsSystemFlag
Flags accepted by sceNgsSystemSetFlags.
Definition ngs.h:127
SceSize size
Buffer size in bytes.
Definition ngs.h:28
SceInt32 source_output_sub_index
Source output patch slot, or -1 to use the first free slot.
Definition ngs.h:57
SceInt32 sceSulphaNgsInit(const SceSulphaNgsConfig *config, void *buffer, SceSize size_in_bytes)
Initialize Sulpha NGS tracing for the calling process.
SceInt32 destination_input_index
Destination voice input index.
Definition ngs.h:59
SceInt32 max_patches_per_input
Patch slots for each dynamic input. Input/mixer racks require a nonzero value.
Definition ngs.h:47
SceInt32 sceNgsSystemUnlock(SceNgsHSynSystem system_handle)
Unlock a system previously locked with sceNgsSystemLock.
SceInt32 sceNgsSystemSetFlags(SceNgsHSynSystem system_handle, SceUInt32 system_flags)
Replace the system flags used by subsequent parameter operations.
SceInt32 sceSulphaNgsSetRackName(SceNgsHRack rack_handle, const char *name)
Assign a diagnostic Sulpha name to an initialized rack.
const SceNgsVoiceDefinition * voice_definition
Immutable definition returned by a sceNgsVoiceDefGet* function.
Definition ngs.h:44
SceInt32 output_channels
Source-rack channel count.
Definition ngs.h:182
SceInt32 start_byte_offset
Byte offset of the first required ATRAC9 packet.
Definition ngs.h:159
SceInt32 sceNgsModuleGetNumPresets(SceNgsHSynSystem system_handle, SceNgsModuleID module_id, SceUInt32 *num_presets)
Return the number of built-in presets provided by a module type.
SceInt32 is_super_packet
1 for the four-frame packet layout, otherwise 0.
Definition ngs.h:163
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 sceNgsVoiceKill(SceNgsHVoice voice_handle)
Immediately stop a playing or keyed-off voice and return it to the stopped state.
const SceNgsVoiceDefinition * sceNgsVoiceDefGetScreamVoice(void)
Return the Scream waveform playback voice definition.
SceInt32 sceSulphaNgsShutdown(void)
Unregister the Sulpha NGS agent shared by all threads in the process and release its registrations.
SceUInt32 max_named_samples
Maximum sample-memory ranges that can be named; the FW 3.60 default is 1024.
Definition ngs.h:201
SceInt32 sceNgsVoiceInit(SceNgsHVoice voice_handle, const SceNgsVoicePreset *preset, SceUInt32 init_flags)
Reinitialize a stopped voice and optionally reset patches, preset, or callbacks.
SceInt32 sceSulphaNgsSetSynthName(SceNgsHSynSystem synth_handle, const char *name)
Assign a diagnostic Sulpha name to an initialized NGS system.
SceUInt32 callback_reason2
Second module-defined reason value.
Definition ngs.h:89
SceInt32 sceNgsRackGetRequiredMemorySize(SceNgsHSynSystem system_handle, const SceNgsRackDescription *rack_desc, SceSize *size)
Compute the rack-buffer size required for a description.
void * data
Buffer base address.
Definition ngs.h:27
SceInt32 sceNgsRackRelease(SceNgsHRack rack_handle, SceNgsRackReleaseCallbackFunc callback_func_ptr)
Stop every voice, remove every connected patch, and release a rack.
SceInt32 sceNgsVoiceGetOutputPatch(SceNgsHVoice voice_handle, SceInt32 output_index, SceInt32 sub_index, SceNgsHPatch *patch_handle)
Return the patch occupying one voice output slot.
SceInt32 module_index
Zero-based index in the voice definition.
Definition ngs.h:169
SceInt32 sceNgsVoiceGetModuleBypass(SceNgsHVoice voice_handle, SceUInt32 module, SceUInt32 *bypass_flag)
Get the bypass state of one module.
SceNgsVoiceInitFlag
Reset operations selected by sceNgsVoiceInit.
Definition ngs.h:132
SceUInt32 api_trace_buffer_size
NGS API-call trace buffer size in bytes; only complete 16-byte records are used. The FW 3....
Definition ngs.h:202
SceUInt32 num_patches_per_output
Patch slots allocated for each output.
Definition ngs.h:194
const SceNgsVoiceDefinition * sceNgsVoiceDefGetSimpleVoice(void)
Return the basic PCM/VAG playback voice definition with two sends.
SceUInt32 name_length
Preset-name length. Ignored when applying the preset on FW 3.60.
Definition ngs.h:66
SceNgsModuleID module_id
Module type associated with a module or parameter event.
Definition ngs.h:87
SceInt32 sceNgsSystemRelease(SceNgsHSynSystem system_handle)
Release a system after all of its racks have been released.
SceInt32 sample_rate
System sample rate; must be 48000 on FW 3.60.
Definition ngs.h:37
SceInt32 sceNgsSystemUpdate(SceNgsHSynSystem system_handle)
Process one audio grain and run every queued callback.
@ SCE_NGS_VOICE_STATE_ACTIVE
Definition ngs.h:143
@ SCE_NGS_VOICE_STATE_KEY_OFF
Definition ngs.h:148
@ SCE_NGS_VOICE_STATE_AVAILABLE
Definition ngs.h:142
@ SCE_NGS_VOICE_STATE_PAUSED
Definition ngs.h:147
@ SCE_NGS_VOICE_STATE_FINALIZE
Definition ngs.h:144
@ SCE_NGS_VOICE_STATE_PENDING
Definition ngs.h:146
@ SCE_NGS_VOICE_STATE_UNLOADING
Definition ngs.h:145
@ SCE_NGS_MODULE_FLAG_NOT_BYPASSED
Definition ngs.h:153
@ SCE_NGS_MODULE_FLAG_BYPASSED
Definition ngs.h:154
@ SCE_NGS_ERROR
Definition ngs.h:105
@ SCE_NGS_ERROR_INVALID_BUFFER
Definition ngs.h:123
@ SCE_NGS_ERROR_SIZE_MISMATCH
Definition ngs.h:117
@ SCE_NGS_ERROR_INVALID_STATE
Definition ngs.h:120
@ SCE_NGS_ERROR_DEPENDENCY
Definition ngs.h:109
@ SCE_NGS_ERROR_INVALID_ALIGNMENT
Definition ngs.h:107
@ SCE_NGS_OK
Definition ngs.h:104
@ SCE_NGS_ERROR_OUT_OF_ASSETS
Definition ngs.h:110
@ SCE_NGS_ERROR_RESOURCE_LOCKED
Definition ngs.h:112
@ SCE_NGS_ERROR_PARAM_TYPE_MISMATCH
Definition ngs.h:119
@ SCE_NGS_ERROR_NOT_IMPL
Definition ngs.h:108
@ SCE_NGS_ERROR_INTERNAL_PROCESSING
Definition ngs.h:122
@ SCE_NGS_ERROR_PARAM_OUT_OF_RANGE
Definition ngs.h:113
@ SCE_NGS_ERROR_SYSTEM_MISMATCH
Definition ngs.h:115
@ SCE_NGS_ERROR_INVALID_PARAM
Definition ngs.h:106
@ SCE_NGS_ERROR_PATCH_NOT_AVAIL
Definition ngs.h:118
@ SCE_NGS_ERROR_INTERNAL_ALLOC
Definition ngs.h:121
@ SCE_NGS_ERROR_INVALID_VOICE_TYPE
Definition ngs.h:114
@ SCE_NGS_ERROR_MODULE_NOT_AVAIL
Definition ngs.h:111
@ SCE_NGS_ERROR_INVALID_HANDLE
Definition ngs.h:116
@ SCE_NGS_SYSTEM_FLAG_CHECK_PARAMS
Validate parameter ranges when parameter blocks are unlocked or applied.
Definition ngs.h:128
@ SCE_NGS_VOICE_INIT_ALL
Definition ngs.h:137
@ SCE_NGS_VOICE_INIT_CALLBACKS
Clear the module and voice-finished callbacks.
Definition ngs.h:136
@ SCE_NGS_VOICE_INIT_BASE
Definition ngs.h:133
@ SCE_NGS_VOICE_INIT_ROUTING
Remove every input and output patch connected to the voice.
Definition ngs.h:134
@ SCE_NGS_VOICE_INIT_PRESET
Apply the supplied preset, or the voice definition's default preset when it is NULL.
Definition ngs.h:135
Byte range and samples to skip at each end when decoding an ATRAC9 sample interval.
Definition ngs.h:158
Buffer owned by the caller and used by NGS in place.
Definition ngs.h:26
Information delivered to an NGS callback.
Definition ngs.h:84
Header shared by every module-specific parameter structure.
Definition ngs.h:96
Current route and gain information returned by sceNgsPatchGetInfo.
Definition ngs.h:181
Endpoints used to create one voice-to-voice patch.
Definition ngs.h:54
Description used to size and create a rack.
Definition ngs.h:43
System sizing and processing configuration.
Definition ngs.h:33
Current voice and voice-definition information.
Definition ngs.h:189
Voice preset header.
Definition ngs.h:64
Gain matrix indexed as matrix[outputChannel][inputChannel].
Definition ngs.h:175
Sulpha NGS trace-agent capacities.
Definition ngs.h:200
int16_t SceInt16
Definition types.h:41
int32_t SceInt32
Definition types.h:44
unsigned int SceSize
Definition types.h:56
float SceFloat32
Definition types.h:66
uint32_t SceUInt32
Definition types.h:45