PSPSDK 2026-04-21
Loading...
Searching...
No Matches
pspsascore.h File Reference
#include <psptypes.h>
Include dependency graph for pspsascore.h:

Go to the source code of this file.

Data Structures

struct  SceSasCore
 Contains all data related to a sceSasCore state. More...
 

Macros

#define PSP_SAS_GET_VOICE_BIT(voice)
 Macro utility to obtain the corresponding bit of a voice index.
 
#define PSP_SAS_GET_FLAG_AT(flags, voice)
 Macro utility for reading voice bitfield flags.
 
#define PSP_SAS_GRAIN_SIZE   (256)
 The recommended sceSasCore grain size that's used by most games.
 
#define PSP_SAS_GRAIN_SIZE_MIN   (64)
 The minimum sceSasCore grain size.
 
#define PSP_SAS_GRAIN_SIZE_MAX   (2048)
 The maximum sceSasCore grain size.
 
#define PSP_SAS_VOICES_MAX   (32)
 The maximum number of voices that sceSas can playback all at once.
 
#define PSP_SAS_SAMPLE_RATE   (44100)
 The sample rate of sceSasCore mixer.
 
#define PSP_SAS_VOLUME_MAX   (0x1000)
 The maximum output volume of sceSas voices.
 
#define PSP_SAS_PITCH_BASE   (0x1000)
 Represents 1x voice pitch.
 
#define PSP_SAS_PITCH_MIN   (0x1)
 The minimum supported voice pitch.
 
#define PSP_SAS_PITCH_MAX   (0x4000)
 The maximum supported voice pitch.
 
#define PSP_SAS_NOISE_FREQ_MAX   (0x3F)
 The maximum noise frequency.
 
#define PSP_SAS_ENVELOPE_HEIGHT_MAX   (0x40000000)
 Represents maximum ADSR envelope height.
 
#define PSP_SAS_ENVELOPE_FREQ_MAX   (0x7FFFFFFF)
 Represents maximum ADSR envelope frequency.
 
#define PSP_SAS_ADSR_EVERYTHING   (PSP_SAS_ADSR_ATTACK | PSP_SAS_ADSR_DECAY | PSP_SAS_ADSR_SUSTAIN | PSP_SAS_ADSR_RELEASE)
 

Enumerations

enum  PspSasOutputModes { PSP_SAS_OUTPUTMODE_STEREO = 0 , PSP_SAS_OUTPUTMODE_MULTICHANNEL = 1 }
 
enum  PspSasEffectTypes {
  PSP_SAS_EFFECT_TYPE_OFF = -1 , PSP_SAS_EFFECT_TYPE_ROOM = 0 , PSP_SAS_EFFECT_TYPE_SMALL = 1 , PSP_SAS_EFFECT_TYPE_MEDIUM = 2 ,
  PSP_SAS_EFFECT_TYPE_LARGE = 3 , PSP_SAS_EFFECT_TYPE_HALL = 4 , PSP_SAS_EFFECT_TYPE_SPACE = 5 , PSP_SAS_EFFECT_TYPE_ECHO = 6 ,
  PSP_SAS_EFFECT_TYPE_DELAY = 7 , PSP_SAS_EFFECT_TYPE_PIPE = 8
}
 
enum  PspSasADSRCurveModes {
  PSP_SAS_ADSR_CURVE_MODE_LINEAR_INCREASE = 0 , PSP_SAS_ADSR_CURVE_MODE_LINEAR_DECREASE = 1 , PSP_SAS_ADSR_CURVE_MODE_LINEAR_BENT = 2 , PSP_SAS_ADSR_CURVE_MODE_EXPONENT_REV = 3 ,
  PSP_SAS_ADSR_CURVE_MODE_EXPONENT = 4 , PSP_SAS_ADSR_CURVE_MODE_DIRECT = 5
}
 ADSR envelope curve modes. More...
 
enum  PspSasErrorCodes {
  PSP_SAS_ERROR_ADDRESS = 0x80420005 , PSP_SAS_ERROR_VOICE_INDEX = 0x80420010 , PSP_SAS_ERROR_NOISE_CLOCK = 0x80420011 , PSP_SAS_ERROR_PITCH_VAL = 0x80420012 ,
  PSP_SAS_ERROR_ADSR_MODE = 0x80420013 , PSP_SAS_ERROR_ADPCM_SIZE = 0x80420014 , PSP_SAS_ERROR_LOOP_MODE = 0x80420015 , PSP_SAS_ERROR_INVALID_STATE = 0x80420016 ,
  PSP_SAS_ERROR_VOLUME_VAL = 0x80420018 , PSP_SAS_ERROR_ADSR_VAL = 0x80420019 , PSP_SAS_ERROR_FX_TYPE = 0x80420020 , PSP_SAS_ERROR_FX_FEEDBACK = 0x80420021 ,
  PSP_SAS_ERROR_FX_DELAY = 0x80420022 , PSP_SAS_ERROR_FX_VOLUME_VAL = 0x80420023 , PSP_SAS_ERROR_BUSY = 0x80420030 , PSP_SAS_ERROR_NOTINIT = 0x80420100 ,
  PSP_SAS_ERROR_ALRDYINIT = 0x80420101
}
 Error codes used as return values by sceSasCore. More...
 
