From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #322 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Saturday, July 14 2001 Volume 01 : Number 322 ---------------------------------------------------------------------- Date: Thu, 12 Jul 2001 07:50:12 -0500 From: James McCartney <---@---.---> Subject: Re: Dictionary on 7/12/01 5:26 AM, fabrice mogini at fabrice.mogini@virgin.net wrote: > By the way, I do get your messages in an "Echo" manner. That is because he sent it to you directly and to the list. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Thu, 12 Jul 2001 07:45:02 -0700 From: Phthalocyanine <---@---.---> Subject: Re: FFT Sorry if there have been a bunch of replies to this I didn't notice but there is one "swinger~" object in Max which does some kind of phase modulation and I know it was done with the FFTease objects-who's that? Eric Lyon? Anyway, my 2 cents worth... Dimitri ------------------------------ Date: Thu, 12 Jul 2001 10:11:36 -0700 From: "tomonori yamasaki" <---@---.---> Subject: Re: FFT cool. polar. > on 7/12/01 8:59 AM, Takeko KAWAMURA at tn800@iamas.ac.jp wrote: > >> Hello! >> >> I'm studying FFT. >> I read "the computer music tutorial" written by Curtis Roads, >> and found following interesting text... >> >> -------------------------------------------------- >> Another type of cross-synthesis uses the magnitude functions from one sound >> with the phase function of another sound to create a hybrid sound effect >> (Boyer and Kronland-Martinet 1989). >> -------------------------------------------------- >> >> I want to program like above. >> But I have a question. >> How to get magnitude func and phase func from FFT? >> >> thanks. >> Takeko Kawamura >> tn800@iamas.ac.jp >> > > The code below will do it. > > You can also try multiplying magnitudes for further spectral fun... > > Scott > > ( > // Scott Wilson, created ZKM, 12.04.01 > > var file1, file2, orig, compressed, numChan; > > // load files, original first > file1 = SoundFile.new; > orig = GetFileDialog.new.path; > file1.readHeader(orig); > file2 = SoundFile.new; > compressed = GetFileDialog.new.path; > file2.readHeader(compressed); > > numChan = file1.numChannels.max(file2.numChannels); > > Synth.record({ > var fftsize, numffts, fftoffsets, window, cosineTable; > var src1, src2; > > numffts = 2; // number of overlapped FFTs ( you can change this > to 4 (or any integer > 0)) > fftsize = 2048; // length of FFT buffer > > // make offsets for staggering overlapped FFTs > fftoffsets = Array.series(numffts, 0, fftsize/numffts); > > window = Signal.hanningWindow(fftsize); > cosineTable = Signal.fftCosTable(fftsize); > > src1 = DiskIn.ar(file1, true); > src2 = DiskIn.ar(file2, true); > > Array.fill(numChan, { arg i; > var in1, in2, fft1, fft2, fft3, ifft, out; > > if (file1.numChannels ==1, { in1 = src1; }, { in1 = src1@i; }); > if (file2.numChannels ==1, { in2 = src2; }, { in2 = src2@i; }); > > fft1 = FFT.a2sr(fftsize, fftoffsets, cosineTable, window, nil, in1, > 0.0); // transform src1 > fft2 = FFT.a2sr(fftsize, fftoffsets, cosineTable, window, nil, in2, > 0.0); // transform src2 > > fft3 = Polar.new(fft1.magnitude, fft2.angle).asComplex; > > // inverse transform > ifft = IFFT.s2ar(cosineTable, nil, window, fft3.real, fft3.imag); > out = Mix.ar(ifft.real) * 0.25; // mix overlapped outputs > > out = out/(2*numffts); > out * 0.5;}); > }, (file1.duration) max: (file2.duration), > PutFileDialog.new.path); > ) > ------------------------------ Date: Thu, 12 Jul 2001 21:39:45 +0100 From: Joanna mayes <---@---.---> Subject: Re: Multichannel out That certainly is cheaper but not sure it's cheap enough right now though!...no replies yet about older options - did you use anything before this? Cheers Jo > From: Jem Finer <---@---.---> > Reply-To: sc-users@lists.io.com > Date: Thu, 12 Jul 2001 09:08:48 +0000 > To: > Subject: Re: Multichannel out > > Well I wrote it for an early version so it probably needs a tweak. Thomman > charge £12 delivery - cheaper than a trip to Berlin - unless you're going > there anyway. > > > thomann > > Mail order hotline ! > 0049 9546 9223 55 > > ivan@thomann.de > > www.thomann.de > > > > motu 828 £635 + £12 postage order #146358 > > > Cheers > > > Jem > > >> A feel a Berlin trip coming on. Thanks Jem. By the way, I really like the >> flasher patch - only thing is that it crashes SC (3) when it's finished and >> turns off my control strip...answers on a postcard please... >> Cheers >> Jo >> >>> From: Jem Finer <---@---.---> >>> Reply-To: sc-users@lists.io.com >>> Date: Wed, 11 Jul 2001 10:45:05 +0000 >>> To: >>> Subject: Re: Multichannel out >>> >>> on 11/7/01 10:09, Joanna mayes at joannamayes@onetel.net.uk wrote: >>> >>>> Hi all, >>>> Does anyone have any cheaper solutions for multichannel out from a G3 333 >>>> powerbook (SCSSI & USB) than the new firewire MOTU? What has everyone been >>>> using before this? >>>> >>>> Any ideas gratefully received. >>>> >>>> Cheers >>>> Jo >>>> Dartington College of Arts, Devon, England! >>>> >>>> PS great to meet some of you at the Norwich conference and thanks for >>>> sharing your ideas >>>> >>>> >>> >>> >>> I got my MOTU 828 from Germany - Thomman - a lot cheaper than in the UK >>> >> >> > ------------------------------ Date: Thu, 12 Jul 2001 23:44:41 +0200 From: Roland Pfrengle <---@---.---> Subject: Plug/env-problem Hi, very basic problem - can't help. simplified code: ( var a,b,e, w, box1,gate; w = GUIWindow.new("panel", Rect.new( 128, 64, 288, 164 )); box1 = CheckBoxView.new( w, Rect.new( 18, 15, 146, 35 ), "",0,0,1,0); Synth.play({ gate = LFPulse.kr(0.5,0); a = Env.perc(0,1,1,0); b = Env.perc(1,0,1,0); e = Plug.kr(a); thisSynth.repeat(0, 0.2, { if (box1.value == 0, {e.source = a},{e.source = b}); }); PanAz.ar(4,LFSaw.ar(300,0.2),EnvGen.kr(e,1,0,1,0,1,gate),1,2); }); w.close; € ERROR: EnvGen: env not of class Env. ) Thanks for a short note Roland ------------------------------ Date: Thu, 12 Jul 2001 17:16:13 -0500 From: James McCartney <---@---.---> Subject: Re: Plug/env-problem on 7/12/01 4:44 PM, Roland Pfrengle at roland.p@snafu.de wrote: > e = Plug.kr(a); > thisSynth.repeat(0, 0.2, { > if (box1.value == 0, {e.source = a},{e.source = b}); > }); > PanAz.ar(4,LFSaw.ar(300,0.2),EnvGen.kr(e,1,0,1,0,1,gate),1,2); > }); > w.close; > € ERROR: EnvGen: env not of class Env. You are passing a Plug as the env argument. It has to be an Env. Plug is only for inputs that expect UGens. The env argument should be an Env data structure. Env is not a UGen. You cannot use an Env as the source of a Plug. You cannot change the env of an EnvGen while it is running. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Thu, 12 Jul 2001 17:37:16 -0500 From: James McCartney <---@---.---> Subject: Re: Plug/env-problem For this case, if you change a line in EnvGen : EnvGen : UGen { // envelope generator var <>env; // add getter and setter methods ... then you can write it as follows: ( var a,b,e, w, box1,gate; w = GUIWindow.new("panel", Rect.new( 128, 64, 288, 164 )); box1 = CheckBoxView.new( w, Rect.new( 18, 15, 146, 35 ), "",0,0,1,0); Synth.play({ gate = LFPulse.kr(0.5,0); a = Env.perc(0,1,1,0); b = Env.perc(1,0,1,0); x = PanAz.ar(4,LFSaw.ar(300,0.2), e = EnvGen.kr(a,1,0,1,0,1,gate),1,2); thisSynth.repeat(0, 0.2, { if (box1.value == 0, { e.env = a},{e.env = b}); }); x }); w.close; ) ------------------------------ Date: Thu, 12 Jul 2001 22:10:17 -0600 From: David Cottle <---@---.---> Subject: CAC fonts Hi, I just realized that you need to have music fonts installed on your system to get the examples in CAC to display correctly. They are on the swiki. - -- ><><><><><><><><><><><> David Cottle, computer music, contra, cottle@cerlsoundgroup.org "Music does not progress. It changes." ‹Dean Madsen ------------------------------ Date: Fri, 13 Jul 2001 08:57:16 +0200 From: Roland Pfrengle <---@---.---> Subject: Re: Plug/env-problem am 13.07.2001 0:37 Uhr schrieb James McCartney unter asynth@io.com: Thank you James for the prompt reaction, but using your proposal, I get : ERROR: Message 'env_' not understood. Missing a variable declaration ? Where among the SC files I may read about the problem? (I know how to blend envelopes) Roland > > For this case, if you change a line in EnvGen : > > EnvGen : UGen { // envelope generator > var <>env; // add getter and setter methods > ... > > then you can write it as follows: > > ( > var a,b,e, w, box1,gate; > w = GUIWindow.new("panel", Rect.new( 128, 64, 288, 164 )); > box1 = CheckBoxView.new( w, Rect.new( 18, 15, 146, 35 ), "",0,0,1,0); > > Synth.play({ > gate = LFPulse.kr(0.5,0); > a = Env.perc(0,1,1,0); > b = Env.perc(1,0,1,0); > x = PanAz.ar(4,LFSaw.ar(300,0.2), e = > EnvGen.kr(a,1,0,1,0,1,gate),1,2); > thisSynth.repeat(0, 0.2, { > if (box1.value == 0, { e.env = a},{e.env = b}); > }); > x > }); > w.close; > ) > > > ------------------------------ Date: Fri, 13 Jul 2001 16:33:10 +0900 From: Takeko KAWAMURA <---@---.---> Subject: Re: FFT Hello. Wow, that's wonderful. Thanks to help. Takeko Kawamura tn800@iamas.ac.jp ------------------------------ Date: Fri, 13 Jul 2001 03:48:48 -0400 From: christian adam hresko <---@---.---> Subject: tips tip of the day. very similar to what chad kirby posted a few weeks ago. this is basically a way to snoop around SC without doing a bunch of command Ys and command Js. (or command H in some cases...) just have a blank window open to view all this stuff. looking for methods? try: ClassName.dumpInterface; not sure what the superclass of class so and so is? try: ClassName.superclass.postln; examples: Collection.dumpInterface; Bag.superclass.dumpInterface; i thought this was kinda cool. cheers, christian ------------------------------ Date: Fri, 13 Jul 2001 13:39:37 +0200 From: Roland Pfrengle <---@---.---> Subject: again Re: Plug/env-problem am 13.07.2001 0:37 Uhr schrieb James McCartney unter asynth@io.com: James, late night I found because of your note a solution: but I have to double the first section of the envelopes, otherwise the repeated envelope starts with the second section? ( var a,b,e1, e2,e,w, box1,gate; w = GUIWindow.new("panel", Rect.new( 128, 64, 288, 164 )); box1 = CheckBoxView.new( w, Rect.new( 18, 15, 146, 35 ), "",0,0,1,0); Synth.play({ e1 = Env.new([1,1,0,1,0],[0.01,0.4,0.4,0.4]); e2 = Env.new([0,0,1,0,1],[0.01,0.4,0.4,0.4]); gate = LFPulse.kr(0.3); a = EnvGen.ar(e1,1.0,0,1,0,1,gate); b = EnvGen.ar(e2,1.0,0,1,0,1,gate); e = Plug.ar(0); thisSynth.repeat(0, 0.2, { if (box1.value == 0, {e.source = a},{e.source = b}); }); PanAz.ar(2,LFSaw.ar(20,0.2),e,1,2); }); w.close; ) Anyway your proposal brings: ERROR: Message 'env_' not understood. Thanks again Roland > > For this case, if you change a line in EnvGen : > > EnvGen : UGen { // envelope generator > var <>env; // add getter and setter methods > ... > > then you can write it as follows: > > ( > var a,b,e, w, box1,gate; > w = GUIWindow.new("panel", Rect.new( 128, 64, 288, 164 )); > box1 = CheckBoxView.new( w, Rect.new( 18, 15, 146, 35 ), "",0,0,1,0); > > Synth.play({ > gate = LFPulse.kr(0.5,0); > a = Env.perc(0,1,1,0); > b = Env.perc(1,0,1,0); > x = PanAz.ar(4,LFSaw.ar(300,0.2), e = > EnvGen.kr(a,1,0,1,0,1,gate),1,2); > thisSynth.repeat(0, 0.2, { > if (box1.value == 0, { e.env = a},{e.env = b}); > }); > x > }); > w.close; > ) > > > ------------------------------ Date: Fri, 13 Jul 2001 07:11:49 -0500 From: James McCartney <---@---.---> Subject: Re: Plug/env-problem on 7/13/01 1:57 AM, Roland Pfrengle at roland.p@snafu.de wrote: > but using your proposal, I get : > > ERROR: > Message 'env_' not understood. You didn't modify the EnvGen class like I said you had to.. > For this case, if you change a line in EnvGen : > > EnvGen : UGen { // envelope generator > var <>env; // add getter and setter methods - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 13 Jul 2001 09:06:56 -0400 From: "t.krakowiak" <---@---.---> Subject: 273 Hi! Here's little something i wrote today. // // SCage for SuperCollider, microphone and speakers. // ( listen or not ) // ( Synth.play ( { AudioIn.ar ( [ 1 , 2 ] ) } , 273 ) ) ------------------------------ Date: Fri, 13 Jul 2001 09:18:48 -0400 (EDT) From: Matthew Rogalsky <---@---.---> Subject: Re: 273 An alternate realization: // John Cage's 4'33" // close and open powerbook between movements ( Synth.play({ [Plug.kr(0),Plug.kr(0)]; },30); ) ( Synth.play({ [Plug.kr(0),Plug.kr(0)]; },143); ) ( Synth.play({ [Plug.kr(0),Plug.kr(0)]; },100); ) On Fri, 13 Jul 2001, t.krakowiak wrote: > Hi! > > Here's little something i wrote today. > > > // > // SCage for SuperCollider, microphone and speakers. > // ( listen or not ) > // > ( > > > > Synth.play ( { > > > AudioIn.ar ( [ 1 , 2 ] ) > > > } , 273 ) > > ) > > ------------------------------ Date: Sat, 14 Jul 2001 01:49:10 +0900 From: Takeko KAWAMURA <---@---.---> Subject: Re: FFT Let me ask a question. > fft3 = Polar.new(fft1.magnitude, fft2.angle).asComplex; What's the difference of angle and phase? Takeko Kawamura tn800@iamas.ac.jp On 01.7.12 2:21 PM,Scott Wilson wrote$B!'(B >The code below will do it. > >You can also try multiplying magnitudes for further spectral fun... > >Scott > >( >// Scott Wilson, created ZKM, 12.04.01 > >var file1, file2, orig, compressed, numChan; > >// load files, original first >file1 = SoundFile.new; >orig = GetFileDialog.new.path; >file1.readHeader(orig); >file2 = SoundFile.new; >compressed = GetFileDialog.new.path; >file2.readHeader(compressed); > >numChan = file1.numChannels.max(file2.numChannels); > >Synth.record({ > var fftsize, numffts, fftoffsets, window, cosineTable; > var src1, src2; > > numffts = 2; // number of overlapped FFTs ( you can change this >to 4 (or any integer > 0)) > fftsize = 2048; // length of FFT buffer > > // make offsets for staggering overlapped FFTs > fftoffsets = Array.series(numffts, 0, fftsize/numffts); > > window = Signal.hanningWindow(fftsize); > cosineTable = Signal.fftCosTable(fftsize); > > src1 = DiskIn.ar(file1, true); > src2 = DiskIn.ar(file2, true); > > Array.fill(numChan, { arg i; > var in1, in2, fft1, fft2, fft3, ifft, out; > > if (file1.numChannels ==1, { in1 = src1; }, { in1 = src1@i; }); > if (file2.numChannels ==1, { in2 = src2; }, { in2 = src2@i; }); > > fft1 = FFT.a2sr(fftsize, fftoffsets, cosineTable, window, nil, in1, >0.0); // transform src1 > fft2 = FFT.a2sr(fftsize, fftoffsets, cosineTable, window, nil, in2, >0.0); // transform src2 > > fft3 = Polar.new(fft1.magnitude, fft2.angle).asComplex; > > // inverse transform > ifft = IFFT.s2ar(cosineTable, nil, window, fft3.real, fft3.imag); > out = Mix.ar(ifft.real) * 0.25; // mix overlapped outputs > > out = out/(2*numffts); > out * 0.5;}); >}, (file1.duration) max: (file2.duration), > PutFileDialog.new.path); >) ------------------------------ Date: Fri, 13 Jul 2001 12:23:37 -0500 From: James McCartney <---@---.---> Subject: Re: FFT on 7/13/01 11:49 AM, Takeko KAWAMURA at tn800@iamas.ac.jp wrote: > Let me ask a question. > >> fft3 = Polar.new(fft1.magnitude, fft2.angle).asComplex; > > What's the difference of angle and phase? There is not really a difference. They have the same definition in the classes Polar and Complex. Complex: angle { ^atan2(imag, real) } phase { ^atan2(imag, real) } Polar: angle { ^theta } phase { ^theta } By the way, I received the SuperCollider socks yesterday, thank you! - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sat, 14 Jul 2001 02:42:58 +0900 From: Takeko KAWAMURA <---@---.---> Subject: Re: FFT Hi!! I understand, thanks. And I'm very happy to heard SCSocks arrived all right, to you. Now I'm little bit busy for DSPSummerSchool. I hope to do somethig about SC in this summer school. http://dspss.iamas.ac.jp/e/index.html Lovely. Takeko Kawamura tn800@iamas.ac.jp On 01.7.13 12:23 PM,James McCartney wrote$B!'(B >on 7/13/01 11:49 AM, Takeko KAWAMURA at tn800@iamas.ac.jp wrote: > >> Let me ask a question. >> >>> fft3 = Polar.new(fft1.magnitude, fft2.angle).asComplex; >> >> What's the difference of angle and phase? > >There is not really a difference. >They have the same definition in the classes Polar and Complex. > >Complex: > angle { ^atan2(imag, real) } > phase { ^atan2(imag, real) } > >Polar: > angle { ^theta } > phase { ^theta } > > >By the way, I received the SuperCollider socks yesterday, thank you! > > >--- james mccartney james@audiosynth.com >SuperCollider - a real time synthesis programming language for the PowerMac. > ------------------------------ Date: Sat, 14 Jul 2001 08:28:46 +1000 From: newton armstrong <---@---.---> Subject: Re: 273 stereo is sooooo bourgeoise. a bit like pianos. Matthew Rogalsky: > [Plug.kr(0),Plug.kr(0)]; ------------------------------ Date: Sat, 14 Jul 2001 12:06:55 +0900 From: Sawako Katou <---@---.---> Subject: Re: FFT maybe you are saying about FFTease for Max/MSP by Eric Lion and Chris Penrose... http://www.sfc.keio.ac.jp/~penrose/msp/index.html sawako* > Sorry if there have been a bunch of replies to this I didn't notice but > there is one "swinger~" object in Max which does some kind of phase > modulation and I know it was done with the FFTease objects-who's that? Eric > Lyon? Anyway, my 2 cents worth... > > Dimitri > ------------------------------ Date: Fri, 13 Jul 2001 23:00:23 -0500 From: James McCartney <---@---.---> Subject: Re: FFT on 7/13/01 10:06 PM, Sawako Katou at t98259sk@sfc.keio.ac.jp wrote: > maybe you are saying about FFTease for Max/MSP > by Eric Lion and Chris Penrose... A number of those same algorithms and ones similar to them are in SC3 as phase vocoder plug-in objects. The source code for them is provided with SC3. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Sat, 14 Jul 2001 08:46:14 +0000 From: Jem Finer <---@---.---> Subject: Re: 273 I played 4'33" on my laptop in the context of a "lecture" at Loughbrough (pronounced low brow) University. My patch just recorded the piece. The audience were totally bemused, despite serious contextualisation, with the exception of one beaming 50 ish year old. Jem > An alternate realization: > > // John Cage's 4'33" > // close and open powerbook between movements > > ( > Synth.play({ > > [Plug.kr(0),Plug.kr(0)]; > > },30); > ) > > ( > Synth.play({ > > [Plug.kr(0),Plug.kr(0)]; > > },143); > ) > > ( > Synth.play({ > > [Plug.kr(0),Plug.kr(0)]; > > },100); > ) > > > > On Fri, 13 Jul 2001, t.krakowiak wrote: > >> Hi! >> >> Here's little something i wrote today. >> >> >> // >> // SCage for SuperCollider, microphone and speakers. >> // ( listen or not ) >> // >> ( >> >> >> >> Synth.play ( { >> >> >> AudioIn.ar ( [ 1 , 2 ] ) >> >> >> } , 273 ) >> >> ) >> >> > > ------------------------------ Date: Sat, 14 Jul 2001 01:34:37 +0200 From: Julian Rohrhuber <---@---.---> Subject: Stream.dot Is there already a pattern that overrides/adds values in one stream by another one? (Similar to Pbindf) This example shows what it should do, only there is no inval in the FuncStream that Stream.dot returns. a = Pbind(\nomex, Pseq([1, 2, 3], 2)); b = Pbind(\lomax, Pshuf([10, 20, 31], 2)); s = a.asStream.dot({ arg x, y; x.putAll(y); }, b.asStream); 10.do({ s.next(Event.new).postln; }); //changed version of Stream.dot: dot { arg function, stream; // combine item by item with another stream ^FuncStream.new( { arg inval; var x, y; x = this.next(inval); y = stream.next(inval); if ( x.notNil and: { y.notNil }, { function.value(x, y) }); }, { this.reset; stream.reset; } ); } Pdot : FilterPattern { var <>modifierPattern, <>func; *new { arg pattern, modifierPattern, func; ^super.newCopyArgs(pattern, modifierPattern, func) } asStream { ^pattern.asStream.dot(func, modifierPattern.asStream); } } Pmerge : Pdot { var <>modifierPattern; *new { arg pattern, modifierPattern; ^super.new(pattern, modifierPattern, { arg x, y; x.putAll(y); }) } } a = Pbind(\nomex, Pseq([1, 2, 3], 2)); b = Pbind(\lomax, Pshuf([10, 20, 31], 2)); s = Pmerge(a,b).asStream); 10.do({ s.next(Event.new).postln; }); ------------------------------ End of sc-users-digest V1 #322 ******************************