Beispiel #1
0
rate = Message('control_change', channel = 5, control = 12, value = 65) # 70 - 65
length = Message('control_change', channel = 6, control = 12, value = random.randrange(28, 35)) # 28 - 35
rep = Message('control_change', channel = 8, control = 12, value = 40) # 35 - 40
pitch = Message('control_change', channel = 9, control = 12, value = 127) # 100 - 127
decay = Message('control_change', channel = 10, control = 12, value = 86) # 76 - 86

# Create output
outport = mido.open_output()

# Algorithm: laugh
outport.send(track)
outport.send(sel)
outport.send(msg_on)
outport.send(rate)
outport.send(length)
outport.send(rep)
outport.send(pitch)
outport.send(decay)
re = int(np.round((16.0/127.0)*rep.value))
for i in range (0, re):
	transp.value = transp.value + 3*i
	#transp.value = 46 + 5*i
	outport.send(transp)
	time.sleep(.087)

time.sleep(0.5)


# Send msg_off and close outport
outport.send(msg_off)
outport.close()
Beispiel #2
0
sel = Message('control_change', channel = 3, control = 12, value = 120)

transp = Message('control_change', channel = 4, control = 12, value = 30) # from 30 - 60 to 70 - 100
rate = Message('control_change', channel = 5, control = 12, value = 60) # from 60 - 30 to 30 - 0
length = Message('control_change', channel = 6, control = 12, value = 19)
pitch = Message('control_change', channel = 9, control = 12, value = 75)

# Create output
outport = mido.open_output()

# Algorithm 1
# Send MIDI
transp0 = transp.value
rate0 = rate.value

outport.send(msg_on)
outport.send(track)
outport.send(sel)
outport.send(length)
while not rospy.is_shutdown():
	transp.value = random.randrange(transp0, transp0 + 30)
	rate.value = random.randrange(rate0 - 30, rate0)
	pitch.value = random.randrange(0, 127)
	outport.send(transp)
	outport.send(rate)
	outport.send(pitch)
	time.sleep(.3)

# Send msg_off and close outport
outport.send(msg_off)
outport.close()
Beispiel #3
0
# TERROR (IN AFFECTION)

# Define controls
msg_on = Message('note_on', channel = 3, note = 60, velocity = 90, time = 0)
msg_off = Message('note_off', channel = 3, note = 60, velocity = 90, time = 0) 

track = Message('control_change', channel = 0, control = 12, value = 1)
sel = Message('control_change', channel = 3, control = 12, value = 89)
length = Message('control_change', channel = 6, control = 12, value = 54)
amount = Message('control_change', channel = 7, control = 12, value = 120)
pitch = Message('control_change', channel = 9, control = 12, value = 100)

# Create output
outport = mido.open_output()

# Algorithm 1
# Send MIDI
outport.send(msg_on)
outport.send(track)
outport.send(sel)
outport.send(length)
outport.send(amount)
for i in range (100, 111):
    pitch.value = i
    time.sleep(0.3)
    outport.send(pitch)
time.sleep(0.5)

# Send msg_off and close outport
outport.send(msg_off)
outport.close()
Beispiel #4
0
# Define controls
msg_on = Message('note_on', channel = 3, note = 60, velocity = 90, time = 0)
msg_off = Message('note_off', channel = 3, note = 60, velocity = 90, time = 0) 

track = Message('control_change', channel = 0, control = 12, value = 1)
sel = Message('control_change', channel = 3, control = 12, value = 120)
transp = Message('control_change', channel = 4, control = 12, value = random.randrange(65, 102))
rate = Message('control_change', channel = 5, control = 12, value = random.randrange(20, 50))
length = Message('control_change', channel = 6, control = 12, value = 19)
pitch = Message('control_change', channel = 8, control = 12, value = 75)

# Create output
outport = mido.open_output()

# Algorithm 1
# Send MIDI
outport.send(msg_on)
outport.send(track)
outport.send(sel)
outport.send(length)
outport.send(pitch)
while not rospy.is_shutdown():
	transp.value = random.randrange(50, 100)
	rate.value = random.randrange(10, 60)
	outport.send(transp)
	outport.send(rate)
	time.sleep(.3)

# Send msg_off and close outport
outport.send(msg_off)
outport.close()
Beispiel #5
0
rate = Message('control_change', channel = 5, control = 12, value = 94)
length = Message('control_change', channel = 6, control = 12, value = 40)
rep = Message('control_change', channel = 8, control = 12, value = 38)
pitch = Message('control_change', channel = 9, control = 12, value = 101)
decay = Message('control_change', channel = 10, control = 12, value = 76)

# Create output
outport = mido.open_output()

# Algorithm 1
# Send MIDI
outport.send(msg_on)
outport.send(track)
outport.send(sel)
outport.send(rate)
outport.send(length)
outport.send(rep)
outport.send(pitch) # Variating this from each kill
outport.send(decay)
for i in range(0,5):
	transp.value = 60 + 5*i
	outport.send(msg_on)
	outport.send(transp)
	time.sleep(0.2)

time.sleep(0.3)


# Send msg_off and close outport
outport.send(msg_off)
outport.close()
Beispiel #6
0
outport = mido.open_output()

# Algorithm: the more arousal the more transp and length of the first note (ralentize)
# Send MIDI
outport.send(msg_on)
outport.send(track)
outport.send(sel)
outport.send(transp)
outport.send(rate)
outport.send(length)
outport.send(rep)
outport.send(pitch)
outport.send(decay)

time.sleep(.230) # Time related to rate
rate.value = 60
length.value = 35
outport.send(rate)
outport.send(length) 
time.sleep(.200) # Time related to rep*rate
length.value = 60
pitch.value = 27
decay.value = 100
outport.send(transp)
outport.send(length)
outport.send(pitch)
outport.send(decay)

# Send msg_off and close outport
outport.send(msg_off)
outport.close()