From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #383 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 Thursday, November 22 2001 Volume 01 : Number 383 ---------------------------------------------------------------------- Date: Tue, 20 Nov 2001 21:53:15 +0100 From: Giorgio Robino <---@---.---> Subject: patch: audioMerger ( // audioMerger (17/11/2001) by Giorgio Robino, // // base patch using Ptpat() as a mixer / merger // (crossfade concatenate) of audio tracks (AIFF chunks file long manies minutes). // The purpose is to concatenate a number of prepared long audio chunks // (but the method is also valid with any ugen functions), with deep crossfades, // for produce a single output audio file. // // The idea is to view a file like a track, and elaborate a group of tracks // like an hw multitrack machine. In this way maybe my SC implementation // with Ppat(), Pbind() is not the best mode; I also invite readers to improove // the patch, maybe intoducing others multitrack features // (run-time/programmed volume control, pan, reverb and so on). // // For add a new audio track, simply add the name in trackFilenames array // and add a line for every new track as esemplified here below: // ... // audioMerger = Ptpar( // [ // ..., // track n - 1 // startTime, audioTrack.value(trackFilenameN, inCrossFadeSecN, outCrossFadeSecN), // track n // ..., // ], inf); // // note: the granularity of time is in seconds. // var audioMerger, audioTrack, audioFilePlayEnv, audioFileLoad, audioFileLen; var trackFilenames; var trackLenA, trackLenB; var startTimeA, startTimeB; var fileNameA, fileNameB; var fadeIn = 5, fadeOut = 15, crossFade = 90; // 01:30:00 crossfade time !! var outFileName = "Macintosh HD:Desktop Folder:audioMerger.aif"; var outFileLength; // lista dei nomi dei file audio, un file == una traccia trackFilenames = [ "Macintosh HD:Desktop Folder:trackA.aif", "Macintosh HD:Desktop Folder:trackB.aif" ]; //////////////////////////////////////////////////////////////////////////// //// // audioFilePlayEnv.value (file, lengthSec, fadeIn, fadeOut, fadeMode, loopMode) // audioFilePlayEnv = { arg fileHandle, lengthSec, // la lunghezza di play puo' essere maggiore della // lunghezza del campione se loopMode = true fadeIn = 0.0001, fadeOut = 0, fadeMode = 'linen', loopMode = true; var env; // fadeMode maybe prefedined values, // as 'exponential', (classical soft crossfade) // 'welch', -2 (carica/scarica condensatore) and others, see Env help if (fadeMode != 'linen', { env = EnvGen.kr(Env.new ( [0.0001, 1, 1, 0.0001], [fadeIn, lengthSec - (fadeIn + fadeOut), fadeOut], fadeMode )) }, { env = EnvGen.kr(Env.linen(fadeIn, lengthSec - (fadeIn + fadeOut), fadeOut)) }); // ritorna il campione audio con fadeIn/fadeOut DiskIn.ar(fileHandle, loopMode) * env }; ///////////////////////////////// // audioFileLoad.value (filename) // audioFileLoad = { arg filename; var fileHandle; fileHandle = SoundFile.new; fileHandle.readHeader(filename); fileHandle }; //////////////////////////////// // audioFileLen.value (fileName) // audioFileLen = { arg fileName; var audioFile; audioFile = SoundFile.new; audioFile.readHeader(fileName); // legge solo l'header // ritorna la durata in secondi del campione audio audioFile.duration; }; /////////////////////////////////////////////////// // audioTrack.value (fileName, fadeIn, fadeOut) // audioTrack = { arg fileName, fadeIn = 0, fadeOut = 0; var fileHandle; var playOnce = 3600; // alias for infinite time, meaning playng only one time. // carica il file audio e calcola la lunghezza in secondi fileHandle = audioFileLoad.value (fileName); Pbind( \dur, playOnce, \ugenFunc, { audioFilePlayEnv.value(fileHandle, fileHandle.duration, fadeIn, fadeOut) }); }; /////////////////////////////////////////////////////////////////////// // mix / (crossfade concatenate) two audio tracks with a long crossfade // calcola lunghezza in secondi dei file audio fileNameA = trackFilenames.at(0); fileNameB = trackFilenames.at(1); trackLenA = audioFileLen.value( fileNameA ); trackLenB = audioFileLen.value( fileNameB ); // la durata finale e' la somma delle durate meno i tempi di crossfade outFileLength = trackLenA + trackLenB - crossFade; // calcola i tempi di inizio di ogni traccia startTimeA = 0; startTimeB = trackLenA - crossFade; // scrive le lunghezze dei file in input ed output in secondi "AudioMerger (17/11/2001) run report: ".postcln; { "tracciaA (" + fileNameA + "): " + trackLenA + "sec. "}.value.postcln; { "tracciaB (" + fileNameB + "): " + trackLenB + "sec. "}.value.postcln; { "mixed output (" + outFileName + "): " + outFileLength + "sec. "}.value.postcln; // esegue in parallelo dei pattern, in questo caso tracce audio audioMerger = Ptpar( [ startTimeA, audioTrack.value(fileNameA, fadeIn, crossFade), startTimeB, audioTrack.value(fileNameB, crossFade, fadeOut) ], inf); // final mix audioMerger.write ( duration: outFileLength, pathName: outFileName); ) ------------------------------ Date: Thu, 22 Nov 2001 05:16:00 +0100 From: "a.c.van.kampen" <---@---.---> Subject: Re: simple question Yes, so i noticed, nothing changes, which tells me i'm on the wrong track. Your langauge is not always as easy to grasp as my mothers language (which is Dutch). Fortunately it sounds very nice. Jan-Kees > MIDIController.kr IS a Plug already, so there is no need to wrap it in a > Plug. > > --- james mccartney james@audiosynth.com > SuperCollider - a real time synthesis programming language for the PowerMac. > > > ------------------------------ Date: Tue, 20 Nov 2001 23:41:56 -0500 From: felix <---@---.---> Subject: Re: simple question and dutch doesn't ? anyway your trying to use a CC to play over midinote tuned pitches ? or you want a different intonation ? > From: "a.c.van.kampen" <---@---.---> > Reply-To: sc-users@lists.io.com > Date: Thu, 22 Nov 2001 05:16:00 +0100 > To: > Subject: Re: simple question > > Yes, so i noticed, nothing changes, which tells me i'm on the wrong track. > Your langauge is not always as easy to grasp as my mothers language > (which is Dutch). > Fortunately it sounds very nice. > > Jan-Kees ------------------------------ Date: Wed, 21 Nov 2001 18:24:48 +0100 From: Alberto de Campo <---@---.---> Subject: PanAz crash, OSC Hi James and all, 1. A crashing bug in PanAz: ( // fatal crash at numChans = 20 on my machine! // not just SC, but the whole system. // saw gcGrey...gobbledegook messages fly by on one crash. 10.do({ arg i; numChans = (16 + i).postln; { PanAz.ar( numChans, ClipNoise.ar(0.5), LFSaw.kr(1) ); }.play(3); }); ) ( Yes, I could really use a 40 chan PanAz for a project. ) 2. OSC and 9.2.1: I tried swapping out all the network related extensions and control panels to get OSC to work while synth is on, but no success. List of swapped items: Extensions: Apple Enet Apple Modem Tool ICeTEe Internet Access (only exists in 9.0.4) Internet Config Extension LDAP Client Library LDAPPlugin NBP Plugin NSL UI Library Open Transport Open Transport ASLM Modules OpenTpt Modem OpenTpt Remote Access PowerBook Internal Modem Remote Access URL Access Control Panels: Internet Modem Remote Only TCP/IP Did I miss any likely candidates? And does anyone have other hack suggestions (save James fixing the issue inside SC :-)? Thanks in advance, adc - -- Alberto de Campo ACADEMY OF MEDIA ARTS Peter-Welter-Platz 2 D - 50676 Cologne / Germany phone : ++49-(0)221-20189-141 e-mail : adc@khm.de - -- ------------------------------ Date: Wed, 21 Nov 2001 18:43:12 +0100 From: Julian Rohrhuber <---@---.---> Subject: Fwd: Re: PanAz crash, OSC > >> hi list! >> how do you schedule osc-messages? >> >> ( >> var port; >> OSCPort.closeAll; >> port = OSCOutPort(8192,"127.0.0.1"); >> { arg synth; >> port.sendNoTags("/control", \start1); // <- works >> synth.sched(2, {port.sendNoTags("/control", \start2)}); // <- error code >-3179 > >Unfortunately in recent OS's Apple made it impossible to send data on open >transport from interrupt level. I'm not sure there is much I can do about it >except say to either go back to pre OS 9.1 or wait for OSX. >Here's my previous post on the topic: > >> >> There are apparently some changes in Apple's OTSndUData call such that in >> certain circumstances it is not async callable at interrupt level. This was >> not the case in previous versions of MacOS. I have not determined yet what >> these circumstances are or whether they can be circumvented. >> > > >--- james mccartney james@audiosynth.com >SuperCollider - a real time synthesis programming language for the PowerMac. > so no solution yet. os 9.04 is not so bad after all.. - -- . ------------------------------ Date: Wed, 21 Nov 2001 10:52:53 -0800 From: "Thomas Miley" <---@---.---> Subject: float to int I know I've done this before but can't remember how to coerce a float into an int. I'm trying to calculate indices and can't get around the automatic variable typing. Thanks Thomas Miley http://artists2.iuma.com/IUMA/Bands/Krispy_Kat_Whack/ ------------------------------ Date: Wed, 21 Nov 2001 13:10:42 -0600 From: James McCartney <---@---.---> Subject: Re: float to int on 11/21/01 12:52 PM, Thomas Miley at tmiley@prodigy.net wrote: > I know I've done this before but can't remember how to coerce a float into > an int. I'm trying to calculate indices and can't get around the automatic > variable typing. > > Thanks > > Thomas Miley x.asInteger - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 21 Nov 2001 13:22:46 -0600 From: Ian Pojman <---@---.---> Subject: Re: float to int Try searching the archives first - .asInteger turns an object to an Integer On Wednesday, November 21, 2001, at 12:52 PM, Thomas Miley wrote: > I know I've done this before but can't remember how to coerce a float > into > an int. I'm trying to calculate indices and can't get around the > automatic > variable typing. > > Thanks > > Thomas Miley > > > > http://artists2.iuma.com/IUMA/Bands/Krispy_Kat_Whack/ > > ------------------------------ Date: Wed, 21 Nov 2001 22:04:11 +0100 From: Fredrik Olofsson <---@---.---> Subject: [OT] ga, ca, ai, nn audio label hi! a friend of mine is looking for material for his new label. "Cathode Flower is now in an explorative phase, and artists working with audio and complex systems are encouraged to contact us." http://www.cathodeflower.com/ /fredrik ------------------------------ Date: Wed, 21 Nov 2001 20:16:11 -0500 From: newton armstrong <---@---.---> Subject: Pattern restart is there a way to reset and/or restart a Pattern after it has returned nil? i want to be able to do this without restarting the Synth engine, ie. so i can switch multiple parallel Event Streams on and off at will. i've been able to do it with TSpawn, but it gets a bit messy and adds a lot of CPU overhead. i also tried putting the Pattern inside a FuncStream, but couldn't get it to work... ------------------------------ Date: Wed, 21 Nov 2001 20:39:12 -0600 From: James McCartney <---@---.---> Subject: Re: Pattern restart on 11/21/01 7:16 PM, newton armstrong at newton@silvertone.Princeton.EDU wrote: > is there a way to reset and/or restart a Pattern after it has returned nil? You don't restart Patterns, you create Streams from Patterns. (ie A Pattern is a factory class for streams.) Depending on how the stream was written, you may be able to send it a 'reset' message. > ie. so i > can switch multiple parallel Event Streams on and off at will. is Pswitch what you need? - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Fri, 23 Nov 2001 03:48:23 +0100 From: "a.c.van.kampen" <---@---.---> Subject: Re: simple question well, lots of foreigners (especially russian women) tell me it sounds harsh, and belgian (which differs in pronunciation) sounds more beautiful. but i rather hear someone speak dutch than supercollider. i want to be able to stretch the tuning from 100 cents to the full 127 midinotes. i use max to record, alter and send values, entered via midifaders, to supercollider via IAC (this will do for now). Anyway it works now. Thanks, Jan-Kees > > and dutch doesn't ? > anyway your trying to use a CC to play over midinote tuned pitches ? > or you want a different intonation ? ------------------------------ Date: Thu, 22 Nov 2001 00:49:00 -0500 From: newton armstrong <---@---.---> Subject: Re: Pattern restart On 21/11/01 9:39 PM, "James McCartney" wrote: > on 11/21/01 7:16 PM, newton armstrong at newton@silvertone.Princeton.EDU > wrote: > >> is there a way to reset and/or restart a Pattern after it has returned nil? > > You don't restart Patterns, you create Streams from Patterns. (ie A Pattern > is a factory class for streams.) > Depending on how the stream was written, you may be able to send it a > 'reset' message. yeah, excuse me. the terminology was a bit out. > >> ie. so i >> can switch multiple parallel Event Streams on and off at will. > > is Pswitch what you need? i'm using Pswitch1 to kill running streams, where the streamList contains an element nil. eg: Pbind(\someParameter, Pswitch1([ somePattern, nil], someController)); what i'd like to be able to do is trigger a new stream from that same pattern specification at some later stage (ie. after it has previously been killed), also using some controller or other. this is useful for making mixes over long periods of time, where different streams can be turned on and off independently, without putting a strain on cpu by enclosing them in Pauses or TSpawns using asSpawn. i've tried a few different permutations using the reset method but can't get anything to work. ------------------------------ Date: Thu, 22 Nov 2001 14:41:34 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart just five minutes ago I was at a place in my code that was dealing with that. instead od a nil you can put in a Pbind( \ugenFunc, nil, \dur, Pn(1.0, 1) ) >On 21/11/01 9:39 PM, "James McCartney" wrote: > >> on 11/21/01 7:16 PM, newton armstrong at newton@silvertone.Princeton.EDU >> wrote: >> >>> is there a way to reset and/or restart a Pattern after it has returned nil? >> >> You don't restart Patterns, you create Streams from Patterns. (ie A Pattern >> is a factory class for streams.) >> Depending on how the stream was written, you may be able to send it a >> 'reset' message. > >yeah, excuse me. the terminology was a bit out. > >> >>> ie. so i >>> can switch multiple parallel Event Streams on and off at will. >> >> is Pswitch what you need? > >i'm using Pswitch1 to kill running streams, where the streamList contains an >element nil. > >eg: Pbind(\someParameter, Pswitch1([ somePattern, nil], someController)); > >what i'd like to be able to do is trigger a new stream from that same >pattern specification at some later stage (ie. after it has previously been >killed), also using some controller or other. this is useful for making >mixes over long periods of time, where different streams can be turned on >and off independently, without putting a strain on cpu by enclosing them in >Pauses or TSpawns using asSpawn. i've tried a few different permutations >using the reset method but can't get anything to work. - -- . ------------------------------ Date: Thu, 22 Nov 2001 10:03:33 -0500 From: newton armstrong <---@---.---> Subject: Re: Pattern restart On 22/11/01 8:41 AM, "Julian Rohrhuber" wrote: > just five minutes ago I was at a place in my code that was dealing with that. > instead od a nil you can put in a > Pbind( > \ugenFunc, nil, > \dur, Pn(1.0, 1) > ) thanks julian, but i don't see how this solves the retriggering problem. it's easy to kill a stream by just putting a nil in there at some point, but i can't find a way to start a new stream from the same pattern specification once it has already been killed. like i said yesterday, i want to be able to do this without having to resart the synth engine. it's straightforward in SC3, of course... ------------------------------ Date: Thu, 22 Nov 2001 15:03:56 +0000 From: "Fabs Mogini" <---@---.---> Subject: Extrnal tempo control/MIDI (again) Dear List, _how would you send out the tempo used in a SC patch in order to link an external drum machine trough MIDI? _how would you send out the tempo from a drum machine trough MIDI to a SC patch? Cheers Fabrice ------------------------------ Date: Thu, 22 Nov 2001 17:07:52 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart >On 22/11/01 8:41 AM, "Julian Rohrhuber" wrote: > >> just five minutes ago I was at a place in my code that was dealing >>with that. >> instead od a nil you can put in a >> Pbind( >> \ugenFunc, nil, >> \dur, Pn(1.0, 1) >> ) > >thanks julian, but i don't see how this solves the retriggering problem. >it's easy to kill a stream by just putting a nil in there at some point, but >i can't find a way to start a new stream from the same pattern specification >once it has already been killed. like i said yesterday, i want to be able to >do this without having to resart the synth engine. >it's straightforward in SC3, of course... ok, first of all my code was wrong. of course you'd want to idle in the nil stream, so it should have been Pbind( \ugenFunc, nil, \dur, Pn(1.0, inf) ) (of course like this when you switch over, you have the rest of the other stream moving on.) what I use now is //stream holder, like asStream Pstr : Stream { var <>stream, <>pattern; *new { arg pattern; ^super.new.pattern_(pattern).patReset; } next { arg inval; ^stream.next(inval) } reset { stream.reset; } patReset { stream = pattern.asStream; } } so that I can reset any stream in different ways. - -- . ------------------------------ Date: Thu, 22 Nov 2001 18:37:43 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart >> >>thanks julian, but i don't see how this solves the retriggering problem. ok, I see I was wrong. once it is over, I also see no way to reach it. what you could do is filter the stream (not very funky, but works) Pidle : FilterPattern { var <>replacement, <>repeats; *new { arg pattern, replacement, repeats=inf; ^super.new(pattern).repeats_(repeats).replacement_(replacement ? Pbind(\freq, \rest)) } asStream { var stream; stream = pattern.asStream; ^Routine({ arg inval; var outval; repeats.value.do({ outval = stream.next(inval); if(outval.notNil, { inval = outval.embedInStream(inval) }, { inval = replacement.embedInStream(inval) }) }) }) } } Pstr : Stream { var <>stream, <>pattern; *new { arg pattern; ^super.new.pattern_(pattern).resetPat; } next { arg inval; ^stream.next(inval); } reset { stream.reset; } resetPat { stream = pattern.asStream; } } //idle switch ( x = 0; a = Pswitch1([Pbind(\freq, \rest, \dur, 1), p = Pstr(Pidle(Pbind(\degree, Pseq([0, 1, 2], 1))))], Pfunc({ x.value })); a.play; ) x = 1; //on x = 0; //off p.resetPat; - -- . ------------------------------ Date: Thu, 22 Nov 2001 14:49:58 -0500 From: newton armstrong <---@---.---> Subject: Re: Pattern restart thanks julian, that's some handy code. the only thing is that streams that aren't currently playing are still taxing the cpu, and if there's going to be a lot of them (and i'm looking at a huge library), then this is still going to impose a maximum limit, which is the problem i was trying to get around in the first place. the nice thing about putting nil in a stream is that the stream then no longer makes any demands on the cpu. but what i'd really like to be able to do is subsequently relaunch that stream, from the same pattern template and without restarting the synth engine, after it has been nillified. it could be there's just no way to do this in SC2. ------------------------------ Date: Thu, 22 Nov 2001 20:53:02 +0100 From: sc <---@---.---> Subject: Re: Extrnal tempo control/MIDI (again) http://www.studiobeige.de ... .. . ... . . .http://www.echtzeitmusik.de > Dear List, > > _how would you send out the tempo used in a SC patch > in order to link an external drum machine trough MIDI? > > _how would you send out the tempo > from a drum machine trough MIDI to a SC patch? > > Cheers > Fabrice maybe reserve one midinote for trigger possibly: PulseDivider.kr(MIDIMostRecentNote.kr(),4).... - -- nicholas ------------------------------ Date: Thu, 22 Nov 2001 22:39:21 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart >thanks julian, that's some handy code. :) >the only thing is that streams that aren't currently playing are still >taxing the cpu, and if there's going to be a lot of them (and i'm looking at >a huge library), then this is still going to impose a maximum limit, which >is the problem i was trying to get around in the first place. >the nice thing about putting nil in a stream is that the stream then no >longer makes any demands on the cpu. but what i'd really like to be able to >do is subsequently relaunch that stream, from the same pattern template and >without restarting the synth engine, after it has been nillified. it could >be there's just no way to do this in SC2. ok. didn't know you were after so many at once... - -- . ------------------------------ End of sc-users-digest V1 #383 ******************************