From jsyn at music.columbia.edu Thu Oct 1 12:14:22 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 1 Oct 2009 09:14:22 -0700 Subject: [jsyn] New user intro and a question about sample reader Message-ID: Hello all, First let me say that I am very pleased with the JSyn package and I am glad that this mailing list exists to help neophytes such as myself get better aquainted with the wide array of features. My name is Joel, and I am currently a student at Cal State San Bernardino. I am a Computer Systems major with an interdisciplinary minor in Recording Arts and am currently working on my Undergraduate Project which I hope to have completed by the end of the Fall quarter. My project is a java app that emulates a theremin using the Wii remote as an input device. Some similar work has been done in this area, but I believe by using JSyn I will be the first to incorporate a built in synth capability. For those who are interested in more details, I maintain a blog at http://www.mojosdojo.com and I will be updating the progress of the project there as strides are made. And certainly any suggestions, questions, or pointers are welcome and appreciated. In any event, this is my first time using Java for anything as well as JSyn, so I have a multitude of questions lined up, but I will try to work through these more until I am absolutely sure I have hit the wall on a given issue. That said, I do have an opening question related to sample reading. In addition to the theremin aspect of my project, I am trying to include a DJ type of application as well, as that is part of my musical background. A previous post to this list inquired about "scratching" a sample and that is indeed one of the features I am trying to incorporate. I followed the instructions in that post and am using an exponential lag to trigger a synthtable and the input value is coming from an angle calculated by mouse coords (for now I am just using the mouse as input). And conceptually this is working as I am able to move forwards and backwards in the sample as expected. Unfortunately, I am hearing a high pitched "warble" sound as I move back and forth, and there is nothing like that in the original wav file I am using. I even tried a couple of different wave files, but I am getting the same effect. I was curious if this may be a result of the exponential lag? Or if anyone has any idea why this might be occurring or offer an alternative means to accomplish what I am trying to accomplish. I read about using an envelope to trigger the wavetable, but not sure how to go about that. Here is the relevant method if it helps; apologies in advance for the messy code and the long-winded post. public void mouseMoved(MouseEvent event) { Deck.update(event.getX(), event.getY()); double x = event.getX(); double y = event.getY(); Deck.update2(event.getX(), event.getY(), getWidth()-event.getX(), getHeight()-event.getY()); double x1 = event.getX(); double y1 = event.getY(); double x2 = getWidth()-event.getX(); double y2 = getHeight()-event.getY(); double circx1, circy1, circx2, circy2, r, z; r=250; if (point == null) { point = new Point2D.Double(x, y); } else { point.x = x; point.y = y; } double XX = (256-x1); double YY = (256-y1); z = Math.atan2(YY, XX); angle = z * (180/Math.PI); circx1 = 256+r*Math.cos(angle*Math.PI/180); circy1 = 256+r*Math.sin(angle*Math.PI/180); if (line == null) { line = new Line2D.Double(x1, y1, x2, y2); } else { line.x1 = circx1 ; line.y1 = circy1 ; line.x2 = getHeight() - circx1; line.y2 = getWidth() - circy1; } double position = angle/90; //90 is arbitrary; can be changed to reflect different resolutions Deck.updateLine(line,angle,position); Deck.updatePoint1(point); repaint(); Deck.lagUnitS.input.set(position); Deck.lagUnitS.output.connect(Deck.trigger.input); //trigger is my synthtable which I loaded with the sample from filestream. } } Kind regards, Joel _________________________________________________________________ Hotmail? has ever-growing storage! Don?t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009 From jsyn at music.columbia.edu Thu Oct 1 14:53:27 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 01 Oct 2009 11:53:27 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AC4FAA7.3030307@softsynth.com> Hello Joel, Thanks for the feedback on JSyn. Welcome aboard. > inquired about "scratching" a sample and that is indeed one of the > features I am trying to incorporate. I followed the instructions in > that post and am using an exponential lag to trigger a synthtable and > the input value is coming from an angle calculated by mouse coords -- > Unfortunately, I am hearing a high pitched "warble" sound as I move I can't hear it so I am not certain. But there are two potential problems here. Loading a SynthTable with a sample and using a moving index is a good way to "scratch". But you need to be careful that you do not move too fast. If you go too fast then you are under-sampling the waveform. If the waveform has high harmonics then you can easily push them over the Nyquist rate and get aliasing. This will sound like digital grunge. One way to reduce this is to use a sample recorded at a high sample rate. Also you can limit the rate at which you move in the sample. The ExponantialLag could cause "warbling" because each time you update it the lag will start moving quickly then slow down as it approaches the target. This will sound like a sharp increase then a slow drop in pitch. Consider using other functions to drive the SynthTable. Try using a LinearLag and set the time value to be slightly longer than your update period so the lag will not stop moving accidentally. Or consider using an IntegrateUnit. The "input" to the unit is the speed to move, plus or minus. You will need to look at the output and then set the input appropriately to chase the Theremin positions. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- From jsyn at music.columbia.edu Thu Oct 1 19:45:29 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 1 Oct 2009 16:45:29 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: <4AC4FAA7.3030307@softsynth.com> References: Message-ID: Thanks Phil, I will experiment with Linear Lag and let you know the results shortly. Also, are there any plans to incorporate MP3 as a file format and/or is there a way to work with this format natively within JSyn? Appreciatively, Joel _________________________________________________________________ Lauren found her dream laptop. Find the PC that?s right for you. http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290 From jsyn at music.columbia.edu Thu Oct 1 20:20:31 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 01 Oct 2009 17:20:31 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AC5474F.1000306@softsynth.com> JSyn cannot operate directly on compressed MP3 data. But JSyn is in Java so you can use any other Java tools with JSyn. For MP3 I recommend the JavaZoom decoder. http://www.javazoom.net/javalayer/javalayer.html You can decode MP3 and then use the uncompressed data with JSyn. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- jsyn at music.columbia.edu wrote: > Thanks Phil, > > > I will experiment with Linear Lag and let you know the results shortly. Also, are there any plans to incorporate MP3 as a file format and/or is there a way to work with this format natively within JSyn? > > > > Appreciatively, > > > > Joel > > _________________________________________________________________ > Lauren found her dream laptop. Find the PC that?s right for you. > http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290 > _______________________________________________ > JSyn mailing list > JSyn at 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 Mon Oct 12 21:14:28 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Mon, 12 Oct 2009 18:14:28 -0700 Subject: [jsyn] JSyn problem on 64-bit Snow Leopard Message-ID: <4AD3D474.5040303@softsynth.com> This email describes a workaround for the broken JSyn native library on Snow Leopard. If you install Snow Leopard then it will delete the old Java 1.5 and use the new and improved Java 1.6. (They even changed the symlinks for Java 1.5 so they point to Java 1.6. So you might select Java 1.5 and still get Java 1.6!) Unfortunately Java 1.6 defaults to 64-bit mode and the JSyn native code does not support 64-bit mode. You will get an error in the Java Console like this: libJSynV144.jnilib: no matching architecture in universal wrapper I have been working on converting the JSyn native code to 64-bit but it is not easy. I finally got PortAudio working on 64-bit. But the CSyn native code was started in 1997 and 64-bit pointers were not on my radar. It will be non-trivial to port. In the meantime we are progressing rapidly with a *pure Java* version of JSyn. This means no more native code, no plugins, no "porting" to Linux or other platforms. JSyn will just work on all platforms that support Java and JavaSound. Aaahhhh. It is not clear whether we will get the pure Java version or the 64-bit native version working first. But in the meantime you need a workaround to run JSyn on Snow Leopard. This problem affects many applications so folks have posted a workaround here: http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard Basically you download and install Java 1.5 then restore the symbolic links. It requires shell access and some comfort with Unix. It will help you get JSyn working in Eclipse and Safari. It is not much help for casual user of JSyn Applets. In addition to their instructions I also had to select the Java 1.5.0 JRE in Eclipse and fixed an additional symlink: cd /System/Library/Frameworks/JavaVM.framework/Versions/ sudo rm 1.5 sudo ln -s 1.5.0 1.5 If you do much Java development then this will allow you to test Java code under both Java 1.5 and Java 1.6. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- From jsyn at music.columbia.edu Tue Oct 13 13:47:53 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Tue, 13 Oct 2009 10:47:53 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: <4AC5474F.1000306@softsynth.com> References: Message-ID: Hi Phil, Thanks for the reponse, I have a few more questions. 1. With regards to "scratching" - I have experimented with both Linear Lag and Integrate Unit and am still hearing "artifacts" as I move through the sound. I have even tried a high quality sample. are there any other ways to accomplish moving through the sample? Someone in an earlier thread mentioned using an envelope player to read the table... but notr sure how I would go about doing this. 2. Also, if I stick with Integrate Unit, and I want to make the input variable dynamic to match variable length user dhosen wav files, what parameter from a sample does this line up with? Is it length in time, number of frames? 3. I am also having difficulties with using envelopes on the "theremin/synth" side. I am using Exponential Lag with my oscillator to achieve a smoother glissando effect as I slide through notes, but I want to make ADSR variable so the user could customize the waveform timbre a bit. So, I figured an envelope player would be the best way to do this, but do I connect the envplayer output to osc.amplitude? (Which I've tried but seems to have no effect) Or to the Lagunit input? Or am I missing the boat entirely here? I've tried several different configurations with no results so far... Any advice on these issues would be greatly appreciated. Regards, Joel > Date: Thu, 1 Oct 2009 17:20:31 -0700 > To: jsyn at music.columbia.edu > From: jsyn at music.columbia.edu > Subject: Re: [jsyn] New user intro and a question about sample reader > > JSyn cannot operate directly on compressed MP3 data. But JSyn is in Java > so you can use any other Java tools with JSyn. > > For MP3 I recommend the JavaZoom decoder. > > http://www.javazoom.net/javalayer/javalayer.html > > You can decode MP3 and then use the uncompressed data with JSyn. > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Office: +1-415-453-4320 > Mobile: +1-415-846-4370 > FAX: +1-415-373-4428 > --------------------------------------- > > > jsyn at music.columbia.edu wrote: > > Thanks Phil, > > > > > > I will experiment with Linear Lag and let you know the results shortly. Also, are there any plans to incorporate MP3 as a file format and/or is there a way to work with this format natively within JSyn? > > > > > > > > Appreciatively, > > > > > > > > Joel > > > > _________________________________________________________________ > > Lauren found her dream laptop. Find the PC that?s right for you. > > http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290 > > _______________________________________________ > > JSyn mailing list > > JSyn at 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 at music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn _________________________________________________________________ Hotmail: Free, trusted and rich email service. http://clk.atdmt.com/GBL/go/171222984/direct/01/ From jsyn at music.columbia.edu Wed Oct 14 20:46:16 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Wed, 14 Oct 2009 17:46:16 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: Hello all, I managed to sort out the Envelope questions, for the most part, and have now set up ADSR customizability in my app. I am using an envelopePlayer to modify oscillator.amplitude; however I still want the user to be able to dynamically adjust amplitude for volume control. In other words, I want the envelope to still happen but, the over all amplituded to be adjustable by the user based on hand movement along the Y-axis. What is the best way I can accomplish this? Also, any additional assistance on the previous scratching questions would be greatly appreciated. Thanks, Joel _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. http://clk.atdmt.com/GBL/go/171222986/direct/01/ From jsyn at music.columbia.edu Wed Oct 14 20:58:12 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Wed, 14 Oct 2009 17:58:12 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD673A4.6090004@softsynth.com> > I still want > the user to be able to dynamically adjust amplitude for volume > control. In other words, I want the envelope to still happen but, the > over all amplituded to be adjustable by the user based on hand > movement along the Y-axis. You can multiply as many amplitude controllers together as you wish. One way is to use a chain of MultiplyUnits. But EnvelopePlayer has an amplitude port, which is an internal multiplier. For example in your case: envPlayer.output.connect( osc.amplitude ); then, based on Y movement of the user: envPlayer.amplitude.set( userLevel ); > Also, any additional assistance on the previous scratching questions > would be greatly appreciated. Sorry I overlooked your earlier email. I'll go back to it. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- From jsyn at music.columbia.edu Wed Oct 14 21:14:09 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Wed, 14 Oct 2009 18:14:09 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD67761.2090306@softsynth.com> > 1. With regards to "scratching" - I have experimented with both > Linear Lag and Integrate Unit and am still hearing "artifacts" as I > move through the sound. I have even tried a high quality sample. are > there any other ways to accomplish moving through the sample? You will always hear aliasing artifacts if you move too quickly through a sound. Do the artifacts only occur when you move fast? > 2. Also, if I stick with Integrate Unit, and I wan to make the input > variable dynamic to match variable length user chosen wav files, what > parameter from a sample does this line up with? Is it length in time, > number of frames? Suppose FR = JSyn FrameRate, eg. 44100 The Integrator will add the input to its internal value at a rate of FR. So in one second it will move by integratorInput*FR. It will go until it hits the limits of -1.0 or +1.0. Now map that to your Sample in a SynthTable. If you have a sample containing scratchSampleCount samples: samplesScratchedPerSecond = integratorInput * FR * scratchSampleCount / 2; Try to keep samplesScratchedPerSecond to less than the Nyquist at FR/2. So keep integratorInput < (1/scratchSampleCount) Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- From jsyn at music.columbia.edu Wed Oct 14 21:16:15 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Wed, 14 Oct 2009 21:16:15 -0400 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD677DF.9020508@mail.rockefeller.edu> Hello Joel jsyn at music.columbia.edu wrote: > 1. With regards to "scratching" - I have experimented with both Linear Lag and Integrate Unit and am still hearing "artifacts" as I move through the sound. I have even tried a high quality sample. are there any other ways to accomplish moving through the sample? Someone in an earlier thread mentioned using an envelope player to read the table... but notr sure how I would go about doing this. > I've done a fair amount of this myself without artifacts. But I don't know what you're hearing, what the circuit design is, or what your input sample is. Can you post the most relevant source code? Maybe there's something in your design that someone here will pick out as problematic.. Thanks Nick Didkovsky From jsyn at music.columbia.edu Wed Oct 14 23:10:25 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Wed, 14 Oct 2009 20:10:25 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: <4AD677DF.9020508@mail.rockefeller.edu> References: Message-ID: Thanks all for the responses. Phil, Yes, I am moving through the sample fairly rapidly, unfortunately, this is the nature of scratching... If you can think of any alternatives that can work around this... Nick, Here is what I have so far, I think these are the relevant methods(messy code, I know): public void getSample() { try { stream = (InputStream) (new FileInputStream(scratchSample.sampleFile)); sampleTable = new SynthTable(); trigger = new WaveShaper(); // Use the correct sample class depending on the file type, "*.aiff" or "*.wav". switch( SynthSample.getFileType( scratchSample.sampleFile.toString() ) ) { case SynthSample.AIFF: sample= new SynthSampleAIFF(); break; case SynthSample.WAV: sample = new SynthSampleWAV(); break; default: SynthAlert.showError(this, "Unrecognized sample file suffix."); break; } short shrtData[] = sample.loadShorts( stream, true ); if( shrtData != null ) { sampleTable.allocate( shrtData.length ); sampleTable.write( shrtData ); } stream.close(); trigger.tablePort.setTable(sampleTable); } catch( IOException e ) { SynthAlert.showError(this,e); } } public void mouseEntered(MouseEvent e) { Deck.lagUnitS.start(); //Using Linear Lag Deck.mixer.start(); Deck.lineOut.start(); Deck.IUnit.start(); //Using Integrate Unit getSample(); trigger.start(); trigger.input.connect(Deck.IUnit.output); } public void mouseMoved(MouseEvent event) { Deck.update(event.getX(), event.getY()); double x = event.getX(); double y = event.getY(); Deck.update2(event.getX(), event.getY(), getWidth()-event.getX(), getHeight()-event.getY()); double x1 = event.getX(); double y1 = event.getY(); double x2 = getWidth()-event.getX(); double y2 = getHeight()-event.getY();   double circx1, circy1, circx2, circy2, r, z; r=250; if (point == null) { point = new Point2D.Double(x, y); } else { point.x = x; point.y = y; } double XX = (256-x1); double YY = (256-y1); z = Math.atan2(YY, XX); angle = z * (180/Math.PI); circx1 = 256+r*Math.cos(angle*Math.PI/180); circy1 = 256+r*Math.sin(angle*Math.PI/180); if (line == null) { line = new Line2D.Double(x1, y1, x2, y2); } else { line.x1 = circx1 ; line.y1 = circy1 ; line.x2 = getHeight() - circx1; line.y2 = getWidth() - circy1; } double position = angle/180; Deck.updateLine(line,angle,position); Deck.updatePoint1(point); repaint(); //Using Integrate Unit //Deck.IUnit.input.set(position*.0008); //Using Linear Lag Deck.lagUnitS.input.set(position); Deck.lagUnitS.output.connect(trigger.input); trigger.output.connect( 0, Deck.lineOut.input, 0 ); trigger.output.connect( 0, Deck.lineOut.input, 1 ); } } Thanks for taking a look... Joel _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. http://clk.atdmt.com/GBL/go/171222986/direct/01/ From jsyn at music.columbia.edu Thu Oct 15 11:49:38 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 15 Oct 2009 08:49:38 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: <4AD67761.2090306@softsynth.com> References: Message-ID: Thanks Phil, For this info on Framerate, I will give it a shot. And also, thanks for the info on envplayer.amplitude... I totally overlooked that. It works! And to clarify my response on speed through a sample... The speed is fairly variable. There are times when it will be fast, and times when it will be slower. Nonetheless, I hear the artifacts regardless of the speed, even if I play it at close to "normal" speed (speed of the original sample). Thanks again, Joel > Date: Wed, 14 Oct 2009 18:14:09 -0700 > To: jsyn at music.columbia.edu > From: jsyn at music.columbia.edu > Subject: Re: [jsyn] New user intro and a question about sample reader > > > > 1. With regards to "scratching" - I have experimented with both > > Linear Lag and Integrate Unit and am still hearing "artifacts" as I > > move through the sound. I have even tried a high quality sample. are > > there any other ways to accomplish moving through the sample? > > You will always hear aliasing artifacts if you move too quickly through > a sound. Do the artifacts only occur when you move fast? > > > 2. Also, if I stick with Integrate Unit, and I wan to make the input > > variable dynamic to match variable length user chosen wav files, what > > parameter from a sample does this line up with? Is it length in time, > > number of frames? > > Suppose FR = JSyn FrameRate, eg. 44100 > > The Integrator will add the input to its internal value at a rate of FR. > > So in one second it will move by integratorInput*FR. It will go until it > hits the limits of -1.0 or +1.0. > > Now map that to your Sample in a SynthTable. If you have a sample > containing scratchSampleCount samples: > > samplesScratchedPerSecond = integratorInput * FR > * scratchSampleCount / 2; > > Try to keep samplesScratchedPerSecond to less than the Nyquist at FR/2. > > So keep integratorInput < (1/scratchSampleCount) > > > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Office: +1-415-453-4320 > Mobile: +1-415-846-4370 > FAX: +1-415-373-4428 > --------------------------------------- > _______________________________________________ > JSyn mailing list > JSyn at music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn _________________________________________________________________ Hotmail: Free, trusted and rich email service. http://clk.atdmt.com/GBL/go/171222984/direct/01/ From jsyn at music.columbia.edu Thu Oct 15 12:03:31 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 15 Oct 2009 09:03:31 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD747D3.5080602@softsynth.com> Hi Nick, > Deck.lagUnitS.output.connect(trigger.input); > trigger.output.connect( 0, Deck.lineOut.input, 0 ); Don't call connect() in your mouseMoved handler. Put those up in your initialization code. A mouseMoved handler gets called very often and has to be fast. Also you only need to connect once. > Deck.lagUnitS.input.set(position); Try storing the old position and limiting the amount your new position can change in a given time. Here is some untested pseudo-code. double deltaPosition = position - oldPosition; long now = System.currentTimeMillis(); long deltaTime = now - oldTime; double velocity = deltaPosition / deltaTime; if( velocity > maxVelocity ) { // Use clipped velocity to recalculate position. deltaPosition = maxVelocity * deltaTime; position = oldPosition + deltaPosition; } else if( velocity < -maxVelocity ) { deltaPosition = -maxVelocity * deltaTime; position = oldPosition + deltaPosition; } Deck.lagUnitS.input.set(position); oldPosition = position; oldTime = now; Calculate maxVelocity based on the size of the sample. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- jsyn at music.columbia.edu wrote: > Thanks all for the responses. > > > > Phil, > > > > Yes, I am moving through the sample fairly rapidly, unfortunately, this is the nature of scratching... If you can think of any alternatives that can work around this... > > > > Nick, > > > > Here is what I have so far, I think these are the relevant methods(messy code, I know): > > > > public void getSample() { > try { > stream = (InputStream) (new FileInputStream(scratchSample.sampleFile)); > sampleTable = new SynthTable(); > trigger = new WaveShaper(); > > // Use the correct sample class depending on the file type, "*.aiff" or "*.wav". > switch( SynthSample.getFileType( scratchSample.sampleFile.toString() ) ) > { > case SynthSample.AIFF: > sample= new SynthSampleAIFF(); > break; > case SynthSample.WAV: > sample = new SynthSampleWAV(); > break; > default: > SynthAlert.showError(this, "Unrecognized sample file suffix."); > break; > } > short shrtData[] = sample.loadShorts( stream, true ); > if( shrtData != null ) > { > sampleTable.allocate( shrtData.length ); > sampleTable.write( shrtData ); > } > stream.close(); > trigger.tablePort.setTable(sampleTable); > } catch( IOException e ) { > SynthAlert.showError(this,e); > } > } > > > > public void mouseEntered(MouseEvent e) { > Deck.lagUnitS.start(); //Using Linear Lag > Deck.mixer.start(); > Deck.lineOut.start(); > Deck.IUnit.start(); //Using Integrate Unit > > getSample(); > trigger.start(); > > trigger.input.connect(Deck.IUnit.output); > } > > > > public void mouseMoved(MouseEvent event) { > Deck.update(event.getX(), event.getY()); > double x = event.getX(); > double y = event.getY(); > > Deck.update2(event.getX(), event.getY(), getWidth()-event.getX(), getHeight()-event.getY()); > double x1 = event.getX(); > double y1 = event.getY(); > double x2 = getWidth()-event.getX(); > double y2 = getHeight()-event.getY(); > >   > double circx1, circy1, circx2, circy2, r, z; > r=250; > > if (point == null) { > point = new Point2D.Double(x, y); > } else { > point.x = x; > point.y = y; > } > double XX = (256-x1); > double YY = (256-y1); > z = Math.atan2(YY, XX); > angle = z * (180/Math.PI); > > circx1 = 256+r*Math.cos(angle*Math.PI/180); > circy1 = 256+r*Math.sin(angle*Math.PI/180); > > > if (line == null) { > line = new Line2D.Double(x1, y1, x2, y2); > } else { > line.x1 = circx1 ; > line.y1 = circy1 ; > line.x2 = getHeight() - circx1; > line.y2 = getWidth() - circy1; > } > > double position = angle/180; > > Deck.updateLine(line,angle,position); > > Deck.updatePoint1(point); > repaint(); > > //Using Integrate Unit > //Deck.IUnit.input.set(position*.0008); > > > //Using Linear Lag > Deck.lagUnitS.input.set(position); > Deck.lagUnitS.output.connect(trigger.input); > trigger.output.connect( 0, Deck.lineOut.input, 0 ); > trigger.output.connect( 0, Deck.lineOut.input, 1 ); > } > > } > > > > Thanks for taking a look... > > > > Joel > > > > > _________________________________________________________________ > Hotmail: Powerful Free email with security by Microsoft. > http://clk.atdmt.com/GBL/go/171222986/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > JSyn mailing list > JSyn at 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 Thu Oct 15 12:13:49 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 15 Oct 2009 12:13:49 -0400 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD74A3D.5000800@mail.rockefeller.edu> whoah, all these connects() are happening every time the mouse moves? That's like plugging your guitar cable into the amp every time you play a note. Crackle, buzz, pop. Connect once, then leave it alone. Deck.lagUnitS.output.connect(trigger.input); trigger.output.connect( 0, Deck.lineOut.input, 0 ); trigger.output.connect( 0, Deck.lineOut.input, 1 ); Nick jsyn at music.columbia.edu wrote: > Thanks all for the responses. > > > > Phil, > > > > Yes, I am moving through the sample fairly rapidly, unfortunately, this is the nature of scratching... If you can think of any alternatives that can work around this... > > > > Nick, > > > > Here is what I have so far, I think these are the relevant methods(messy code, I know): > > > > public void getSample() { > try { > stream = (InputStream) (new FileInputStream(scratchSample.sampleFile)); > sampleTable = new SynthTable(); > trigger = new WaveShaper(); > > // Use the correct sample class depending on the file type, "*.aiff" or "*.wav". > switch( SynthSample.getFileType( scratchSample.sampleFile.toString() ) ) > { > case SynthSample.AIFF: > sample= new SynthSampleAIFF(); > break; > case SynthSample.WAV: > sample = new SynthSampleWAV(); > break; > default: > SynthAlert.showError(this, "Unrecognized sample file suffix."); > break; > } > short shrtData[] = sample.loadShorts( stream, true ); > if( shrtData != null ) > { > sampleTable.allocate( shrtData.length ); > sampleTable.write( shrtData ); > } > stream.close(); > trigger.tablePort.setTable(sampleTable); > } catch( IOException e ) { > SynthAlert.showError(this,e); > } > } > > > > public void mouseEntered(MouseEvent e) { > Deck.lagUnitS.start(); //Using Linear Lag > Deck.mixer.start(); > Deck.lineOut.start(); > Deck.IUnit.start(); //Using Integrate Unit > > getSample(); > trigger.start(); > > trigger.input.connect(Deck.IUnit.output); > } > > > > public void mouseMoved(MouseEvent event) { > Deck.update(event.getX(), event.getY()); > double x = event.getX(); > double y = event.getY(); > > Deck.update2(event.getX(), event.getY(), getWidth()-event.getX(), getHeight()-event.getY()); > double x1 = event.getX(); > double y1 = event.getY(); > double x2 = getWidth()-event.getX(); > double y2 = getHeight()-event.getY(); > >   > double circx1, circy1, circx2, circy2, r, z; > r=250; > > if (point == null) { > point = new Point2D.Double(x, y); > } else { > point.x = x; > point.y = y; > } > double XX = (256-x1); > double YY = (256-y1); > z = Math.atan2(YY, XX); > angle = z * (180/Math.PI); > > circx1 = 256+r*Math.cos(angle*Math.PI/180); > circy1 = 256+r*Math.sin(angle*Math.PI/180); > > > if (line == null) { > line = new Line2D.Double(x1, y1, x2, y2); > } else { > line.x1 = circx1 ; > line.y1 = circy1 ; > line.x2 = getHeight() - circx1; > line.y2 = getWidth() - circy1; > } > > double position = angle/180; > > Deck.updateLine(line,angle,position); > > Deck.updatePoint1(point); > repaint(); > > //Using Integrate Unit > //Deck.IUnit.input.set(position*.0008); > > > //Using Linear Lag > Deck.lagUnitS.input.set(position); > Deck.lagUnitS.output.connect(trigger.input); > trigger.output.connect( 0, Deck.lineOut.input, 0 ); > trigger.output.connect( 0, Deck.lineOut.input, 1 ); > } > > } > > > > Thanks for taking a look... > > > > Joel > > > > > _________________________________________________________________ > Hotmail: Powerful Free email with security by Microsoft. > http://clk.atdmt.com/GBL/go/171222986/direct/01/ > ------------------------------------------------------------------------ > > _______________________________________________ > JSyn mailing list > JSyn at 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 Thu Oct 15 13:30:52 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 15 Oct 2009 13:30:52 -0400 Subject: [jsyn] EchoNest Java API Message-ID: <4AD75C4C.9070302@music.columbia.edu> I've played with the Python-based EchoNest remix API a bit: http://code.google.com/p/echo-nest-remix/ I didn't realize they had a Java API as well. I'm looking forward to playing around with JSyn + EchoNest -- lots of possibilities for interesting sorts of analysis<->synthesis feedback. http://musicmachinery.com/2009/10/15/updated-java-client-for-the-echo-nest-api/ This'll be even better once the pure-Java version of JSyn emerges! douglas -- ............................................... http://artbots.org .....douglas.....irving........................ http://dorkbot.org .......................... http://music.columbia.edu/cmc/music-dsp .......... repetto............. http://music.columbia.edu/organism ........................................ http://douglasrepetto.org From jsyn at music.columbia.edu Fri Oct 16 16:00:38 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Fri, 16 Oct 2009 13:00:38 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: <4AD747D3.5080602@softsynth.com> References: Message-ID: Phil and Nick, Thanks for pointing out the connect issue during mousehandling. Makes total sense, I overlooked that. Still new to a lot of this, so forgive my ignorance on some of these things. I stuck the connections elsewhere. Also, Phil, I implemented your pseudo code and the good news is I am still able to "scratch" the sample. Unfortunately, still hearing artifacts in spite of these changes. Here's the updated code. (I used number of frames to get sample size for calculating max velocity; is that correct?) Any other suggestions appreciated. public void mouseMoved(MouseEvent event) { Deck.update(event.getX(), event.getY()); double x = event.getX(); double y = event.getY(); Deck.update2(event.getX(), event.getY(), getWidth()-event.getX(), getHeight()-event.getY()); double x1 = event.getX(); double y1 = event.getY(); double x2 = getWidth()-event.getX(); double y2 = getHeight()-event.getY(); double circx1, circy1, circx2, circy2, r, z; r=250; if (point == null) { point = new Point2D.Double(x, y); } else { point.x = x; point.y = y; } double XX = (256-x1); double YY = (256-y1); z = Math.atan2(YY, XX); angle = z * (180/Math.PI); circx1 = 256+r*Math.cos(angle*Math.PI/180); circy1 = 256+r*Math.sin(angle*Math.PI/180); if (line == null) { line = new Line2D.Double(x1, y1, x2, y2); } else { line.x1 = circx1 ; line.y1 = circy1 ; line.x2 = getHeight() - circx1; line.y2 = getWidth() - circy1; } double position = angle/180; Deck.updateLine(line,angle,position); Deck.updatePoint1(point); repaint(); //Code from Phil Burk //Calculate maxVelocity based on the size of the sample. double oldPosition = 0; long oldTime = 0; double maxVelocity = sample.getNumFrames(); double deltaPosition = position - oldPosition; long now = System.currentTimeMillis(); long deltaTime = now - oldTime; double velocity = deltaPosition / deltaTime; if( velocity > maxVelocity ){ // Use clipped velocity to recalculate position. deltaPosition = maxVelocity * deltaTime; position = oldPosition + deltaPosition; }else if( velocity < -maxVelocity ){ deltaPosition = -maxVelocity * deltaTime; position = oldPosition + deltaPosition; } Deck.lagUnitS.input.set(position); oldPosition = position; oldTime = now; Deck.lagUnitS.input.set(position); } } _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/171222985/direct/01/ From jsyn at music.columbia.edu Fri Oct 16 17:47:07 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Fri, 16 Oct 2009 14:47:07 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD8E9DB.2090005@softsynth.com> > double maxVelocity = sample.getNumFrames(); I meant that maxVelocity would be *based* on the number of frames. Not equal to the number of frames. > double deltaPosition = position - oldPosition; > long now = System.currentTimeMillis(); > long deltaTime = now - oldTime; > double velocity = deltaPosition / deltaTime; You can see that velocity is in units of angular position per millisecond. The more frames there are in a sample then the slower you need to go. maxVelocity is in angularUnits/millisecond try maxVelocity = frameRate / (1000 * sample.getNumFrames()); If that doesn't work then just keep making maxVelocity smaller until it sounds OK and you have no artifacts. Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- From jsyn at music.columbia.edu Fri Oct 16 18:20:31 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Fri, 16 Oct 2009 15:20:31 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: <4AD8E9DB.2090005@softsynth.com> References: Message-ID: Hi Phil, Well I've played with a variety of values for MaxVelocity and none seemed to make any difference. Either I am doing something else wrong, or the "artifacts" are coming from some other source. Is there a place I can send you a sound file so that you hear what I am referring to? Latest iteration snippet: double frameRate = Synth.getFrameRate(); double oldPosition = 0; long oldTime = 0; double maxVelocity = frameRate / (1000 * sample.getNumFrames()); double deltaPosition = position - oldPosition; long now = System.currentTimeMillis(); long deltaTime = now - oldTime; double velocity = deltaPosition / deltaTime; if( velocity > maxVelocity ){ // Use clipped velocity to recalculate position. deltaPosition = maxVelocity * deltaTime; position = oldPosition + deltaPosition; }else if( velocity < -maxVelocity ){ deltaPosition = -maxVelocity * deltaTime; position = oldPosition + deltaPosition; } Deck.lagUnitS.input.set(position); oldPosition = position; oldTime = now; Thanks again for all your help, Joel > Date: Fri, 16 Oct 2009 14:47:07 -0700 > To: jsyn at music.columbia.edu > From: jsyn at music.columbia.edu > Subject: Re: [jsyn] New user intro and a question about sample reader > > > > double maxVelocity = sample.getNumFrames(); > > I meant that maxVelocity would be *based* on the number of frames. Not > equal to the number of frames. > > > double deltaPosition = position - oldPosition; > > long now = System.currentTimeMillis(); > > long deltaTime = now - oldTime; > > double velocity = deltaPosition / deltaTime; > > You can see that velocity is in units of angular position per millisecond. > > The more frames there are in a sample then the slower you need to go. > > > maxVelocity is in angularUnits/millisecond > > try maxVelocity = frameRate / (1000 * sample.getNumFrames()); > > If that doesn't work then just keep making maxVelocity smaller until it > sounds OK and you have no artifacts. > > > Thank you, > Phil Burk > --------------------------------------- > SoftSynth, Audio Research and Development > http://www.softsynth.com/ > 75 Pleasant Lane, San Rafael, CA, 94901 USA > Office: +1-415-453-4320 > Mobile: +1-415-846-4370 > FAX: +1-415-373-4428 > --------------------------------------- > _______________________________________________ > JSyn mailing list > JSyn at music.columbia.edu > To change digest mode or to make other administrative changes visit: > http://music.columbia.edu/mailman/listinfo/jsyn _________________________________________________________________ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/171222985/direct/01/ From jsyn at music.columbia.edu Fri Oct 16 18:24:34 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Fri, 16 Oct 2009 18:24:34 -0400 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD8F2A2.4080507@mail.rockefeller.edu> Have you verified your circuit works without the GUI? Just drive it with a sawtooth at a low rate make sure you can hear it forwards at normal or close to normal speed without artifacts? Nick jsyn at music.columbia.edu wrote: > Hi Phil, > > > > Well I've played with a variety of values for MaxVelocity and none seemed to make any difference. Either I am doing something else wrong, or the "artifacts" are coming from some other source. Is there a place I can send you a sound file so that you hear what I am referring to? > > > > Latest iteration snippet: > > double frameRate = Synth.getFrameRate(); > double oldPosition = 0; > long oldTime = 0; > double maxVelocity = frameRate / (1000 * sample.getNumFrames()); > > double deltaPosition = position - oldPosition; > long now = System.currentTimeMillis(); > long deltaTime = now - oldTime; > double velocity = deltaPosition / deltaTime; > if( velocity > maxVelocity ){ > // Use clipped velocity to recalculate position. > deltaPosition = maxVelocity * deltaTime; > position = oldPosition + deltaPosition; > }else if( velocity < -maxVelocity ){ > deltaPosition = -maxVelocity * deltaTime; > position = oldPosition + deltaPosition; > } > Deck.lagUnitS.input.set(position); > oldPosition = position; > oldTime = now; > > > > Thanks again for all your help, > > > > Joel > > >> Date: Fri, 16 Oct 2009 14:47:07 -0700 >> To: jsyn at music.columbia.edu >> From: jsyn at music.columbia.edu >> Subject: Re: [jsyn] New user intro and a question about sample reader >> >> >> >>> double maxVelocity = sample.getNumFrames(); >>> >> I meant that maxVelocity would be *based* on the number of frames. Not >> equal to the number of frames. >> >> >>> double deltaPosition = position - oldPosition; >>> long now = System.currentTimeMillis(); >>> long deltaTime = now - oldTime; >>> double velocity = deltaPosition / deltaTime; >>> >> You can see that velocity is in units of angular position per millisecond. >> >> The more frames there are in a sample then the slower you need to go. >> >> >> maxVelocity is in angularUnits/millisecond >> >> try maxVelocity = frameRate / (1000 * sample.getNumFrames()); >> >> If that doesn't work then just keep making maxVelocity smaller until it >> sounds OK and you have no artifacts. >> >> >> Thank you, >> Phil Burk >> --------------------------------------- >> SoftSynth, Audio Research and Development >> http://www.softsynth.com/ >> 75 Pleasant Lane, San Rafael, CA, 94901 USA >> Office: +1-415-453-4320 >> Mobile: +1-415-846-4370 >> FAX: +1-415-373-4428 >> --------------------------------------- >> _______________________________________________ >> JSyn mailing list >> JSyn at music.columbia.edu >> To change digest mode or to make other administrative changes visit: >> http://music.columbia.edu/mailman/listinfo/jsyn >> > > _________________________________________________________________ > Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. > http://clk.atdmt.com/GBL/go/171222985/direct/01/ > _______________________________________________ > JSyn mailing list > JSyn at 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 Oct 16 19:41:18 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Fri, 16 Oct 2009 16:41:18 -0700 Subject: [jsyn] New user intro and a question about sample reader In-Reply-To: References: Message-ID: <4AD9049E.3060106@softsynth.com> OK, send me a WAV sample. You have my email address. > Deck.lagUnitS.input.set(position); What did you set the lags time port to? Try: Deck.lagUnitS.time.set(0.1); Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 --------------------------------------- From jsyn at music.columbia.edu Thu Oct 22 18:32:25 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 22 Oct 2009 15:32:25 -0700 Subject: [jsyn] State Variable Filter In-Reply-To: <4AD9049E.3060106@softsynth.com> References: Message-ID: Hello all, Thanks for the previous responses to my questions. I have a new question about the State Variable Filter. I am planning to incorporate this and would like to make the Cutoff Frequency and Resonance adjustable like on an old analogue synth. Is there a relationship between the frequency of the notes that are played and the cutoff frequency... in other words does the cutoff frequency stay fixed or does it "move" depending on where the note is? Are there guidelines for what range the cutoff frequency should be active for for a given filter? Like for a lowPass, should the cutoff range offered to the user to adjust be bound to a certain frequency range - and what is that range? If output is used, I assume that means there is attenuation? So you could use this as an option to turn the filter off or bypass it? Thanks, Joel _________________________________________________________________ Windows 7: Simplify your PC. Learn more. http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen1:102009 From jsyn at music.columbia.edu Thu Oct 22 18:52:05 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 22 Oct 2009 15:52:05 -0700 Subject: [jsyn] State Variable Filter In-Reply-To: References: Message-ID: <4AE0E215.3070108@softsynth.com> Hello Joel, > Is there a relationship between the frequency of the notes that are > played and the cutoff frequency... in other words does the cutoff > frequency stay fixed or does it "move" depending on where the note > is? The StateVariableFilter cutoff is not directly related to a note frequency. One could use a fixed cutoff, which would sound like the notes were interacting with a fixed resonator. Or you might decide to have cutoff follow the pitch. There are no rules. > Are there guidelines for what range the cutoff frequency should be > active for for a given filter? Like for a lowPass, should the cutoff > range offered to the user to adjust be bound to a certain frequency > range - and what is that range? It is purely subjective. if you just want to control the high partials then a cutoff range of 500-5000 might be right. if you want low thumpy bass tones then 40-400 might be right. > If output is used, I assume that means there is attenuation? So you > could use this as an option to turn the filter off or bypass it? You have to use the output to hear the filter. The filter has an "amplitude" knob that can be used to attenuate the output. To bypass the filter you need to provide a signal path around the filter. Then you can mix filtered or non-filtered signal. BTW, you should use Filter_StateVariable(). StateVariableFilter is deprecated. Phil Burk SoftSynth, Audio Research and Development From jsyn at music.columbia.edu Thu Oct 22 19:15:05 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 22 Oct 2009 16:15:05 -0700 Subject: [jsyn] State Variable Filter In-Reply-To: <4AE0E215.3070108@softsynth.com> References: Message-ID: Hi Phil, Oops, yes; I am using Filter_StateVariable(). Typo on my part. So, just to be clear, if I want to use a lowPass filter(without a bypass option ofr the time being), connection would be as follows: Pseudo code: SynthOscillator.connect(filter.input) filter.lowpass.connect(lineout.input) Or do I still need filter.output connected somewhere? Thanks, Joel _________________________________________________________________ Windows 7: It works the way you want. Learn more. http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009 From jsyn at music.columbia.edu Thu Oct 22 19:43:56 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Thu, 22 Oct 2009 16:43:56 -0700 Subject: [jsyn] State Variable Filter In-Reply-To: References: Message-ID: <4AE0EE3C.1070802@softsynth.com> > oscillator.connect(filter.input) > filter.lowpass.connect(lineout.input) > Or do I still need filter.output connected somewhere? Yep. That will work fine for hearing a filtered oscillator. If you want to use the amplitude port then use: filter.output.connect(lineout.input) filter.amplitude.set(0.234); That is because output = amplitude * lowpass Phil From jsyn at music.columbia.edu Fri Oct 23 19:18:40 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Fri, 23 Oct 2009 16:18:40 -0700 Subject: [jsyn] Interpolating Delay for Chorus/Flange In-Reply-To: <4AE0EE3C.1070802@softsynth.com> References: Message-ID: Hi Phil, Thanks for your previous response on filters... I think I have nailed that down and am now on to my next challenge. I would like to offer chorus and flange effects. I see that your Interpolating Delay Unit says that it can be used for this type of effect. I think I am on to something, but I am not quite getting it to sound the way I expect. Here is some pseudo code to show how I am trying to implement: sineOsc1.output.connect(iDelay.delay); //used like an LFO triOsc3.output.connect(iDelay.input); triOsc3.output.connect(adder.inputA); iDelay.output.connect( adder.inputB); adder.output.connect(mixer.inputA); adder.output.connect(mixer.inputB); mixer.output.connect( 0, lineOut.input, 0 ); mixer.output.connect( 0, lineOut.input, 1 ); triOsc3.amplitude.set(0.5); I have the triOsc3.frequency assigned to a port fader to control pitch, and sineOsc1 freq and amp assigend to two other faders to control the depth and rate of the chorus/flange. Am I on the right track? Thanks again, Joel _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://www.microsoft.com/windows/pc-scout/default.aspx?CBID=wl&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_pcscout:102009 From jsyn at music.columbia.edu Sat Oct 24 14:38:51 2009 From: jsyn at music.columbia.edu (jsyn at music.columbia.edu) Date: Sat, 24 Oct 2009 11:38:51 -0700 Subject: [jsyn] Interpolating Delay for Chorus/Flange In-Reply-To: References: Message-ID: <4AE349BB.9020103@softsynth.com> To make a flanger or chorus you need to have positive delay that is slightly modulated. > sineOsc1.output.connect(iDelay.delay); //used like an LFO That direct connection won't work because the output of the sineOsc will go negative. Use an AddUnit to add some constant reasonable center value for the delay. Add that constant to the sineOsc and set the sineOsc amplitude below your center delay value so you don't go negative. sineOsc.output -> adder -> iDelay.delay Thank you, Phil Burk --------------------------------------- SoftSynth, Audio Research and Development http://www.softsynth.com/ 75 Pleasant Lane, San Rafael, CA, 94901 USA Office: +1-415-453-4320 Mobile: +1-415-846-4370 FAX: +1-415-373-4428 ---------------------------------------