[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] methods for rendering and playing functions and patterns ?



Hi,

It's a bit like Pattern:record, no ?

2014-12-13 3:21 GMT+01:00 Daniel Mayer <daniel-mayer@xxxxxxxx>:
>
> Wouldn't it be useful to have such methods ?
> I think I've read in a thread that something had already existed in earlier SC versions, no ?
>
>
> (
> p = Pbind(
>         \midinote, Pwhite(60, 90),
>         \dur, 0.2
> );
>
> // and similar for Functions of course
> // in a real implementation SynthDef would better be predefined
>
> ~renderPlay = { |pat, numChannels = 2, server, path, maxTime = 60, sampleRate = 44100,
>         headerFormat = "AIFF", sampleFormat = "int16", options, inputFilePath, action|
>         path = path ?? { "pRender_" ++ Date.localtime.stamp ++ "." ++ headerFormat.toLower };
>         options = options ?? { ServerOptions().numOutputBusChannels = numChannels };
>         server = server ?? { Server.default };
>         pat.render(path, maxTime, sampleRate, headerFormat = "AIFF", sampleFormat = "int16",
>                 options, inputFilePath, {
>                         server.makeBundle(nil, {
>                                 var bufnum = Buffer.read(server, path).bufnum;
>                                 { PlayBuf.ar(numChannels, bufnum, BufRateScale.kr(bufnum)) }.play;
>                         })
>                 }
>         );
> };
> )
>
>
> ~renderPlay.(p, maxTime: 10)
>
>
> Very practical: sample-exact if desired, neglectable latency with examples up to a minute or so !
>
>
> Greetings
>
> Daniel
>
> -----------------------------
> www.daniel-mayer.at
> -----------------------------
>
>
> _______________________________________________
> sc-dev mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-dev/
> search: https://listarc.bham.ac.uk/lists/sc-dev/search/

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/