enum  PspSasADSRFlags { PSP_SAS_ADSR_ATTACK = 1 , PSP_SAS_ADSR_DECAY = 2 , PSP_SAS_ADSR_SUSTAIN = 4 , PSP_SAS_ADSR_RELEASE = 8 }
 ADSR envelope flags. More...
 

Functions

int __sceSasInit (SceSasCore *core, int grainsize, int maxvoices, PspSasOutputModes outputmode, int samplerate)
 Initializes a SceSasCore instance.
 
int __sceSasGetOutputmode (SceSasCore *core)
 Gets the current output mode from the SceSasCore instance.
 
int __sceSasSetOutputmode (SceSasCore *core, PspSasOutputModes outputmode)
 Sets the current output mode of the SceSasCore instance.
 
int __sceSasRevType (SceSasCore *core, PspSasEffectTypes type)
 Sets the reverb effect of the SceSasCore instance.
 
int __sceSasRevEVOL (SceSasCore *core, int leftvol, int rightvol)
 Sets the effect volume of the SceSasCore instance.
 
int __sceSasRevVON (SceSasCore *core, int dry, int wet)
 Toggles dry and wet audio signals of the SceSasCore instance.
 
int __sceSasRevParam (SceSasCore *core, int delay, int feedback)
 Sets the effect delay and feedback parameters of the SceSasCore instance.
 
int __sceSasGetGrain (SceSasCore *core)
 Gets the grain size of the SceSasCore instance.
 
int __sceSasSetGrain (SceSasCore *core, int grainsize)
 Sets the grain size of the SceSasCore instance.
 
u32 __sceSasGetEndFlag (SceSasCore *core)
 Gets the end status of the voices from an SceSasCore nstance.
 
int __sceSasSetVoice (SceSasCore *core, int voice, void *vag, int size, int loop)
 Sets PlayStation VAG data for a given sceSas voice.
 
int __sceSasSetVoicePCM (SceSasCore *core, int voice, void *pcm, int samplecount, int loopstart)
 Sets PCM data for the given sceSas voice.
 
int __sceSasSetKeyOn (SceSasCore *core, int voice)
 Plays the voice (starts Attack phase).
 
int __sceSasSetKeyOff (SceSasCore *core, int voice)
 Stops the voice (starts Release phase).
 
int __sceSasSetPitch (SceSasCore *core, int voice, int pitch)
 Sets the pitch value of a voice.
 
int __sceSasSetADSRmode (SceSasCore *core, int voice, u32 mask, PspSasADSRCurveModes attackcurve, PspSasADSRCurveModes decaycurve, PspSasADSRCurveModes sustaincurve, PspSasADSRCurveModes releasecurve)
 Sets the voice ADSR envelope curves.
 
int __sceSasSetADSR (SceSasCore *core, int voice, u32 mask, int attackrate, int decayrate, int sustainrate, int releaserate)
 Sets the voice ADSR envelope rates for a voice.
 
int __sceSasSetSimpleADSR (SceSasCore *core, int voice, u32 envelope1, u32 envelope2)
 Configures the entire voice ADSR envelope (rates & curves).
 
int __sceSasSetSL (SceSasCore *core, int voice, int level)
 Sets the voice ADSR envelope sustain level height.
 
int __sceSasSetVolume (SceSasCore *core, int voice, int leftvol, int rightvol, int sendleftvol, int sendrightvol)
 Sets the output volume of the voice.
 
int __sceSasCore (SceSasCore *core, void *dst)
 Runs a sceSas cycle iteration and outputs samples onto destination buffer.
 
int __sceSasCoreWithMix (SceSasCore *core, void *dst, int leftvol, int rightvol)
 Runs a sceSas cycle iteration and mixes samples onto destination buffer.
 
int __sceSasGetPauseFlag (SceSasCore *core)
 Get the pause status of every voice in a bitfield.
 
int __sceSasGetEnvelopeHeight (SceSasCore *core, int voice)
 Gets the current envelope height of a voice.
 
int __sceSasGetAllEnvelopeHeights (SceSasCore *core, int heights[32])
 Gets the current envelope height of all voices.
 
int __sceSasSetPause (SceSasCore *core, u32 voicebit, int pause)
 Pauses/unpauses voice playback using a bitmask.
 
int __sceSasSetNoise (SceSasCore *core, int voice, int freq)
 Configures the voice to play a noise waveform.
 
int __sceSasSetTrianglarWave (SceSasCore *core, int voice, int unk)
 Configures the voice to play a triangular waveform.
 
int __sceSasSetTriangularWave (SceSasCore *core, int voice, int unk)
 A function alias of __sceSasSetTrianglarWave.
 
int __sceSasSetSteepWave (SceSasCore *core, int voice, int duty)
 Configures the voice to play a square waveform.
 
int __sceSasSetVoiceATRAC3 (SceSasCore *core, int voice, void *atrac3ctx)
 
int __sceSasConcatenateATRAC3 (SceSasCore *core, int voice, void *data, int size)
 
int __sceSasUnsetATRAC3 (SceSasCore *core, int voice)