Skip to content

Commit

Permalink
fix player to accept 0 as a valid onset
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesneimog committed Dec 8, 2023
1 parent 4a11d91 commit a36485e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ void Py4pdLib_FreeDictionary(Dictionary *dictionary) {

// ================== PLAYER ======================
void Py4pdLib_PlayTick(t_py *x) {
x->msOnset++;
if (x->playerDict->lastOnset > x->msOnset) {
clock_delay(x->playerClock, 1);
} else {
clock_unset(x->playerClock);
}
x->msOnset++;
KeyValuePair *entry = Py4pdLib_PlayerGetValue(x->playerDict, x->msOnset);
if (entry != NULL) {
for (int i = 0; i < entry->size; i++) {
Expand All @@ -110,7 +112,6 @@ void Py4pdLib_PlayTick(t_py *x) {
// ======================================================
void Py4pdLib_Play(t_py *x, t_symbol *s, int ac, t_atom *av) {
(void)s;

x->msOnset = 0;
if (x->playerDict == NULL) {
pd_error(x, "[%s]: Nothing to play.", x->objName->s_name);
Expand All @@ -126,7 +127,6 @@ void Py4pdLib_Play(t_py *x, t_symbol *s, int ac, t_atom *av) {

// ======================================================
void Py4pdLib_Stop(t_py *x) {

if (x->playerClock == NULL) {
pd_error(x, "[%s]: Nothing to stop.", x->objName->s_name);
return;
Expand Down

0 comments on commit a36485e

Please sign in to comment.