About
The SoundEffectorData stores multiple sound probes that are used to sample a given sound file (defined by a sound track). The class also allows to sample the sound file using the defined probes.
The SoundEffectorData class is defined in the customgui_soundeffector.h
header file. The data type ID is CUSTOMDATATYPE_SOUNDEFFECTOR. Sub-channel IDs are defined in dsoundprobe.h
.
if (moGraphCloner == nullptr)
if (soundEffector == nullptr)
{
if (ieData == nullptr)
}
if (soundTrack == nullptr)
soundTrack->
SetName(
"New Sound Track"_s);
{
if (soundData == nullptr)
}
Access
The SoundEffectorData is typically used with the "Sound" MoGraph effector. An instance of this class is obtained from this object. The parameter ID is defined in oesound.h
.
if (soundEffector == nullptr)
if (soundData == nullptr)
Allocation/Deallocation
A SoundEffectorData object can be created with the usual tools, see Entity Creation and Destruction Manual (Classic).
Sound
A SoundEffectorData is referencing a CTrack of the type CTsound. The sound file used in that CTrack is the sound file used by a SoundEffectorData, which is sampled and displayed in the Attribute Manager.
See also CTrack Manual.
Probes
One or many probes can be used to sample the sound file. Such probes are edited with these functions:
A probe is represented with the Probe class. The "left" and "right" position is defined in Hz, the top and bottom values as a normalized scalar defined between 0.0 and 1.0.
The Probe class also has these public attributes:
Data
Additional settings allow to define the range of the frequency spectrum that is currently displayed in the Attribute Manager. These range functions are only valid if the sound data is displayed using the SoundDataCustomGui (e.g. in the Attribute Manager).
Further functions are:
The color used to colorize the sound is defined by a Gradient:
soundData->
SetRange(1000.0, 2000.0, 0.0, 1.0);
if (gradient == nullptr)
Sampling
The SoundEffectorData class can be used to sample a sound file. The sound file that is sampled is defined with the active CTrack (see Sound).
- Note
- The sound data is sampled using the existing probes and their settings.
const Int32 sampleCount = 100;
for (
Int32 i = 0; i < sampleCount; ++i)
{
soundData->
Sample(i, sampleCount, value, color);
}
Copy
The settings of a given SoundEffectorData object can be copied with:
Further Reading
static String FloatToString(Float32 v, Int32 vvk=-1, Int32 nnk=-3)
Definition: c4d_string.h:529
static CTrack * Alloc(BaseList2D *bl, const DescID &id)
Float pos
Position.
Definition: customgui_gradient.h:138
void InsertObject(BaseObject *op, BaseObject *parent, BaseObject *pred, Bool checknames=false)
Bool SetActiveSoundTrack(CTrack *track, BaseDocument *doc)
maxon::Int Int
Definition: ge_sys_math.h:64
Definition: c4d_baseobject.h:224
void SetLinLog(Float value)
Definition: lib_description.h:328
Represents a knot in a gradient.
Definition: customgui_gradient.h:134
maxon::Float Float
Definition: ge_sys_math.h:66
#define CUSTOMDATATYPE_SOUNDEFFECTOR
SoundData ID.
Definition: customgui_soundeffector.h:26
Int GetProbeCount() const
void SetGradientDirection(Int32 direction)
Manages file and path names.
Definition: c4d_file.h:93
return OK
Definition: apibase.h:2620
const DescID & GetDescriptionID() const
Definition: c4d_canimation.h:722
void InsertTrackSorted(CTrack *track)
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
CTrack * GetActiveSoundTrack(BaseDocument *doc)
Probe * GetProbe(Int index) const
Vector _color
Color of the probe used when the probe's color mode is Custom Color.
Definition: customgui_soundeffector.h:132
Definition: c4d_canimation.h:659
Bool Sample(Int index, Int count, Float &value, Vector &color)
Vector col
Color.
Definition: customgui_gradient.h:136
#define CUSTOMDATATYPE_INEXCLUDE_LIST
InExclude custom data type ID.
Definition: customgui_inexclude.h:25
InExclude custom data type (CUSTOMDATATYPE_INEXCLUDE_LIST).
Definition: customgui_inexclude.h:114
String GetString(void) const
Definition: c4d_string.h:38
static String IntToString(Int32 v)
Definition: c4d_string.h:495
Int32 _samplingMode
The probe mode.
Definition: customgui_soundeffector.h:130
Int CreateProbe(Float left=1.0, Float right=22050.0, Float top=1.0, Float bottom=0.0, Bool selected=false)
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
Bool InsertObject(BaseList2D *pObject, Int32 lFlags)
Bool SetRight(Float right)
Represents a level within a DescID.
Definition: lib_description.h:287
Definition: customgui_gradient.h:149
Int32 _colorMode
The color mode.
Definition: customgui_soundeffector.h:129
Definition: c4d_gedata.h:82
const Filename & GetFilename(void) const
Definition: c4d_gedata.h:475
void SetName(const maxon::String &name)
Definition: c4d_baselist.h:2354
Int32 InsertKnot(const GradientKnot &knot)
Definition: customgui_soundeffector.h:146
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
void FlushKnots()
Flushes all the knots.
@ CID_SOUND_NAME
Definition: ctsound.h:7
Bool InitSampling(BaseDocument *doc)
Bool SetBottom(Float bottom)
Base class for custom data types.
Definition: c4d_customdatatype.h:50
@ ID_MG_MOTIONGENERATOR_EFFECTORLIST
Definition: obasemogen.h:16
Gradient * GetGradient() const
void SetRange(Float xmin, Float xmax, Float ymin, Float ymax)
static BaseObject * Alloc(Int32 type)
CustomDataType * GetCustomDataType(Int32 datatype) const
Definition: c4d_gedata.h:507
BaseObject * GetActiveObject(void)
Bool IsInstanceOf(Int32 id) const
Definition: c4d_baselist.h:1403
Definition: customgui_soundeffector.h:39
static String VectorToString(const Vector32 &v, Int32 nnk=-1)
Definition: c4d_string.h:571
@ MGSOUNDEFFECTOR_GADGET
Definition: oesound.h:6
Bool GetParameter(const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
#define MAXON_SCOPE
Definition: apibase.h:2798
#define CTsound
Sound.
Definition: ge_prepass.h:1356
Bool FileSelect(FILESELECTTYPE type, FILESELECT flags, const maxon::String &title, const maxon::String &force_suffix=maxon::String())