bc.yinstats external More...
Public Attributes | |
t_object | ob |
Pointer to the object itself. | |
long | nbstats |
# of statistics agents | |
bc_statelem * | stats |
Pointers on statistics agents. | |
double | minproba |
Minimal probabilty for outputing. | |
long | window |
Lifetime of each statistics agent. | |
double | lastpitch |
Last pitch received. | |
double | lastamp |
Last amplitude received. | |
long | laststat |
Last statistics agent enabled. | |
void * | out_pitch |
Outlet 0 (Pitch). | |
void * | out_amp |
Outlet 1 (Amplitude). | |
void * | out_proba |
Outlet 2 (Probability). | |
Standard Max5 methodes | |
| |
void * | bc_yinstats_new (t_symbol *s, long argc, t_atom *argv) |
Object instantiation. | |
void | bc_yinstats_free (t_bc_yinstats *x) |
Object destruction. | |
void | bc_yinstats_assist (t_bc_yinstats *x, void *b, long io, long index, char *s) |
Inlet/Outlet contextual information when patchin in Max5. | |
Input/Output routines | |
| |
void | bc_yinstats_amp (t_bc_yinstats *x, double ampin) |
Raw amplitudes. | |
void | bc_yinstats_pitch (t_bc_yinstats *x, long pitchin) |
Raw pitches. | |
void | bc_yinstats_stop (t_bc_yinstats *x) |
Stops all the statistics agents at once. | |
void | bc_yinstats_out (bc_statelem *stat) |
Outputs a coocked pitch with its mean amplitude and probability. | |
Internal routines | |
| |
bool | bc_yinstats_addocc (t_bc_yinstats *x, long pitchin, double ampin) |
Adds a pitch to every enabled statistics agent. | |
long | bc_yinstats_addstat (t_bc_yinstats *x, long pitchin, double ampin) |
Enables a new statistics agent. | |
void | bc_yinstats_reset (t_bc_yinstats *x, bc_statelem *stat) |
Resets a statistics agent. |
bc.yinstats external
This externals implements a statistical analysis of the raw output of pitches (usually given fed by the yin~ object). It examines all the different pitches over a time window and outputs the more probable pitch.
Definition at line 32 of file bc.yinstats.c.
bool bc_yinstats_addocc | ( | t_bc_yinstats * | x, | |
long | pitchin, | |||
double | ampin | |||
) |
Adds a pitch to every enabled statistics agent.
If input pitch matches the pitch of the statistics agent then add as an occurence and sum the amplitude
Definition at line 245 of file bc.yinstats.c.
long bc_yinstats_addstat | ( | t_bc_yinstats * | x, | |
long | pitchin, | |||
double | ampin | |||
) |
Enables a new statistics agent.
Sets also the lifetime of the agent
Definition at line 268 of file bc.yinstats.c.
void bc_yinstats_free | ( | t_bc_yinstats * | x | ) |
void * bc_yinstats_new | ( | t_symbol * | s, | |
long | argc, | |||
t_atom * | argv | |||
) |
Object instantiation.
Allocate the memory for the number of statistics agents given as first argument
Definition at line 108 of file bc.yinstats.c.
void bc_yinstats_reset | ( | t_bc_yinstats * | x, | |
bc_statelem * | stat | |||
) |
Resets a statistics agent.
After reset, the agents status is disabled
Definition at line 292 of file bc.yinstats.c.
void bc_yinstats_stop | ( | t_bc_yinstats * | x | ) |
Stops all the statistics agents at once.
Outputs nothing.
Definition at line 226 of file bc.yinstats.c.