From dc7328728091aedc9a339b59147af8fb69b2fe02 Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Sat, 18 Jul 2020 21:56:03 +0100 Subject: [PATCH] a slightly improved (buf)audiotransport help which is fun to play with --- .../Classes/FluidAudioTransport.schelp | 15 ++++++++++++++- .../Classes/FluidBufAudioTransport.schelp | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/release-packaging/HelpSource/Classes/FluidAudioTransport.schelp b/release-packaging/HelpSource/Classes/FluidAudioTransport.schelp index f8a64b9..fdcfc4c 100644 --- a/release-packaging/HelpSource/Classes/FluidAudioTransport.schelp +++ b/release-packaging/HelpSource/Classes/FluidAudioTransport.schelp @@ -44,6 +44,19 @@ RETURNS:: EXAMPLES:: code:: -//the mouse X axis interpolates between the two sinewaves +//didactic - the mouse X axis interpolates between the two sinewaves {FluidAudioTransport.ar(SinOsc.ar(220,mul: 0.1),SinOsc.ar(440,mul: 0.02),MouseX.kr())}.play; + +//richer with complex spectra +//load 2 files +( +b = Buffer.read(s,File.realpath(FluidAudioTransport.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-CEL-GlitchyMusicBoxMelo.wav"); +c = Buffer.read(s,File.realpath(FluidAudioTransport.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-CF-ChurchBells.wav"); +) +//listen to them +b.play +c.play +//stereo cross! +{FluidAudioTransport.ar(PlayBuf.ar(2,b,loop: 1),PlayBuf.ar(2,c,loop: 1),MouseX.kr())}.play; + :: diff --git a/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp b/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp index 8c2c37d..e061d1b 100644 --- a/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp @@ -75,7 +75,8 @@ private:: synth, server EXAMPLES:: code:: -//Make 2 sources to be interpolated +//Didactic: +//Make 2 sinewave sources to be interpolated ( b = Buffer.loadCollection(s, FloatArray.fill(44100, {|a|(a / pi).sin * 0.1})); c = Buffer.loadCollection(s, FloatArray.fill(44100, {|a|(a / pi / 2).sin * 0.02})); @@ -89,4 +90,20 @@ FluidBufAudioTransport.process(s,b,source2:c,destination:d,interpolation:0.5,act b.play c.play d.play + +// more interesting sources: two cardboard bowing gestures +( +b = Buffer.read(s,File.realpath(FluidBufAudioTransport.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Green-Box641.wav"); +c = Buffer.read(s,File.realpath(FluidBufAudioTransport.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Green-Box639.wav"); +d = Buffer.new +) + +// listen to the source +b.play +c.play + +// process and listen +FluidBufAudioTransport.process(s,b,source2:c,destination:d,interpolation:0.5,action:{"Ding".postln}) +d.play +// try various interpolation factors (0.1 and 0.9 are quite good ::