-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Sumanth edited this page Mar 27, 2018
·
4 revisions
soundmodular is a library of functions designed to perform real-time signal processing on blocks of audio. Each function takes inputs and outputs in a similar fashion, hence allowing them to be aggregated into a signal chain to imitate modular synthesis.
soundmodular is put together as two classes:
Create a python file and paste this code. Ensure dependencies are available and installed. It should output a sequence of sounds upon running.
from soundmodular import Patcher
from pyaudio import paInt16
options = {
'format': paInt16,
'channels': 2,
'sampling_rate': 22000,
'save_file': 'testfile.wav'
}
patcher = Patcher(options)
module = patcher.module
T = 0.3 # Time in seconds
noise = module.wnoise(0.7*T, 0.2*T, 0.6)
for n in range(2,6):
filt = module.filterbank_22k(noise, n, 1)
patcher.to_master(filt, 0.5, 0.5)
osc = module.osc_tone(T, 440)
patcher.to_master(osc, 0.5, 0.5)
patcher.terminate()
options
contains parameters necessary to setup the PyAudio and wave instances. soundmodular offers a limited API to these libraries.