from musx.paint import spray # The blues scale. blues = [0, 3, 5, 6, 7, 10, 12] # It's good practice to add any metadata such as tempo, midi instrument # assignments, micro tuning, etc. to track 0 in your midi file. track0 = MidiFile.metatrack() # Track 1 will hold the composition. track1 = Seq() # Create a score and give it tr1 to hold the score event data. score = Score(out=track1) # The sections of the piece s1 = spray(score, duration=.2, rhythm=.2, band=[0, 3, 5], pitch=30, amplitude=0.35, end=36) s2 = spray(score, duration=.2, rhythm=[-.2, -.4, .2, .2], band=[3, 7, 6], pitch=pick(30, 42), amplitude=0.5, end=25) s3 = spray(score, duration=.2, rhythm=[-.2, .2, .2], band=blues, pitch=pick(42, 54),
# Microtonal divisions of the semitone. 2 is quartertone (50 cents) etc. tuning = 7 # It's good practice to add any metadata such as tempo, midi instrument # assignments, micro tuning, etc. to track 0 in your midi file. t0 = MidiSeq.metaseq(ins={i: Vibraphone for i in range(tuning)}, tuning=tuning) # Track 1 holds the composition. t1 = MidiSeq() # Create a scheduler and give it t1 as its output object. q = Scheduler(t1) # The sections of the piece s1 = spray(q, key=48, dur=3, rhy=[1, .5], amp=A([.3, .35, .4]), band=scale1, end=40, tuning=tuning) s2 = spray(q, key=48, dur=3, rhy=[1, .5], amp=A([.4, .45, .5]), band=scale3, end=25, tuning=tuning) s3 = spray(q, key=72, dur=3, rhy=[.75, .25, .5],
# Microtonal divisions of the semitone. 2 is quartertone (50 cents) etc. microdivs = 7 # It's good practice to add any metadata such as tempo, midi instrument # assignments, micro tuning, etc. to track 0 in your midi file. track0 = MidiFile.metatrack(ins={i: Vibraphone for i in range(microdivs)}) # Track 1 holds the composition. track1 = Seq() # Create a score and give it tr1 to hold the score event data. score = Score(out=track1) # The sections of the piece s1 = spray(score, pitch=48, duration=3, rhythm=[1, .5], amplitude=A([.3, .35, .4]), band=scale1, end=40) s2 = spray(score, pitch=48, duration=3, rhythm=[1, .5], amplitude=A([.4, .45, .5]), band=scale3, end=25) s3 = spray(score, pitch=72, duration=3, rhythm=[.75, .25, .5], amplitude=A([.4, .3, .35]),
from musx.midi import MidiSeq, MidiFile from musx.ran import pick from musx.tools import playfile, setmidiplayer from musx.scheduler import Scheduler # The blues scale. blues = [0, 3, 5, 6, 7, 10, 12] # It's good practice to add any metadata such as tempo, midi instrument # assignments, micro tuning, etc. to track 0 in your midi file. t0 = MidiSeq.metaseq() # Track 1 will hold the composition. t1 = MidiSeq() # Create a scheduler and give it t1 as its output object. q = Scheduler(t1) # The sections of the piece s1 = spray(q, dur=.2, rhy=.2, band=[0, 3, 5], key=30, amp=0.35, end=36) s2 = spray(q, dur=.2, rhy=[-.2, -.4, .2, .2], band=[3, 7, 6], key=pick(30, 42), amp=0.5, end=25) s3 = spray(q, dur=.2, rhy=[-.2, .2, .2], band=blues, key=pick(42, 54), chan=2, end=20) s4 = spray(q, dur=.2, rhy=[-.6, .4, .4], band=blues, key=66, amp=0.4, end=15)