# save as test_dawdreamer.py import dawdreamer as daw from scipy.io import wavfile import numpy as np # Basic setup SAMPLE_RATE = 44100 BUFFER_SIZE = 512 # Create render engine engine = daw.RenderEngine(SAMPLE_RATE, BUFFER_SIZE) engine.set_bpm(120.0) print("DawDreamer installed successfully!") print(f"Sample rate: {SAMPLE_RATE}") print(f"Buffer size: {BUFFER_SIZE}") # Test with built-in synthesis (no VST needed) faust_processor = engine.make_faust_processor("synth") faust_processor.set_dsp_string(""" declare name "TestSine"; freq = 440; gain = 0.1; process = freq : os.osc : _*gain <: si.bus(2); """) # Set up processing graph engine.load_graph([(faust_processor, [])]) # Render 2 seconds engine.render(2.0) # Get audio and save audio = engine.get_audio() # shaped (2, N samples) wavfile.write("test_outputs/test_output.wav", SAMPLE_RATE, audio.transpose()) print("Generated test_output.wav - a 2-second 440Hz sine wave")