Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
bugfix attr direction detection
Browse files Browse the repository at this point in the history
  • Loading branch information
CircuitMusicLabs committed Aug 17, 2018
1 parent cf41ef9 commit bfbc207
Show file tree
Hide file tree
Showing 18 changed files with 3,472 additions and 157 deletions.
Binary file modified externals/cm.buffercloud~.mxe
Binary file not shown.
Binary file modified externals/cm.buffercloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.buffercloud~.mxo/Contents/MacOS/cm.buffercloud~
Binary file not shown.
Binary file modified externals/cm.gausscloud~.mxe
Binary file not shown.
Binary file modified externals/cm.gausscloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.gausscloud~.mxo/Contents/MacOS/cm.gausscloud~
Binary file not shown.
Binary file modified externals/cm.indexcloud~.mxe
Binary file not shown.
Binary file modified externals/cm.indexcloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.indexcloud~.mxo/Contents/MacOS/cm.indexcloud~
Binary file not shown.
Binary file modified externals/cm.livecloud~.mxe
Binary file not shown.
Binary file modified externals/cm.livecloud~.mxe64
Binary file not shown.
Binary file modified externals/cm.livecloud~.mxo/Contents/MacOS/cm.livecloud~
Binary file not shown.
1,761 changes: 1,689 additions & 72 deletions help/cm.buffercloud~.maxhelp

Large diffs are not rendered by default.

1,828 changes: 1,761 additions & 67 deletions help/cm.gausscloud~.maxhelp

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions source/cm.buffercloud~/cm.buffercloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ typedef struct _cmbuffercloud {
t_bool pitchlist_active; // boolean pitch list active true/false
long playback_timer; // timer for check-interval playback direction
double startmedian; // variable to store the current playback position (median between min and max)
t_bool play_reverse; // flag for reverse playback used when reverse-attr set to "direction"
} t_cmbuffercloud;


