Ejemplo n.º 1
0
import marsyas
import json

net = marsyas.system_from_script(""" 

     Network : Series
     {
        -> input: NoiseSource
        -> amp: Gain
        -> output: AudioSink
     }
""")
print net.toStringShort()
Ejemplo n.º 2
0
import marsyas 
import json 
from marsyas_util import *


net = marsyas.system_from_script(""" 

     Network : Series
     {
	+ public frequency = 440.0 
	+ public g0 = 1.0
	+ public g1 = 0.1
	+ public g2 = 0.2 
	+ public g3 = 0.1
	israte = 44100.0
        -> Fanout 
        {	
           -> f0: Series {-> sin1: SineSource {frequency = /frequency} -> amp1: Gain {gain = /g0}} 
           -> f1: Series {-> sin2: SineSource {frequency = (2 * /frequency)} -> amp2: Gain {gain = /g1}} 
           -> f2: Series {-> sin3: SineSource {frequency = (3 * /frequency)} -> amp2: Gain {gain = /g2}} 
           -> f3: Series {-> sin4: SineSource {frequency = (4 * /frequency)} -> amp2: Gain {gain = /g3}} 
 	}
	-> sum: Sum 
 	-> out: AudioSink
     }
""")
net.updControl("/Series/Network/AudioSink/out/mrs_bool/initAudio", marsyas.MarControlPtr.from_bool(True))
k = 1
while (1): 
	k = k+1 	
 	net.tick()
Ejemplo n.º 3
0
import marsyas 
import json 


net = marsyas.system_from_script_file("test.mrs")
print net.toStringShort()


net = marsyas.system_from_script(""" 

     Network : Series
     {
        -> input: NoiseSource
        -> amp: Gain
        -> output: AudioSink
     }
""")
print net.toStringShort()


Ejemplo n.º 4
0
import marsyas
import json
from marsyas_util import *

net = marsyas.system_from_script(""" 

     Network : Series
     {
	+ public frequency = 440.0 
	+ public g0 = 1.0
	+ public g1 = 0.1
	+ public g2 = 0.2 
	+ public g3 = 0.1
	israte = 44100.0
        -> Fanout 
        {	
           -> f0: Series {-> sin1: SineSource {frequency = /frequency} -> amp1: Gain {gain = /g0}} 
           -> f1: Series {-> sin2: SineSource {frequency = (2 * /frequency)} -> amp2: Gain {gain = /g1}} 
           -> f2: Series {-> sin3: SineSource {frequency = (3 * /frequency)} -> amp2: Gain {gain = /g2}} 
           -> f3: Series {-> sin4: SineSource {frequency = (4 * /frequency)} -> amp2: Gain {gain = /g3}} 
 	}
	-> sum: Sum 
 	-> out: AudioSink
     }
""")
net.updControl("/Series/Network/AudioSink/out/mrs_bool/initAudio",
               marsyas.MarControlPtr.from_bool(True))
k = 1
while (1):
    k = k + 1
    net.tick()