From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #129 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 Tuesday, June 13 2000 Volume 01 : Number 129 ---------------------------------------------------------------------- Date: Sat, 10 Jun 2000 19:37:18 -0500 From: Gary Morrison <---@---.---> Subject: Re: Hi and Synth.Record: Other Formats? Oop, I think I sent this to the wrong address. Let's try this again... Gary Morrison wrote: > I just now registered my copy of SuperCollider, so I've only learned it well > enough to figure out that I want it. So, I'll probably have a number of > questions in the near future. I much appreciate you folks' help. > > Just in case anybody's interested, I'm yet another computer engineer > professionally, musician amateurly (if that's a word). I've played many > instruments over my 39 years, including viola, bassoon, classical guitar, and > saxophone, but my main interest is composition, mostly in a "classical" style, > including styles very approximately along the lines of Wendy Carlos' music. > > Also, microtonal music is one of my strongest interests in music. I first got > fascinated by it, on a whim really, in the summer of my freshman year of high > school. I have explored mostly 10 tone (per octave) equal temperament > ("10TET"), octave-repeating harmonic-, and sub-harmonic-series scales, and > 88-cent (per step) equal-temperament. I suspect I'll mostly use SuperCollider > for producing some special-effectsy specialty sounds to compose with, and > possibly to create some custom MIDI instruments. > > I haven't done much sound design over the years, but have worked with Emagic's > Logic Audio, various Ensoniq synths, and my WX-11 wind controller, and I've also > done a bit with a derivative of the phase vocoding algorithm to recover the > envelopes of each harmonic of a nearly-harmonic sound. > > So that's me, and here's my first question for you: Can Synth.Record generate > sound files in other formats, such as SDII (Sound-Designer II, or MP3)? ------------------------------ Date: Sun, 11 Jun 2000 12:40:43 +0200 From: Gerhard Eckel <---@---.---> Subject: "externals" in C? Hello SuperCollider users, I am new to SuperCollider and I was wondering if there is a possibility to add one's own ugens written in C? I developed a bunch of algorithms in the past for various synthesis systems which I would like to use in SuperCollider. They have been tested and optimized now for a while, so emulating them with existing SC ugens wouldn't be that efficient, although certainly possible. Regards from Bonn, Gerhard ------------------------------ Date: Sun, 11 Jun 2000 11:43:39 -0500 From: Gary Morrison <---@---.---> Subject: Re: "externals" in C? Although I too am new to SuperCollider, I have been told by a long-time (or much longer-time than me anyway!) user that the next major revision is scheduled to have plug-in capabilities. > I am new to SuperCollider and I was wondering if there is a possibility > to add one's own ugens written in C? ------------------------------ Date: Sun, 11 Jun 2000 14:07:12 -0700 From: Alberto de Campo <---@---.---> Subject: Re: "externals" in C? As far as I know, this will be available in V3, which has no scheduled release date yet. best regards, alberto Gary Morrison wrote: > Although I too am new to SuperCollider, I have been told by a long-time (or much > longer-time than me anyway!) user that the next major revision is scheduled to > have plug-in capabilities. > > > I am new to SuperCollider and I was wondering if there is a possibility > > to add one's own ugens written in C? ------------------------------ Date: Sun, 11 Jun 2000 14:32:57 -0700 From: Alberto de Campo <---@---.---> Subject: Re: Hi and Synth.Record: Other Formats? Hi Gary, Gary Morrison wrote: > > So that's me, and here's my first question for you: Can Synth.Record generate > > sound files in other formats, such as SDII (Sound-Designer II, or MP3)? SD2 works like this: ( Synth.record({ PinkNoise.ar(0.1) }, 1.0, "test", 'SD2', '16 big endian signed'); SoundFile.play("test"); ) You can also try other combinations of these file format symbols (this doc taken from SoundFile.sc): /* Sound File Format symbols: header formats: read/write formats: 'AIFF', - Apple's AIFF 'SD2', - Sound Designer 2 'RIFF', - Microsoft .WAV 'Sun', - NeXT/Sun 'IRCAM', - old IRCAM format 'none' - no header = raw data A huge number of other formats are supported read only. sample formats: '8 signed', '8 unsigned', '8 mulaw', '8 alaw', '16 big endian signed', '16 big endian unsigned', '16 little endian signed', '16 little endian unsigned', '32 big endian signed', '32 big endian float' '32 little endian signed', '32 little endian float' '64 big endian double' '64 little endian double' not all header formats support all sample formats. My personal preferred format is 'Sun','32 big endian float', because 'AIFF', 'SD2', 'RIFF' do not support floats. 'AIFF' is best for now if you want to load/save the loop points and midi data. */ Best, alberto ------------------------------ Date: Sun, 11 Jun 2000 23:03:05 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: rescaling program In the following program to rescale a file, I can't seem to get it to work on reasonably large files without doing a Synth.write for the first pass. Is this just another DiskIn problem, or is there a better way to scan a file for a peak amplitude. thanks paul lansky ( var sound,trig,left,right,leftpeak,rightpeak,overallpeak,input,output; input ="my.soundfile"; output = input++".short"; sound = SoundFile.new; sound.preload(input,0,44100); // scan for peak Synth.write({arg synth; x = DiskIn.ar(sound,false); trig = Impulse.ar(0); left = Peak.ar(x.first,trig); right = Peak.ar(x.last,trig); synth.repeat(0,64/44100, {leftpeak = left.poll; rightpeak = right.poll}); x; },sound.numFrames/44100,output,'AIFF'); overallpeak = max(leftpeak,rightpeak); // rescale overallpeak.postln; sound.preload(input,0,44100); Synth.write({ x = DiskIn.ar(sound,false); x/overallpeak; },sound.numFrames/44100,output,'SD2'); ) ------------------------------ Date: Mon, 12 Jun 2000 12:33:15 +0200 From: Hans Tutschku <---@---.---> Subject: Re: rescaling program >In the following program to rescale a file, I can't seem to >get it to work on reasonably large files without doing a Synth.write >for the first pass. Is this just another DiskIn problem, or is there >a better way to scan a file for a peak amplitude. >thanks >paul lansky > That's my "sort-of-solution". There is defenitly a more efficiant way. This version plays the soundfile one time to get the peaklevels and normalizes afterwards. Hans // make testsignal ( Synth.write({ SinOsc.ar([200,300],0,LFNoise2.kr(100,[0.2,0.3])); },0.5, "test", 'SD2', '16 big endian signed'); ) //plot testsignal ( var soundFile; Synth.plot({ soundFile = SoundFile.new; if (soundFile.readHeader("test") and: { soundFile.preloadData; }, { DiskIn.ar(soundFile,false);}) }, 0.5) ) //normalize each channel independently ( var gate, soundFile, newFilename, soundLength, maxLevel, numChans, maxLevelL, maxLevelR, left, right; soundFile = SoundFile.new; if (soundFile.readHeader("test") and: { soundFile.preloadData; }, { soundLength = soundFile.numFrames / soundFile.sampleRate; numChans = soundFile.numChannels; Synth.scope({ arg synth; synth.tsched(soundLength.value, { Synth.stop }); a = DiskIn.ar(soundFile, false); maxLevel = [0,1].collect({ arg index; Peak.ar(a.at(index))}); synth.repeat(0,(soundLength.value - 0.001), { maxLevelL = maxLevel.at(0).poll; maxLevelR = maxLevel.at(1).poll; }); a }, 0.1, "output", Rect.newBy(66, 40, 297, 315)); "____".postcln; maxLevelL.value.postcln; maxLevelR.value.postcln; Synth.write({ left = DiskIn.ar(soundFile, false).at(0) * (1 / maxLevelL.value); right = DiskIn.ar(soundFile, false).at(1) * (1 / maxLevelR.value); [left, right] },soundLength.value, "test.n", 'SD2', '16 big endian signed'); }); ) //plot normalized testsignal ( var soundFile; Synth.plot({ soundFile = SoundFile.new; if (soundFile.readHeader("test.n") and: { soundFile.preloadData; }, { DiskIn.ar(soundFile,false);}) }, 0.5) ) ------------------------------ Date: Mon, 12 Jun 2000 09:31:10 +0200 From: Hans Tutschku <---@---.---> Subject: Re: Hi and Synth.Record: Other Formats? > > 'AIFF' is best for now if you want to load/save the loop points >and midi data. But 'AIFF' it givs a clic at the beginning, if you load the file into Protools. This is somehow a misinterpretation of the soundfile header by Protools. You won't see this clic in PEAK. This problem does not only arise with SuperCollider and Protools. Sounds from other programs writing AIFF (like AudioSculpt, Modalys) are equally misinterpretet in Protools. Hans ------------------------------ Date: Mon, 12 Jun 2000 16:02:14 +0200 From: Julian Rohrhuber <---@---.---> Subject: yield a Pattern Does anyone know how I can use a Pattern in a Prout? if I yield a Pattern from a Prout, why it doesn`t get evaluated, even if I put it in a Pseq? ( // Pseq in a Prout: a = Pseq([ Prout({ x = [10, 12, Pseq([0, 3, 0, 1], 3)]; x.do({ arg item; item.yield }) }); ], inf); // Pseq in a Pseq: //a = Pseq( [10, 12, Pseq([0, 3, 0, 1], 3)], inf); //Stream in a Pseq: //a = Pseq([10, 12, Pseq([0, 3, 0, 1], 3).asStream], inf); b = a.asStream; 12.do({ b.next.postln }); Pbind(\degree, a, \dur, 0.2).play; ) Julian ------------------------------ Date: Mon, 12 Jun 2000 11:07:49 -0500 From: James McCartney <---@---.---> Subject: Re: yield a Pattern on 6/12/00 9:02 AM, Julian Rohrhuber at sa6a014@rrz.uni-hamburg.de wrote: > Does anyone know how I can use a Pattern in a Prout? The best way to understand what is going on is to read the source to these classes and how patterns get embedded. You don't yield patterns, you embed them. See how Pseq works. If you follow that to write your Prout then you can do the same thing that Pseq does. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Mon, 12 Jun 2000 18:02:30 -0400 From: "crucial" <---@---.---> Subject: Pfx in multichannel sound I've been doing some multi channel stuff and came across this. When using a Pfx, ~chanOffset as set from a pattern will set which channel within the Pfx effect function to play on. In order to determine which channel the Pfx itself should start at in the final output array (or wherever its going to next), I added the channelOffset arg below. That channel can not be changed for the duration of the Pfx pattern. Pfx : FilterPattern { var <>effects, <>numChannels, <>postroll, <>decay,<>channelOffset; *new { arg pattern, effects, numChannels=2, postroll = 0.5, decay = 0.5,chanOffset=0; ^super.new(pattern).effects_(effects).numChannels_(numChannels) .postroll_(postroll).decay_(decay).channelOffset_(chanOffset) } asStream { var stream; stream = pattern.asStream; ^Routine.new({ arg inevent; var out, tspawn, synth, outevent, copyevent; // create a synth inevent.use({ synth = Synth.new({ arg pfxsynth; pfxsynth.channelOffset=channelOffset; out = TSpawn.ar(nil, numChannels); tspawn = out.source; effects.valueEnvir( out ) * EnvGen.kr( Env.new( #[1,1,1,0], [0.5, postroll, decay], \linear, 1) ); }); }); if (synth.notNil, { inevent.at(\inSpawn).triggerSynth( synth, true ); while ({ copyevent = inevent.copy; copyevent.put(\inSpawn, tspawn); (outevent = stream.next(copyevent)).notNil },{ inevent = outevent.yield; }); synth.release; }); }); } } _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Tue, 13 Jun 2000 01:37:14 +0200 From: Julian Rohrhuber <---@---.---> Subject: Re: yield a Pattern > The best way to understand what is going on is to read the source to these > classes and how patterns get embedded. You don't yield patterns, you embed > them. See how Pseq works. If you follow that to write your Prout then you > can do the same thing that Pseq does. got it! thanks. Julian ------------------------------ Date: Tue, 13 Jun 2000 06:46:18 -0500 From: Gary Morrison <---@---.---> Subject: Learning to Talk the Talk... The SC language tutorial says that: f(a, b) is equivalent to : a.f(b) sin(x) is equivalent to : x.sin I take the latter to mean that x, presumably a variable, is an object of a class that has a method called sin, and that a, also presumably a variable, is of a class that has a method called f, and that that method requires a parameter, b in this case. Perhaps I should just read on instead, but this much alone raises a bunch of questions. I'll start with the two most basic ones: 1. All of the variable declarations have been of the form, "var a". What defines what class of object "a" is, and thus what methods it may have? Is it just what it's assigned to? That is, if you assign "a" a value of ribbit which is something of class Frog, then "a" is of class Frog? 2. Am I correct in inferring from the f(a,b) example that the receiver of a functional-notation expression is always the first parameter, and that is why f(a,b) is equivalent to a.f(b) rather than b.f(a)? ------------------------------ End of sc-users-digest V1 #129 ******************************