Expand Down Expand Up @@ -351,6 +352,7 @@ void *cmbuffercloud_new(t_symbol *s, long argc, t_atom *argv) {
x->length_verify = false;

x->playback_timer = 0;
x->play_reverse = false;

/************************************************************************************************************************/
// BUFFER REFERENCES
Expand Down Expand Up @@ -427,7 +429,6 @@ void cmbuffercloud_perform64(t_cmbuffercloud *x, t_object *dsp64, double **ins,
double gain;
double pan_left, pan_right;
double startmedian_curr;
t_bool play_reverse;

// OUTLETS
t_double *out_left = (t_double *)outs[0]; // assign pointer to left output
Expand Down Expand Up @@ -556,12 +557,12 @@ void cmbuffercloud_perform64(t_cmbuffercloud *x, t_object *dsp64, double **ins,
// check diff every 100 ms
if (x->playback_timer == (100 * x->m_sr)) {
x->playback_timer = 0;
startmedian_curr = x->grain_params[1] - ((x->grain_params[1] - x->grain_params[0]) / 2);
startmedian_curr = x->grain_params[0] + ((x->grain_params[1] - x->grain_params[0]) / 2);
if (startmedian_curr < x->startmedian) {
play_reverse = true;
x->play_reverse = true;
}
else if (startmedian_curr > x->startmedian) {
play_reverse = false;
x->play_reverse = false;
}
x->startmedian = startmedian_curr;
}
Expand Down Expand Up @@ -695,7 +696,7 @@ void cmbuffercloud_perform64(t_cmbuffercloud *x, t_object *dsp64, double **ins,
}
}
else if (x->attr_reverse == gensym("direction")) {
if (play_reverse) {
if (x->play_reverse) {
x->cloud[slot].reverse = true;
x->cloud[slot].pos = x->cloud[slot].length - 1;
}
Expand Down
11 changes: 6 additions & 5 deletions source/cm.gausscloud~/cm.gausscloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ typedef struct _cmgausscloud {
t_bool pitchlist_active; // boolean pitch list active true/false
long playback_timer; // timer for check-interval playback direction
double startmedian; // variable to store the current playback position (median between min and max)
t_bool play_reverse; // flag for reverse playback used when reverse-attr set to "direction"
} t_cmgausscloud;


Expand Down Expand Up @@ -345,6 +346,7 @@ void *cmgausscloud_new(t_symbol *s, long argc, t_atom *argv) {
x->length_verify = false;

x->playback_timer = 0;
x->play_reverse = false;

/************************************************************************************************************************/
// BUFFER REFERENCES
Expand Down Expand Up @@ -424,7 +426,6 @@ void cmgausscloud_perform64(t_cmgausscloud *x, t_object *dsp64, double **ins, lo
double pan_left, pan_right;
double alpha;
double startmedian_curr;
t_bool play_reverse;

// OUTLETS
t_double *out_left = (t_double *)outs[0]; // assign pointer to left output
Expand Down Expand Up @@ -551,12 +552,12 @@ void cmgausscloud_perform64(t_cmgausscloud *x, t_object *dsp64, double **ins, lo
// check diff every 100 ms
if (x->playback_timer == (100 * x->m_sr)) {
x->playback_timer = 0;
startmedian_curr = x->grain_params[1] - ((x->grain_params[1] - x->grain_params[0]) / 2);
startmedian_curr = x->grain_params[0] + ((x->grain_params[1] - x->grain_params[0]) / 2);
if (startmedian_curr < x->startmedian) {
play_reverse = true;
x->play_reverse = true;
}
else if (startmedian_curr > x->startmedian) {
play_reverse = false;
x->play_reverse = false;
}
x->startmedian = startmedian_curr;
}
Expand Down Expand Up @@ -699,7 +700,7 @@ void cmgausscloud_perform64(t_cmgausscloud *x, t_object *dsp64, double **ins, lo
}
}
else if (x->attr_reverse == gensym("direction")) {
if (play_reverse) {
if (x->play_reverse) {
x->cloud[slot].reverse = true;
x->cloud[slot].pos = x->cloud[slot].length - 1;
}
Expand Down
9 changes: 5 additions & 4 deletions source/cm.indexcloud~/cm.indexcloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ typedef struct _cmindexcloud {
t_bool pitchlist_active; // boolean pitch list active true/false
long playback_timer; // timer for check-interval playback direction
double startmedian; // variable to store the current playback position (median between min and max)
t_bool play_reverse; // flag for reverse playback used when reverse-attr set to "direction"
} t_cmindexcloud;


Expand Down Expand Up @@ -402,6 +403,7 @@ void *cmindexcloud_new(t_symbol *s, long argc, t_atom *argv) {
x->length_verify = false;

x->playback_timer = 0;
x->play_reverse = false;

/************************************************************************************************************************/
// BUFFER REFERENCES
Expand Down Expand Up @@ -485,7 +487,6 @@ void cmindexcloud_perform64(t_cmindexcloud *x, t_object *dsp64, double **ins, lo
double gain;
double pan_left, pan_right;
double startmedian_curr;
t_bool play_reverse;

// OUTLETS
t_double *out_left = (t_double *)outs[0]; // assign pointer to left output
Expand Down Expand Up @@ -627,10 +628,10 @@ void cmindexcloud_perform64(t_cmindexcloud *x, t_object *dsp64, double **ins, lo
x->playback_timer = 0;
startmedian_curr = x->grain_params[1] - ((x->grain_params[1] - x->grain_params[0]) / 2);
if (startmedian_curr < x->startmedian) {
play_reverse = true;
x->play_reverse = true;
}
else if (startmedian_curr > x->startmedian) {
play_reverse = false;
x->play_reverse = false;
}
x->startmedian = startmedian_curr;
}
Expand Down Expand Up @@ -763,7 +764,7 @@ void cmindexcloud_perform64(t_cmindexcloud *x, t_object *dsp64, double **ins, lo
}
}
else if (x->attr_reverse == gensym("direction")) {
if (play_reverse) {
if (x->play_reverse) {
x->cloud[slot].reverse = true;
x->cloud[slot].pos = x->cloud[slot].length - 1;
}
Expand Down
9 changes: 5 additions & 4 deletions source/cm.livecloud~/cm.livecloud~.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ typedef struct _cmlivecloud {
t_bool pitchlist_active; // boolean pitch list active true/false
long playback_timer; // timer for check-interval playback direction
double startmedian; // variable to store the current playback position (median between min and max)
t_bool play_reverse; // flag for reverse playback used when reverse-attr set to "direction"
} t_cmlivecloud;


Expand Down Expand Up @@ -385,6 +386,7 @@ void *cmlivecloud_new(t_symbol *s, long argc, t_atom *argv) {
x->bufferms_verify = false;

x->playback_timer = 0;
x->play_reverse = false;

/************************************************************************************************************************/
// BUFFER REFERENCES
Expand Down Expand Up @@ -470,7 +472,6 @@ void cmlivecloud_perform64(t_cmlivecloud *x, t_object *dsp64, double **ins, long
double pan_left, pan_right;
long max_delay; // calculated maximum delay length according to grain length and pitch
double startmedian_curr;
t_bool play_reverse;

// OUTLETS
t_double *out_left = (t_double *)outs[0]; // assign pointer to left output
Expand Down Expand Up @@ -614,10 +615,10 @@ void cmlivecloud_perform64(t_cmlivecloud *x, t_object *dsp64, double **ins, long
x->playback_timer = 0;
startmedian_curr = x->grain_params[0] - ((x->grain_params[0] - x->grain_params[1]) / 2);
if (startmedian_curr > x->startmedian) {
play_reverse = true;
x->play_reverse = true;
}
else if (startmedian_curr < x->startmedian) {
play_reverse = false;
x->play_reverse = false;
}
x->startmedian = startmedian_curr;
}
Expand Down Expand Up @@ -782,7 +783,7 @@ void cmlivecloud_perform64(t_cmlivecloud *x, t_object *dsp64, double **ins, long
}
}
else if (x->attr_reverse == gensym("direction")) {
if (play_reverse) {
if (x->play_reverse) {
x->cloud[slot].reverse = true;
x->cloud[slot].pos = x->cloud[slot].length - 1;
}
Expand Down

0 comments on commit bfbc207

Please sign in to comment.