1# Simple Melody
2s = Server().boot()
3s.start()
4wav = SquareTable()
5env = CosTable([(0,0), (100,1), (500,.3), (8191,0)])
6met = Metro(.125, 12).play()
7amp = TrigEnv(met, table=env, mul=.1)
8pit = TrigXnoiseMidi(met, dist='loopseg', x1=20, scale=1, mrange=(48,84))
9out = Osc(table=wav, freq=pit, mul=amp).out()