From jsyn at music.columbia.edu Fri Mar 21 06:04:31 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 21 06:04:39 2008 Subject: [jsyn] Variable delay time In-Reply-To: <0D1A9E95-A45B-4D8B-A4A5-7DF3B70B7331@yahoo.com> Message-ID: <795024.71409.qm@web53012.mail.re2.yahoo.com> Hi! I'm trying to make a delay unit that have a variable delay time. Every single try ends up with the same null pointer exception. Is that possible or should I give up? ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From jsyn at music.columbia.edu Fri Mar 21 07:32:43 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 21 07:32:53 2008 Subject: [jsyn] Variable delay time In-Reply-To: <795024.71409.qm@web53012.mail.re2.yahoo.com> References: <795024.71409.qm@web53012.mail.re2.yahoo.com> Message-ID: On Mar 21, 2008, at 6:04 AM, jsyn@music.columbia.edu wrote: > Hi! > I'm trying to make a delay unit that have a variable > delay time. Every single try ends up with the same > null pointer exception. Is that possible or should I > give up? Never give up! :-) Here's code for a very vanilla interpolating delay-line flanger. I did this years and years ago, though, so it may be really out-of- date. Pkus my java-coding skills are a bit on the ancient side of things, too. brad http://music.columbia.edu/~brad ---------------------------- /* basic flanger -- nothing fancy here * * Brad Garton 12/2001 * */ import java.util.*; import java.awt.*; import com.softsynth.jsyn.*; import com.softsynth.jsyn.circuits.*; class BradFlange extends SynthCircuit { /* * flinput = input * feedback = feedback multiplier (< 1!) * sweepfreq = flanger sweep rate * depth = maximum delay length (< 0.1!) * */ public SynthInput flinput; public SynthInput feedback; public SynthInput sweepfreq; public SynthInput depth; InterpolatingDelayUnit fldelay; SineOscillator flcontrol; AddUnit flctrladder; MultiplyUnit fldepthmult; MultiplyUnit flfeedback; AddUnit flfbadder; public BradFlange() { fldelay = new InterpolatingDelayUnit(0.1); add(fldelay); flcontrol = new SineOscillator(); add(flcontrol); flctrladder = new AddUnit(); add(flctrladder); fldepthmult = new MultiplyUnit(); add(fldepthmult); flfeedback = new MultiplyUnit(); add(flfeedback); flfbadder = new AddUnit(); add(flfbadder); flinput = flfbadder.inputA; flfbadder.output.connect(fldelay.input); fldelay.output.connect(flfeedback.inputA); flfeedback.output.connect(flfbadder.inputB); flcontrol.amplitude.set(0.5); flcontrol.output.connect(flctrladder.inputA); flctrladder.inputB.set(0.5); flctrladder.output.connect(fldepthmult.inputA); fldepthmult.output.connect(fldelay.delay); feedback = flfeedback.inputB; sweepfreq = flcontrol.frequency; depth = fldepthmult.inputB; output = fldelay.output; } } From jsyn at music.columbia.edu Fri Mar 21 13:44:39 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 21 13:45:01 2008 Subject: [jsyn] Variable delay time In-Reply-To: <795024.71409.qm@web53012.mail.re2.yahoo.com> References: <795024.71409.qm@web53012.mail.re2.yahoo.com> Message-ID: <47E3F407.8050602@softsynth.com> Are you by any chance creating the delay line BEFORE starting the JSyn engine? I think that might be a problem because the sample rate has not been set. Create the delay line after starting as a workaround. I will try to protect against this. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Phone/FAX: 1-415-453-4320 --------------------------------------- jsyn@music.columbia.edu wrote: > Hi! > I'm trying to make a delay unit that have a variable > delay time. Every single try ends up with the same > null pointer exception. Is that possible or should I > give up? > From jsyn at music.columbia.edu Fri Mar 21 20:34:05 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 21 20:34:13 2008 Subject: [jsyn] Variable delay time In-Reply-To: <47E3F407.8050602@softsynth.com> Message-ID: <673603.43963.qm@web53005.mail.re2.yahoo.com> No I'm starting the JSyn engine at the start of my main class. But now I think the problem is that I'm trying to change the buffer's size (dTsamples) but it's a constant. delayLine = new SynthSample( dTsamples ); Would you recommend any other action to have the delay time changing? Thanks!! --- jsyn@music.columbia.edu wrote: > Are you by any chance creating the delay line BEFORE > starting the JSyn > engine? I think that might be a problem because the > sample rate has not > been set. Create the delay line after starting as a > workaround. I will > try to protect against this. > > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Phone/FAX: 1-415-453-4320 > --------------------------------------- > > > jsyn@music.columbia.edu wrote: > > Hi! > > I'm trying to make a delay unit that have a > variable > > delay time. Every single try ends up with the same > > null pointer exception. Is that possible or should > I > > give up? > > > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other > administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn > ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From jsyn at music.columbia.edu Fri Mar 21 20:55:44 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 21 20:56:02 2008 Subject: [jsyn] Variable delay time In-Reply-To: <673603.43963.qm@web53005.mail.re2.yahoo.com> References: <673603.43963.qm@web53005.mail.re2.yahoo.com> Message-ID: <47E45910.3050102@mail.rockefeller.edu> Sorry I am jumping in a little late and may be misunderstanding your needs, but why aren't you using InterpolatingDelayUnit ? That has a delay that can be changed at runtime Thanks Nick jsyn@music.columbia.edu wrote: > No I'm starting the JSyn engine at the start of my > main class. But now I think the problem is that I'm > trying to change the buffer's size (dTsamples) but > it's a constant. > delayLine = new SynthSample( dTsamples ); > > Would you recommend any other action to have the delay > time changing? > > Thanks!! > --- jsyn@music.columbia.edu wrote: > > >> Are you by any chance creating the delay line BEFORE >> starting the JSyn >> engine? I think that might be a problem because the >> sample rate has not >> been set. Create the delay line after starting as a >> workaround. I will >> try to protect against this. >> >> >> Thank you, >> Phil Burk >> --------------------------------------- >> SoftSynth, Audio Research and Development >> http://www.softsynth.com/ >> 75 Pleasant Lane, San Rafael, CA, 94901 USA >> Phone/FAX: 1-415-453-4320 >> --------------------------------------- >> >> >> jsyn@music.columbia.edu wrote: >> >>> Hi! >>> I'm trying to make a delay unit that have a >>> >> variable >> >>> delay time. Every single try ends up with the same >>> null pointer exception. Is that possible or should >>> >> I >> >>> give up? >>> >>> >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other >> administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn >> >> > > > > ____________________________________________________________________________________ > Be a better friend, newshound, and > know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn > From jsyn at music.columbia.edu Sat Mar 22 06:36:35 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Sat Mar 22 06:36:48 2008 Subject: [jsyn] Variable delay time In-Reply-To: <47E45910.3050102@mail.rockefeller.edu> Message-ID: <111737.16283.qm@web53001.mail.re2.yahoo.com> I wanted to show how the delay lines works inside, in my thesis. Finally I'll use the InterpolatingDelayUnit and write a theoritical introduction about this. --- jsyn@music.columbia.edu wrote: > Sorry I am jumping in a little late and may be > misunderstanding your > needs, but why aren't you using > InterpolatingDelayUnit ? > That has a delay that can be changed at runtime > Thanks > Nick > > > jsyn@music.columbia.edu wrote: > > No I'm starting the JSyn engine at the start of my > > main class. But now I think the problem is that > I'm > > trying to change the buffer's size (dTsamples) but > > it's a constant. > > delayLine = new SynthSample( dTsamples ); > > > > Would you recommend any other action to have the > delay > > time changing? > > > > Thanks!! > > --- jsyn@music.columbia.edu wrote: > > > > > >> Are you by any chance creating the delay line > BEFORE > >> starting the JSyn > >> engine? I think that might be a problem because > the > >> sample rate has not > >> been set. Create the delay line after starting as > a > >> workaround. I will > >> try to protect against this. > >> > >> > >> Thank you, > >> Phil Burk > >> --------------------------------------- > >> SoftSynth, Audio Research and Development > >> http://www.softsynth.com/ > >> 75 Pleasant Lane, San Rafael, CA, 94901 USA > >> Phone/FAX: 1-415-453-4320 > >> --------------------------------------- > >> > >> > >> jsyn@music.columbia.edu wrote: > >> > >>> Hi! > >>> I'm trying to make a delay unit that have a > >>> > >> variable > >> > >>> delay time. Every single try ends up with the > same > >>> null pointer exception. Is that possible or > should > >>> > >> I > >> > >>> give up? > >>> > >>> > >> _______________________________________________ > >> JSyn mailing list > >> JSyn@music.columbia.edu > >> To change digest mode or to make other > >> administrative changes visit: > >> http://music.columbia.edu/mailman/listinfo/jsyn > >> > >> > > > > > > > > > ____________________________________________________________________________________ > > Be a better friend, newshound, and > > know-it-all with Yahoo! Mobile. Try it now. > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > > _______________________________________________ > > JSyn mailing list > > JSyn@music.columbia.edu > > To change digest mode or to make other > administrative changes visit: > > http://music.columbia.edu/mailman/listinfo/jsyn > > > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other > administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn > ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From jsyn at music.columbia.edu Fri Mar 28 05:05:08 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 05:05:42 2008 Subject: [jsyn] Envelope Timing Problem Message-ID: Dear Folk, I am running an envelope and have calculated the number of ticks it should take to get to a certain point, but it is actually moving faster when I set the duration longer. I have many glissandi that are synced by it, so those are always accurate, but they only need to start at a certain point, but that point is is to late since the envelope seems to move faster that the corresponding ticks and it accumulates over time. Maybe I am calculating something wrong... Any Takers... Thanks in advance... Best, Mike package main; import com.softsynth.jsyn.AddUnit; import com.softsynth.jsyn.DivideUnit; import com.softsynth.jsyn.EnvelopePlayer; import com.softsynth.jsyn.EqualTemperedTuning; import com.softsynth.jsyn.MultiplyUnit; import com.softsynth.jsyn.SynthEnvelope; import com.softsynth.jsyn.Synth; public class Glissandi extends Thread{ WaveForm[] gliss; AddUnit[] num; DivideUnit[] ratio; MultiplyUnit[] freq; SynthEnvelope env; MultiplyUnit denMult; AddUnit den; EnvelopePlayer envPlayer; boolean isOn = false; double fund; public Glissandi(){ } public void init(){ System.out.println(Rise.FIRST_NUM + " " + Rise.VOICES); gliss = new WaveForm[Rise.VOICES]; num = new AddUnit[Rise.VOICES]; ratio = new DivideUnit[Rise.VOICES]; freq = new MultiplyUnit[Rise.VOICES]; fund = EqualTemperedTuning.getMIDIFrequency(24+Rise.TRANSPOSE_SCORE+Rise.TRANSPOSE_ SOUND); //System.out.println(Rise.TOTAL_DUR); envPlayer = new EnvelopePlayer(); double[] envData = {Rise.TOTAL_DUR, 1}; env = new SynthEnvelope(envData); denMult = new MultiplyUnit(); denMult.inputA.connect(envPlayer.output); denMult.inputB.set(-1 * (Rise.VOICES - 1)); den = new AddUnit(); den.inputA.set(Rise.FIRST_NUM); den.inputB.connect(denMult.output); int advanceTime = (int) (Synth.getTickCount() + Synth.getTickRate()); for (int i = 0; i < Rise.VOICES; i++){ System.out.println(i); gliss[i] = new WaveForm(); num[i] = new AddUnit(); ratio[i] = new DivideUnit(); freq[i] = new MultiplyUnit(); double spectrum = (Rise.MAX_SPECTRUM - Rise.MIN_SPECTRUM)/2. + Rise.MIN_SPECTRUM; gliss[i].spectrum.set(spectrum); num[i].inputA.set(i); num[i].inputB.connect(den.output); ratio[i].inputA.connect(num[i].output); ratio[i].inputB.connect(den.output); freq[i].inputA.connect(ratio[i].output); freq[i].inputB.set(fund); freq[i].output.connect(gliss[i].frequency); gliss[i].envRate.set(1); // figure out this number int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / (Rise.VOICES-1.) * i * Synth.getTickRate())); int endTick = (int) (advanceTime + (Rise.TOTAL_DUR * Synth.getTickRate())); double startPitch = fund * Rise.FIRST_NUM/(Rise.FIRST_NUM-i); //System.out.println("test " + startTick + " " + Synth.getTickCount()); // These are happening at the wrong time!!!! gliss[i].glissOn(startTick, startPitch, (1./Rise.VOICES)); System.out.println("test " + startTick + " " + endTick + " " + Synth.getTickCount() + " " + (1./ (Rise.VOICES-1) * i)); gliss[i].glissOff(endTick); num[i].start(startTick); ratio[i].start(startTick); freq[i].start(startTick); } denMult.start(advanceTime); den.start(advanceTime); //System.out.println(envPlayer.getSynthContext().getTickCount()); envPlayer.start(advanceTime); envPlayer.envelopePort.clear(advanceTime); envPlayer.envelopePort.queue(advanceTime,env,0,env.getNumFrames()); } public synchronized void run() { try { //System.out.println("waiting"); this.wait(0); } catch (InterruptedException e) { e.printStackTrace(); } boolean isOn = true; int startTime = Synth.getTickCount() + (int) Synth.getTickRate(); int duration = (int) (Synth.getTickRate() / 10); // Resolution should be pixles in view int advanceTime = (int) (Synth.getTickRate() * 0.5); // half second advance Synth.sleepUntilTick( startTime - advanceTime ); // Wake up early! int nextTime = startTime; while(true) { if (Rise.IS_ENGINE_ON == true) { System.out.println(envPlayer.output.get() + " " + Synth.getTickCount() + " " + num[Rise.VOICES-2].output.get()); //System.out.println(num[Rise.VOICES-1].output.get()); Rise.SCROLLBAR.xPos = envPlayer.output.get() * Rise.SCROLLBAR_WIDTH; //System.out.println(Rise.SCROLLBAR.xPos); Rise.SCROLLBAR.repaint(); nextTime += duration; // Advance nextTime by fixed amount. Synth.sleepUntilTick( nextTime - advanceTime ); // Wake up early! } else { try { System.out.println("waiting"); this.wait(0); } catch (InterruptedException e) { e.printStackTrace(); } } } } public void kill() { isOn = false; for (int i = 0; i < Rise.VOICES; i++){ gliss[i].glissOff(0); num[i].stop(); ratio[i].stop(); freq[i].stop(); } denMult.stop(); den.stop(); envPlayer.stop(); } } From jsyn at music.columbia.edu Fri Mar 28 13:28:55 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 13:29:03 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: References: Message-ID: <47ED2AD7.2040502@softsynth.com> Hello Mike, > the envelope seems to move faster that the > corresponding ticks and it accumulates over time. > Maybe I am calculating something wrong... I'm a little worried about the implicit ordering of operators in this line: > int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / > (Rise.VOICES-1.) * i * Synth.getTickRate())); Do you mean: (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) or ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Phone/FAX: 1-415-453-4320 --------------------------------------- From jsyn at music.columbia.edu Fri Mar 28 14:02:09 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 14:02:32 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: <47ED2AD7.2040502@softsynth.com> Message-ID: Hey Phil, I definitely mean the latter case: ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) Is that not what is happening? Thanks, Mike On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" wrote: > Hello Mike, > >> the envelope seems to move faster that the >> corresponding ticks and it accumulates over time. >> Maybe I am calculating something wrong... > > I'm a little worried about the implicit ordering of operators in this line: > >> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >> (Rise.VOICES-1.) * i * Synth.getTickRate())); > > Do you mean: > > (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) > > or > > ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Phone/FAX: 1-415-453-4320 > --------------------------------------- > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn From jsyn at music.columbia.edu Fri Mar 28 14:14:49 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 14:14:58 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: References: Message-ID: <47ED3599.2050107@softsynth.com> > Is that not what is happening? I don't know. I never rely on operator precedence. I always make the order explicit using parentheses. Then I know exactly what the compiler is doing. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Phone/FAX: 1-415-453-4320 --------------------------------------- jsyn@music.columbia.edu wrote: > Hey Phil, > > I definitely mean the latter case: > > ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) > > Is that not what is happening? > > Thanks, > > Mike > > > On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" > wrote: > >> Hello Mike, >> >>> the envelope seems to move faster that the >>> corresponding ticks and it accumulates over time. >>> Maybe I am calculating something wrong... >> I'm a little worried about the implicit ordering of operators in this line: >> >>> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >>> (Rise.VOICES-1.) * i * Synth.getTickRate())); >> Do you mean: >> >> (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) >> >> or >> >> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >> >> Thank you, >> Phil Burk >> --------------------------------------- >> SoftSynth, Audio Research and Development >> http://www.softsynth.com/ >> 75 Pleasant Lane, San Rafael, CA, 94901 USA >> Phone/FAX: 1-415-453-4320 >> --------------------------------------- >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn > > > > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn > > From jsyn at music.columbia.edu Fri Mar 28 15:15:19 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 15:22:40 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: <47ED3599.2050107@softsynth.com> Message-ID: Thanks Phil, Duly noted, I will be more careful next time. Nonetheless, I checked and they are both cranking out the same values. However, strangely enough, now, after my computer has been asleep all night, I am getting kind of the opposite problem in that it now seems like the envelope is moving faster. (????) I am printing running values. Synth tick counts are moving at a constant rate, but envelope output is not... For example, envelope output at tick 195496 should be 0.8571428571428571 Here are some print outs... At the beginning difference in envelope output approx. every tenth of a second is approx. .0003288 0.0011362528894096613 18544 0.0014650519005954266 18612 0.0017938509117811918 18680 Approaching tick 195496, difference is approx. .0002594 and is nowhere near the 0.8571428571428571 target value that it should be at... 0.8093692660331726 195412 0.8096286058425903 195480 0.8098880052566528 195548 0.8101474046707153 195616 0.8104068040847778 195684 As I said, the problem gets worse the longer I set the envelope. When the envelope is short (say 10 to 30 seconds), it is accurate. When it is very long as in the printouts above (from a 5 minute test) the problem gets worse. Eventually this will be running at lengths of 45 minutes! Is it possible that these are out of sync? I guess it is hard for me to tell which one is wrong, the tick count or the envelope output (it is probably me!!!), but in the prints the count is staying constant. Is the envelope an audio routine? If so, it should be spot on right? Thanks for all your help!!! Hope we can figure this out... Best, Mike On 3/28/08 11:14 AM, "jsyn@music.columbia.edu" wrote: > >> Is that not what is happening? > > I don't know. I never rely on operator precedence. I always make the > order explicit using parentheses. Then I know exactly what the compiler > is doing. > > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Phone/FAX: 1-415-453-4320 > --------------------------------------- > > > jsyn@music.columbia.edu wrote: >> Hey Phil, >> >> I definitely mean the latter case: >> >> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >> >> Is that not what is happening? >> >> Thanks, >> >> Mike >> >> >> On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" >> wrote: >> >>> Hello Mike, >>> >>>> the envelope seems to move faster that the >>>> corresponding ticks and it accumulates over time. >>>> Maybe I am calculating something wrong... >>> I'm a little worried about the implicit ordering of operators in this line: >>> >>>> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >>>> (Rise.VOICES-1.) * i * Synth.getTickRate())); >>> Do you mean: >>> >>> (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) >>> >>> or >>> >>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>> >>> Thank you, >>> Phil Burk >>> --------------------------------------- >>> SoftSynth, Audio Research and Development >>> http://www.softsynth.com/ >>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>> Phone/FAX: 1-415-453-4320 >>> --------------------------------------- >>> _______________________________________________ >>> JSyn mailing list >>> JSyn@music.columbia.edu >>> To change digest mode or to make other administrative changes visit: >>> http://music.columbia.edu/mailman/listinfo/jsyn >> >> >> >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn >> >> > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn ------------------------------------------------- PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! SORRY FOR THE INCONVENIENCE... michael winter mwinter@unboundedpress.org www.unboundedpress.org From jsyn at music.columbia.edu Fri Mar 28 15:55:39 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 15:55:49 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: References: Message-ID: <47ED4D3B.1030308@softsynth.com> > Duly noted, I will be more careful next time. Nonetheless, > I checked and they are both cranking out the same values. Are you saying that ((A/B)*C) == (A/(B*C)) That should not be true unless A==0 or C==1. > As I said, the problem gets worse the longer I set the envelope. When the > envelope is short (say 10 to 30 seconds), it is accurate. When it is very > long as in the printouts above (from a 5 minute test) the problem gets > worse. Eventually this will be running at lengths of 45 minutes! That may be an important clue. The envelopes were designed to run fairly quickly. I used single precision floating point to avoid taxing the wimpy processors we had back in 1996. Maybe 32 bit floats are not precise enough for the slow ramps. The phase increment is calculated as phaseInc = 1.0 / (sampleRate * duration); For 5 minutes at 44100 Hz that is 0.00000007559 That may be fine if we are adding it to zero. But if we add it to 0.8 then 32 bit floats may not be precise enough. I may consider converting the internal engine to double precision. That will take more CPU time. (Are JSyn user often running out of CPU time?) If this is indeed the problem then you can work around it by creating envelopes with multiple segments with smaller duration. Or you can run threads that do more frequent updating of parameters rather than just creating a huge circuit in the init() method. Ultimately that will be more flexible. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Phone/FAX: 1-415-453-4320 --------------------------------------- jsyn@music.columbia.edu wrote: > Thanks Phil, > > Duly noted, I will be more careful next time. Nonetheless, I checked and > they are both cranking out the same values. > > However, strangely enough, now, after my computer has been asleep all night, > I am getting kind of the opposite problem in that it now seems like the > envelope is moving faster. (????) > > I am printing running values. Synth tick counts are moving at a constant > rate, but envelope output is not... > > For example, envelope output at tick 195496 should be 0.8571428571428571 > > Here are some print outs... > > At the beginning difference in envelope output approx. every tenth of a > second is approx. .0003288 > > 0.0011362528894096613 18544 > 0.0014650519005954266 18612 > 0.0017938509117811918 18680 > > Approaching tick 195496, difference is approx. .0002594 and is nowhere near > the 0.8571428571428571 target value that it should be at... > > 0.8093692660331726 195412 > 0.8096286058425903 195480 > 0.8098880052566528 195548 > 0.8101474046707153 195616 > 0.8104068040847778 195684 > > As I said, the problem gets worse the longer I set the envelope. When the > envelope is short (say 10 to 30 seconds), it is accurate. When it is very > long as in the printouts above (from a 5 minute test) the problem gets > worse. Eventually this will be running at lengths of 45 minutes! > > Is it possible that these are out of sync? I guess it is hard for me to tell > which one is wrong, the tick count or the envelope output (it is probably > me!!!), but in the prints the count is staying constant. > > Is the envelope an audio routine? If so, it should be spot on right? > > Thanks for all your help!!! Hope we can figure this out... > > Best, > > Mike > > > > > On 3/28/08 11:14 AM, "jsyn@music.columbia.edu" > wrote: > >>> Is that not what is happening? >> I don't know. I never rely on operator precedence. I always make the >> order explicit using parentheses. Then I know exactly what the compiler >> is doing. >> >> >> Thank you, >> Phil Burk >> --------------------------------------- >> SoftSynth, Audio Research and Development >> http://www.softsynth.com/ >> 75 Pleasant Lane, San Rafael, CA, 94901 USA >> Phone/FAX: 1-415-453-4320 >> --------------------------------------- >> >> >> jsyn@music.columbia.edu wrote: >>> Hey Phil, >>> >>> I definitely mean the latter case: >>> >>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>> >>> Is that not what is happening? >>> >>> Thanks, >>> >>> Mike >>> >>> >>> On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" >>> wrote: >>> >>>> Hello Mike, >>>> >>>>> the envelope seems to move faster that the >>>>> corresponding ticks and it accumulates over time. >>>>> Maybe I am calculating something wrong... >>>> I'm a little worried about the implicit ordering of operators in this line: >>>> >>>>> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >>>>> (Rise.VOICES-1.) * i * Synth.getTickRate())); >>>> Do you mean: >>>> >>>> (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) >>>> >>>> or >>>> >>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>> >>>> Thank you, >>>> Phil Burk >>>> --------------------------------------- >>>> SoftSynth, Audio Research and Development >>>> http://www.softsynth.com/ >>>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>>> Phone/FAX: 1-415-453-4320 >>>> --------------------------------------- >>>> _______________________________________________ >>>> JSyn mailing list >>>> JSyn@music.columbia.edu >>>> To change digest mode or to make other administrative changes visit: >>>> http://music.columbia.edu/mailman/listinfo/jsyn >>> >>> >>> _______________________________________________ >>> JSyn mailing list >>> JSyn@music.columbia.edu >>> To change digest mode or to make other administrative changes visit: >>> http://music.columbia.edu/mailman/listinfo/jsyn >>> >>> >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn > > ------------------------------------------------- > PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! > SORRY FOR THE INCONVENIENCE... > > michael winter > mwinter@unboundedpress.org > www.unboundedpress.org > > > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn > > From jsyn at music.columbia.edu Fri Mar 28 16:16:40 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 16:17:38 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: <47ED4D3B.1030308@softsynth.com> Message-ID: Hey Phil, I was saying that (A/(B-C)*D) == ((A/(B-C))*D)... I will try the multi-segment envelope and see if that works, but will probably not get to it tonight and will give you an update when I try. As I said, I will be running this at very long lengths. Maybe you could have two envelopes one with floats and one with doubles. I eat up processing pretty well, but am running an old machine and really need the accuracy in some cases. As for this: > Or you can run threads that do more frequent updating of parameters > rather than just creating a huge circuit in the init() method. > Ultimately that will be more flexible. I am not sure I understand. If everything is running from the same synth context (the static one when Synth.startEngine(0) is set), shouldn't everything all run together no matter how many threads are running? Thanks!!! I will let you know about the multisegment envelope... Best, Mike On 3/28/08 12:55 PM, "jsyn@music.columbia.edu" wrote: > >> Duly noted, I will be more careful next time. Nonetheless, >> I checked and they are both cranking out the same values. > > Are you saying that ((A/B)*C) == (A/(B*C)) > That should not be true unless A==0 or C==1. > > >> As I said, the problem gets worse the longer I set the envelope. When the >> envelope is short (say 10 to 30 seconds), it is accurate. When it is very >> long as in the printouts above (from a 5 minute test) the problem gets >> worse. Eventually this will be running at lengths of 45 minutes! > > > That may be an important clue. The envelopes were designed to run fairly > quickly. I used single precision floating point to avoid taxing the > wimpy processors we had back in 1996. Maybe 32 bit floats are not > precise enough for the slow ramps. > > The phase increment is calculated as > > phaseInc = 1.0 / (sampleRate * duration); > > For 5 minutes at 44100 Hz that is 0.00000007559 > > That may be fine if we are adding it to zero. But if we add it to 0.8 > then 32 bit floats may not be precise enough. > > I may consider converting the internal engine to double precision. That > will take more CPU time. (Are JSyn user often running out of CPU time?) > > If this is indeed the problem then you can work around it by creating > envelopes with multiple segments with smaller duration. > > Or you can run threads that do more frequent updating of parameters > rather than just creating a huge circuit in the init() method. > Ultimately that will be more flexible. > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Phone/FAX: 1-415-453-4320 > --------------------------------------- > > > jsyn@music.columbia.edu wrote: >> Thanks Phil, >> >> Duly noted, I will be more careful next time. Nonetheless, I checked and >> they are both cranking out the same values. >> >> However, strangely enough, now, after my computer has been asleep all night, >> I am getting kind of the opposite problem in that it now seems like the >> envelope is moving faster. (????) >> >> I am printing running values. Synth tick counts are moving at a constant >> rate, but envelope output is not... >> >> For example, envelope output at tick 195496 should be 0.8571428571428571 >> >> Here are some print outs... >> >> At the beginning difference in envelope output approx. every tenth of a >> second is approx. .0003288 >> >> 0.0011362528894096613 18544 >> 0.0014650519005954266 18612 >> 0.0017938509117811918 18680 >> >> Approaching tick 195496, difference is approx. .0002594 and is nowhere near >> the 0.8571428571428571 target value that it should be at... >> >> 0.8093692660331726 195412 >> 0.8096286058425903 195480 >> 0.8098880052566528 195548 >> 0.8101474046707153 195616 >> 0.8104068040847778 195684 >> >> As I said, the problem gets worse the longer I set the envelope. When the >> envelope is short (say 10 to 30 seconds), it is accurate. When it is very >> long as in the printouts above (from a 5 minute test) the problem gets >> worse. Eventually this will be running at lengths of 45 minutes! >> >> Is it possible that these are out of sync? I guess it is hard for me to tell >> which one is wrong, the tick count or the envelope output (it is probably >> me!!!), but in the prints the count is staying constant. >> >> Is the envelope an audio routine? If so, it should be spot on right? >> >> Thanks for all your help!!! Hope we can figure this out... >> >> Best, >> >> Mike >> >> >> >> >> On 3/28/08 11:14 AM, "jsyn@music.columbia.edu" >> wrote: >> >>>> Is that not what is happening? >>> I don't know. I never rely on operator precedence. I always make the >>> order explicit using parentheses. Then I know exactly what the compiler >>> is doing. >>> >>> >>> Thank you, >>> Phil Burk >>> --------------------------------------- >>> SoftSynth, Audio Research and Development >>> http://www.softsynth.com/ >>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>> Phone/FAX: 1-415-453-4320 >>> --------------------------------------- >>> >>> >>> jsyn@music.columbia.edu wrote: >>>> Hey Phil, >>>> >>>> I definitely mean the latter case: >>>> >>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>> >>>> Is that not what is happening? >>>> >>>> Thanks, >>>> >>>> Mike >>>> >>>> >>>> On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" >>>> wrote: >>>> >>>>> Hello Mike, >>>>> >>>>>> the envelope seems to move faster that the >>>>>> corresponding ticks and it accumulates over time. >>>>>> Maybe I am calculating something wrong... >>>>> I'm a little worried about the implicit ordering of operators in this >>>>> line: >>>>> >>>>>> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >>>>>> (Rise.VOICES-1.) * i * Synth.getTickRate())); >>>>> Do you mean: >>>>> >>>>> (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) >>>>> >>>>> or >>>>> >>>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>>> >>>>> Thank you, >>>>> Phil Burk >>>>> --------------------------------------- >>>>> SoftSynth, Audio Research and Development >>>>> http://www.softsynth.com/ >>>>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>>>> Phone/FAX: 1-415-453-4320 >>>>> --------------------------------------- >>>>> _______________________________________________ >>>>> JSyn mailing list >>>>> JSyn@music.columbia.edu >>>>> To change digest mode or to make other administrative changes visit: >>>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>> >>>> >>>> _______________________________________________ >>>> JSyn mailing list >>>> JSyn@music.columbia.edu >>>> To change digest mode or to make other administrative changes visit: >>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>> >>>> >>> _______________________________________________ >>> JSyn mailing list >>> JSyn@music.columbia.edu >>> To change digest mode or to make other administrative changes visit: >>> http://music.columbia.edu/mailman/listinfo/jsyn >> >> ------------------------------------------------- >> PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! >> SORRY FOR THE INCONVENIENCE... >> >> michael winter >> mwinter@unboundedpress.org >> www.unboundedpress.org >> >> >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn >> >> > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn ------------------------------------------------- PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! SORRY FOR THE INCONVENIENCE... michael winter mwinter@unboundedpress.org www.unboundedpress.org From jsyn at music.columbia.edu Fri Mar 28 17:01:17 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 17:01:27 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: References: Message-ID: <47ED5C9D.9040006@softsynth.com> > I am not sure I understand. If everything is running from the same synth > context (the static one when Synth.startEngine(0) is set), shouldn't > everything all run together no matter how many threads are running? What I meant was, rather than queue one envelope segment that lasts 45 minutes, launch a thread that runs for 45 minutes and that updates a ramp every few seconds. It will be more flexible because you can make arbitrary changes to the trajectories over time. Also the duration will be less and the phaseIncrement less prone to precision errors. But this technique is more complicated. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Phone/FAX: 1-415-453-4320 --------------------------------------- jsyn@music.columbia.edu wrote: > Hey Phil, > > I was saying that (A/(B-C)*D) == ((A/(B-C))*D)... > > I will try the multi-segment envelope and see if that works, but will > probably not get to it tonight and will give you an update when I try. > > As I said, I will be running this at very long lengths. Maybe you could have > two envelopes one with floats and one with doubles. I eat up processing > pretty well, but am running an old machine and really need the accuracy in > some cases. > > As for this: > >> Or you can run threads that do more frequent updating of parameters >> rather than just creating a huge circuit in the init() method. >> Ultimately that will be more flexible. > > I am not sure I understand. If everything is running from the same synth > context (the static one when Synth.startEngine(0) is set), shouldn't > everything all run together no matter how many threads are running? > > Thanks!!! I will let you know about the multisegment envelope... > > Best, > > Mike > > > On 3/28/08 12:55 PM, "jsyn@music.columbia.edu" > wrote: > >>> Duly noted, I will be more careful next time. Nonetheless, >>> I checked and they are both cranking out the same values. >> Are you saying that ((A/B)*C) == (A/(B*C)) >> That should not be true unless A==0 or C==1. >> >> >>> As I said, the problem gets worse the longer I set the envelope. When the >>> envelope is short (say 10 to 30 seconds), it is accurate. When it is very >>> long as in the printouts above (from a 5 minute test) the problem gets >>> worse. Eventually this will be running at lengths of 45 minutes! >> >> That may be an important clue. The envelopes were designed to run fairly >> quickly. I used single precision floating point to avoid taxing the >> wimpy processors we had back in 1996. Maybe 32 bit floats are not >> precise enough for the slow ramps. >> >> The phase increment is calculated as >> >> phaseInc = 1.0 / (sampleRate * duration); >> >> For 5 minutes at 44100 Hz that is 0.00000007559 >> >> That may be fine if we are adding it to zero. But if we add it to 0.8 >> then 32 bit floats may not be precise enough. >> >> I may consider converting the internal engine to double precision. That >> will take more CPU time. (Are JSyn user often running out of CPU time?) >> >> If this is indeed the problem then you can work around it by creating >> envelopes with multiple segments with smaller duration. >> >> Or you can run threads that do more frequent updating of parameters >> rather than just creating a huge circuit in the init() method. >> Ultimately that will be more flexible. >> >> Thank you, >> Phil Burk >> --------------------------------------- >> SoftSynth, Audio Research and Development >> http://www.softsynth.com/ >> 75 Pleasant Lane, San Rafael, CA, 94901 USA >> Phone/FAX: 1-415-453-4320 >> --------------------------------------- >> >> >> jsyn@music.columbia.edu wrote: >>> Thanks Phil, >>> >>> Duly noted, I will be more careful next time. Nonetheless, I checked and >>> they are both cranking out the same values. >>> >>> However, strangely enough, now, after my computer has been asleep all night, >>> I am getting kind of the opposite problem in that it now seems like the >>> envelope is moving faster. (????) >>> >>> I am printing running values. Synth tick counts are moving at a constant >>> rate, but envelope output is not... >>> >>> For example, envelope output at tick 195496 should be 0.8571428571428571 >>> >>> Here are some print outs... >>> >>> At the beginning difference in envelope output approx. every tenth of a >>> second is approx. .0003288 >>> >>> 0.0011362528894096613 18544 >>> 0.0014650519005954266 18612 >>> 0.0017938509117811918 18680 >>> >>> Approaching tick 195496, difference is approx. .0002594 and is nowhere near >>> the 0.8571428571428571 target value that it should be at... >>> >>> 0.8093692660331726 195412 >>> 0.8096286058425903 195480 >>> 0.8098880052566528 195548 >>> 0.8101474046707153 195616 >>> 0.8104068040847778 195684 >>> >>> As I said, the problem gets worse the longer I set the envelope. When the >>> envelope is short (say 10 to 30 seconds), it is accurate. When it is very >>> long as in the printouts above (from a 5 minute test) the problem gets >>> worse. Eventually this will be running at lengths of 45 minutes! >>> >>> Is it possible that these are out of sync? I guess it is hard for me to tell >>> which one is wrong, the tick count or the envelope output (it is probably >>> me!!!), but in the prints the count is staying constant. >>> >>> Is the envelope an audio routine? If so, it should be spot on right? >>> >>> Thanks for all your help!!! Hope we can figure this out... >>> >>> Best, >>> >>> Mike >>> >>> >>> >>> >>> On 3/28/08 11:14 AM, "jsyn@music.columbia.edu" >>> wrote: >>> >>>>> Is that not what is happening? >>>> I don't know. I never rely on operator precedence. I always make the >>>> order explicit using parentheses. Then I know exactly what the compiler >>>> is doing. >>>> >>>> >>>> Thank you, >>>> Phil Burk >>>> --------------------------------------- >>>> SoftSynth, Audio Research and Development >>>> http://www.softsynth.com/ >>>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>>> Phone/FAX: 1-415-453-4320 >>>> --------------------------------------- >>>> >>>> >>>> jsyn@music.columbia.edu wrote: >>>>> Hey Phil, >>>>> >>>>> I definitely mean the latter case: >>>>> >>>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>>> >>>>> Is that not what is happening? >>>>> >>>>> Thanks, >>>>> >>>>> Mike >>>>> >>>>> >>>>> On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" >>>>> wrote: >>>>> >>>>>> Hello Mike, >>>>>> >>>>>>> the envelope seems to move faster that the >>>>>>> corresponding ticks and it accumulates over time. >>>>>>> Maybe I am calculating something wrong... >>>>>> I'm a little worried about the implicit ordering of operators in this >>>>>> line: >>>>>> >>>>>>> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >>>>>>> (Rise.VOICES-1.) * i * Synth.getTickRate())); >>>>>> Do you mean: >>>>>> >>>>>> (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) >>>>>> >>>>>> or >>>>>> >>>>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>>>> >>>>>> Thank you, >>>>>> Phil Burk >>>>>> --------------------------------------- >>>>>> SoftSynth, Audio Research and Development >>>>>> http://www.softsynth.com/ >>>>>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>>>>> Phone/FAX: 1-415-453-4320 >>>>>> --------------------------------------- >>>>>> _______________________________________________ >>>>>> JSyn mailing list >>>>>> JSyn@music.columbia.edu >>>>>> To change digest mode or to make other administrative changes visit: >>>>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>>> >>>>> _______________________________________________ >>>>> JSyn mailing list >>>>> JSyn@music.columbia.edu >>>>> To change digest mode or to make other administrative changes visit: >>>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>>> >>>>> >>>> _______________________________________________ >>>> JSyn mailing list >>>> JSyn@music.columbia.edu >>>> To change digest mode or to make other administrative changes visit: >>>> http://music.columbia.edu/mailman/listinfo/jsyn >>> ------------------------------------------------- >>> PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! >>> SORRY FOR THE INCONVENIENCE... >>> >>> michael winter >>> mwinter@unboundedpress.org >>> www.unboundedpress.org >>> >>> >>> _______________________________________________ >>> JSyn mailing list >>> JSyn@music.columbia.edu >>> To change digest mode or to make other administrative changes visit: >>> http://music.columbia.edu/mailman/listinfo/jsyn >>> >>> >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn > > ------------------------------------------------- > PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! > SORRY FOR THE INCONVENIENCE... > > michael winter > mwinter@unboundedpress.org > www.unboundedpress.org > > > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn > > From jsyn at music.columbia.edu Fri Mar 28 19:00:56 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 19:07:40 2008 Subject: [jsyn] Envelope Timing Problem In-Reply-To: <47ED5C9D.9040006@softsynth.com> Message-ID: Hey Phil, Thanks a bunch. Now I understand a bit better. Those trajectories are set for the piece, I just need everything synced very accurately... Maybe I could still use that idea though! Best, Mike On 3/28/08 2:01 PM, "jsyn@music.columbia.edu" wrote: > >> I am not sure I understand. If everything is running from the same synth >> context (the static one when Synth.startEngine(0) is set), shouldn't >> everything all run together no matter how many threads are running? > > What I meant was, rather than queue one envelope segment that lasts 45 > minutes, launch a thread that runs for 45 minutes and that updates a > ramp every few seconds. It will be more flexible because you can make > arbitrary changes to the trajectories over time. Also the duration will > be less and the phaseIncrement less prone to precision errors. But this > technique is more complicated. > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Phone/FAX: 1-415-453-4320 > --------------------------------------- > > > jsyn@music.columbia.edu wrote: >> Hey Phil, >> >> I was saying that (A/(B-C)*D) == ((A/(B-C))*D)... >> >> I will try the multi-segment envelope and see if that works, but will >> probably not get to it tonight and will give you an update when I try. >> >> As I said, I will be running this at very long lengths. Maybe you could have >> two envelopes one with floats and one with doubles. I eat up processing >> pretty well, but am running an old machine and really need the accuracy in >> some cases. >> >> As for this: >> >>> Or you can run threads that do more frequent updating of parameters >>> rather than just creating a huge circuit in the init() method. >>> Ultimately that will be more flexible. >> >> I am not sure I understand. If everything is running from the same synth >> context (the static one when Synth.startEngine(0) is set), shouldn't >> everything all run together no matter how many threads are running? >> >> Thanks!!! I will let you know about the multisegment envelope... >> >> Best, >> >> Mike >> >> >> On 3/28/08 12:55 PM, "jsyn@music.columbia.edu" >> wrote: >> >>>> Duly noted, I will be more careful next time. Nonetheless, >>>> I checked and they are both cranking out the same values. >>> Are you saying that ((A/B)*C) == (A/(B*C)) >>> That should not be true unless A==0 or C==1. >>> >>> >>>> As I said, the problem gets worse the longer I set the envelope. When the >>>> envelope is short (say 10 to 30 seconds), it is accurate. When it is very >>>> long as in the printouts above (from a 5 minute test) the problem gets >>>> worse. Eventually this will be running at lengths of 45 minutes! >>> >>> That may be an important clue. The envelopes were designed to run fairly >>> quickly. I used single precision floating point to avoid taxing the >>> wimpy processors we had back in 1996. Maybe 32 bit floats are not >>> precise enough for the slow ramps. >>> >>> The phase increment is calculated as >>> >>> phaseInc = 1.0 / (sampleRate * duration); >>> >>> For 5 minutes at 44100 Hz that is 0.00000007559 >>> >>> That may be fine if we are adding it to zero. But if we add it to 0.8 >>> then 32 bit floats may not be precise enough. >>> >>> I may consider converting the internal engine to double precision. That >>> will take more CPU time. (Are JSyn user often running out of CPU time?) >>> >>> If this is indeed the problem then you can work around it by creating >>> envelopes with multiple segments with smaller duration. >>> >>> Or you can run threads that do more frequent updating of parameters >>> rather than just creating a huge circuit in the init() method. >>> Ultimately that will be more flexible. >>> >>> Thank you, >>> Phil Burk >>> --------------------------------------- >>> SoftSynth, Audio Research and Development >>> http://www.softsynth.com/ >>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>> Phone/FAX: 1-415-453-4320 >>> --------------------------------------- >>> >>> >>> jsyn@music.columbia.edu wrote: >>>> Thanks Phil, >>>> >>>> Duly noted, I will be more careful next time. Nonetheless, I checked and >>>> they are both cranking out the same values. >>>> >>>> However, strangely enough, now, after my computer has been asleep all >>>> night, >>>> I am getting kind of the opposite problem in that it now seems like the >>>> envelope is moving faster. (????) >>>> >>>> I am printing running values. Synth tick counts are moving at a constant >>>> rate, but envelope output is not... >>>> >>>> For example, envelope output at tick 195496 should be 0.8571428571428571 >>>> >>>> Here are some print outs... >>>> >>>> At the beginning difference in envelope output approx. every tenth of a >>>> second is approx. .0003288 >>>> >>>> 0.0011362528894096613 18544 >>>> 0.0014650519005954266 18612 >>>> 0.0017938509117811918 18680 >>>> >>>> Approaching tick 195496, difference is approx. .0002594 and is nowhere near >>>> the 0.8571428571428571 target value that it should be at... >>>> >>>> 0.8093692660331726 195412 >>>> 0.8096286058425903 195480 >>>> 0.8098880052566528 195548 >>>> 0.8101474046707153 195616 >>>> 0.8104068040847778 195684 >>>> >>>> As I said, the problem gets worse the longer I set the envelope. When the >>>> envelope is short (say 10 to 30 seconds), it is accurate. When it is very >>>> long as in the printouts above (from a 5 minute test) the problem gets >>>> worse. Eventually this will be running at lengths of 45 minutes! >>>> >>>> Is it possible that these are out of sync? I guess it is hard for me to >>>> tell >>>> which one is wrong, the tick count or the envelope output (it is probably >>>> me!!!), but in the prints the count is staying constant. >>>> >>>> Is the envelope an audio routine? If so, it should be spot on right? >>>> >>>> Thanks for all your help!!! Hope we can figure this out... >>>> >>>> Best, >>>> >>>> Mike >>>> >>>> >>>> >>>> >>>> On 3/28/08 11:14 AM, "jsyn@music.columbia.edu" >>>> wrote: >>>> >>>>>> Is that not what is happening? >>>>> I don't know. I never rely on operator precedence. I always make the >>>>> order explicit using parentheses. Then I know exactly what the compiler >>>>> is doing. >>>>> >>>>> >>>>> Thank you, >>>>> Phil Burk >>>>> --------------------------------------- >>>>> SoftSynth, Audio Research and Development >>>>> http://www.softsynth.com/ >>>>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>>>> Phone/FAX: 1-415-453-4320 >>>>> --------------------------------------- >>>>> >>>>> >>>>> jsyn@music.columbia.edu wrote: >>>>>> Hey Phil, >>>>>> >>>>>> I definitely mean the latter case: >>>>>> >>>>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>>>> >>>>>> Is that not what is happening? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Mike >>>>>> >>>>>> >>>>>> On 3/28/08 10:28 AM, "jsyn@music.columbia.edu" >>>>>> wrote: >>>>>> >>>>>>> Hello Mike, >>>>>>> >>>>>>>> the envelope seems to move faster that the >>>>>>>> corresponding ticks and it accumulates over time. >>>>>>>> Maybe I am calculating something wrong... >>>>>>> I'm a little worried about the implicit ordering of operators in this >>>>>>> line: >>>>>>> >>>>>>>> int startTick = (int) (advanceTime + (Rise.TOTAL_DUR / >>>>>>>> (Rise.VOICES-1.) * i * Synth.getTickRate())); >>>>>>> Do you mean: >>>>>>> >>>>>>> (Rise.TOTAL_DUR / ((Rise.VOICES-1.)*i*Synth.getTickRate())) >>>>>>> >>>>>>> or >>>>>>> >>>>>>> ( (Rise.TOTAL_DUR/(Rise.VOICES-1.)) * i * Synth.getTickRate()) >>>>>>> >>>>>>> Thank you, >>>>>>> Phil Burk >>>>>>> --------------------------------------- >>>>>>> SoftSynth, Audio Research and Development >>>>>>> http://www.softsynth.com/ >>>>>>> 75 Pleasant Lane, San Rafael, CA, 94901 USA >>>>>>> Phone/FAX: 1-415-453-4320 >>>>>>> --------------------------------------- >>>>>>> _______________________________________________ >>>>>>> JSyn mailing list >>>>>>> JSyn@music.columbia.edu >>>>>>> To change digest mode or to make other administrative changes visit: >>>>>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>>>> >>>>>> _______________________________________________ >>>>>> JSyn mailing list >>>>>> JSyn@music.columbia.edu >>>>>> To change digest mode or to make other administrative changes visit: >>>>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> JSyn mailing list >>>>> JSyn@music.columbia.edu >>>>> To change digest mode or to make other administrative changes visit: >>>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>> ------------------------------------------------- >>>> PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! >>>> SORRY FOR THE INCONVENIENCE... >>>> >>>> michael winter >>>> mwinter@unboundedpress.org >>>> www.unboundedpress.org >>>> >>>> >>>> _______________________________________________ >>>> JSyn mailing list >>>> JSyn@music.columbia.edu >>>> To change digest mode or to make other administrative changes visit: >>>> http://music.columbia.edu/mailman/listinfo/jsyn >>>> >>>> >>> _______________________________________________ >>> JSyn mailing list >>> JSyn@music.columbia.edu >>> To change digest mode or to make other administrative changes visit: >>> http://music.columbia.edu/mailman/listinfo/jsyn >> >> ------------------------------------------------- >> PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! >> SORRY FOR THE INCONVENIENCE... >> >> michael winter >> mwinter@unboundedpress.org >> www.unboundedpress.org >> >> >> _______________________________________________ >> JSyn mailing list >> JSyn@music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn >> >> > _______________________________________________ > JSyn mailing list > JSyn@music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn ------------------------------------------------- PLEASE NOTE MY NEW EMAIL ADDRESS (and website)!!! SORRY FOR THE INCONVENIENCE... michael winter mwinter@unboundedpress.org www.unboundedpress.org From jsyn at music.columbia.edu Fri Mar 28 20:10:49 2008 From: jsyn at music.columbia.edu (jsyn@music.columbia.edu) Date: Fri Mar 28 20:11:10 2008 Subject: [jsyn] Wire problem: can't connect objects on OSX 10.5 In-Reply-To: <20080328230743.DA8881A01AF9B@music.columbia.edu> References: <20080328230743.DA8881A01AF9B@music.columbia.edu> Message-ID: <50E95C54-3148-4C70-A5E0-0197015F692B@gmail.com> Hi, I'm having a problem with Wire where I can't connect objects together. Patch cables do not appear when I drag. I can add objects, but not connect them. I'm using the .zip distribution of Wire from the softsynth site. Is anyone else having this problem? thanks, Peter McCulloch