Last active
December 14, 2015 03:29
-
-
Save maddievision/5021865 to your computer and use it in GitHub Desktop.
concept au python library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from coreaudio import Session | |
from ctypes import int16 | |
from audiounit import Graph, Unit | |
from coremidi import MusicPlayer | |
graph = Graph({ "sample_rate": 44100, "channels": 2, "format": int16 }) | |
mixer = Unit("Mixer") | |
graph.add(mixer) | |
sampler1 = Unit("AUSampler") | |
sampler2 = Unit("AUSampler") | |
lowpass = Unit("AULowpass") | |
mixer.connect(sampler1,0) | |
mixer.connect(lowpass,1) | |
lowpass.connect(sampler2) | |
player = MusicPlayer("test.mid") | |
player.tracks[0].assign_output(sampler1.node) | |
player.tracks[1].assign_output(sampler2.node) | |
player.tracks[1].map_cc(74,lowpass.q) | |
player.play() | |
graph.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment