> why not go all the way and use Uint64 instead? It should give us another million years. int64 requires less changes, musmon.c contains if (--(csound->cyclesRemaining) <= 0) ... ... while (csound->cyclesRemaining <= 0)... ... Here is the simplest patch, you can improve or ignore it diff -ur csound5~/Engine/musmon.c csound5/Engine/musmon.c --- csound5~/Engine/musmon.c 2012-02-24 22:58:37.000000000 +0100 +++ csound5/Engine/musmon.c 2012-02-24 23:09:48.000000000 +0100 @@ -805,7 +805,7 @@ return retval; } -#define RNDINT(x) ((int) ((double) (x) + ((double) (x) < 0.0 ? -0.5 : 0.5))) +#define RNDINT64(x) ((int64_t) ((double) (x) + ((double) (x) < 0.0 ? -0.5 : 0.5))) extern int sensMidi(CSOUND *); @@ -919,10 +919,10 @@ /* calculate the number of k-periods remaining until next event */ if (O->Beatmode) csound->cyclesRemaining = - RNDINT((csound->nxtbt - csound->curBeat) / csound->curBeat_inc); + RNDINT64((csound->nxtbt - csound->curBeat) / csound->curBeat_inc); else { csound->cyclesRemaining = - RNDINT((csound->nxtim*csound->esr - csound->icurTime) / csound->ksmps); + RNDINT64((csound->nxtim*csound->esr - csound->icurTime) / csound->ksmps); csound->nxtim = (csound->cyclesRemaining*csound->ksmps+csound->icurTime)/csound->esr; } } diff -ur csound5~/H/csoundCore.h csound5/H/csoundCore.h --- csound5~/H/csoundCore.h 2012-02-24 22:58:37.000000000 +0100 +++ csound5/H/csoundCore.h 2012-02-24 23:17:35.000000000 +0100 @@ -1062,7 +1062,7 @@ /** start time of current section */ double timeOffs, beatOffs; /** current time in seconds, inc. per kprd */ - long icurTime; /* Current time in samples */ + int64_t icurTime; /* Current time in samples */ double curTime_inc; /** current time in beats, inc per kprd */ double curBeat, curBeat_inc; @@ -1209,7 +1209,7 @@ void **cfgVariableDB; double prvbt, curbt, nxtbt; double curp2, nxtim; - int cyclesRemaining; + int64_t cyclesRemaining; EVTBLK evt; void *memalloc_db; MGLOBAL *midiGlobals; ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net