From 1edeb89876c88cd8218e0a400162412e7daa5ad7 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Thu, 7 Nov 2024 12:48:40 +0000 Subject: [PATCH] Update examples --- examples/audio-through-example.py | 7 ++++++- examples/granulation-example.py | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/audio-through-example.py b/examples/audio-through-example.py index 4b9b9626..7721d2ae 100755 --- a/examples/audio-through-example.py +++ b/examples/audio-through-example.py @@ -9,6 +9,9 @@ def main(): + print("Audio playthrough: Plays the microphone input through the default output") + print("Listen through headphones to avoid feedback") + graph = AudioGraph() #-------------------------------------------------------------------------------- @@ -18,12 +21,14 @@ def main(): # [audio] # input_device_name = "My Device" #-------------------------------------------------------------------------------- - audio_in = AudioIn(1) + audio_in = AudioIn() + audio_in = audio_in[0] #-------------------------------------------------------------------------------- # Add some delay, and play #-------------------------------------------------------------------------------- output = audio_in + output = output + CombDelay(output, 0.1, feedback=0.8) stereo = StereoPanner(output) graph.play(stereo) diff --git a/examples/granulation-example.py b/examples/granulation-example.py index 2583ff52..4cf2d038 100755 --- a/examples/granulation-example.py +++ b/examples/granulation-example.py @@ -16,9 +16,10 @@ def main(): #------------------------------------------------------------------------ # Load an audio buffer. #------------------------------------------------------------------------ - audio_path = os.path.join(os.path.dirname(__file__), "audio", "gliss.aif") + audio_path = os.path.join(os.path.dirname(__file__), "audio", "stereo-count.wav") buf = Buffer(audio_path) - clock = RandomImpulse(50) + grain_frequency = WhiteNoise(frequency=2, min=1, max=50) + clock = RandomImpulse(grain_frequency) granulator = Granulator(buffer=buf, clock=clock, pan=RandomUniform(-1, 1, clock=clock), @@ -35,4 +36,4 @@ def main(): graph.wait() if __name__ == "__main__": - main() \ No newline at end of file + main()