Example #1
0
    8: "attack",
    20: "decay",
    24: "sustain",
    4: "release"}


from_cc = [mido.Message('control_change', control=note_here, channel=4, value=127) for note_here in range(0,8)]
to_cc   = [mido.Message('control_change', control=note_here+16, channel=0, value=127) for note_here in range(0,8)]
mapping = dict(zip(from_cc, to_cc))



instrument = inst.LightInstrument( 
    note_list=[36,37,38,39,44,45,46], 
    light_list=lights.keys(), 
    cc_controls = cc_controls,
    note_channel = 0,
    envelope_params = envelope_params,
    mode = "single" )

cc_controls_2 = dict()
for key, value in cc_controls.iteritems():
    cc_controls_2[key+1] = value

instrument2 = inst.LightInstrument( 
    note_list=[43], 
    light_list=lights.keys(), 
    mode="all", 
    rgb=(1,1,1), 
    envelope_params = copy.copy(envelope_params),
    cc_controls = cc_controls_2,
Example #2
0
    2: "lfo_level",
    3: "saturation",
    4: "hue",
    5: "sustain",
    6: "level",
    
    7: "attack",
    8: "decay",
    9: "sustain",
    10: "release",
    11: 'mode'}

instrument = inst.LightInstrument( 
    note_list=[60,61],#38,39,44,45,46], 
    light_list=lights.keys(), 
    cc_controls = cc_controls,
    #note_channel = 1,
    envelope_params = envelope_params,
    mode = "all" )

instrument2 = inst.LightInstrument( 
    note_list=[40,41],#,42,43,47,48,49], 
    light_list=lights.keys(), 
    mode="all", 
    rgb=(1,1,1), 
    envelope_params = copy.copy(envelope_params),
    cc_controls = cc_controls
    #note_channel = 0 
    )

instrument_rack = [instrument, instrument2]
Example #3
0
    1: "lfo_rate",
    2: "lfo_level",
    3: "saturation",
    4: "hue",
    6: "level",
    7: "mode",
    103: "attack",
    104: "decay",
    107: "sustain",
    108: "release"
}

instrument = inst.LightInstrument(
    #note_list=[48,37],#,38,39,44,45,46],
    note_list=lights.keys(),
    light_list=lights.keys(),
    cc_controls=cc_controls,
    envelope_params=envelope_params,
    mode="cycle")

modes_ind = 1

instrument_rack = [instrument]

while 1:
    for device, midi_port in port_dict.iteritems():

        # if two cc messages with the same control and channel have come then only append most recent
        message_queue = mt.iter_pending_clean(midi_port)

        for msg in message_queue:
Example #4
0
    'lfo_level': 0,
    'lfo_rate': 1
}
cc_controls = {
    1: "lfo_rate",
    2: "lfo_level",
    3: "saturation",
    4: "hue",
    5: "sustain",
    6: "level",
    26: 'mode'
}

instrument = inst.LightInstrument(note_list=[60, 62],
                                  light_list=lights.keys(),
                                  cc_controls=cc_controls,
                                  note_channel=1,
                                  envelope_params=envelope_params,
                                  mode="cycle")

instrument2 = inst.LightInstrument(light_list=lights.keys(),
                                   mode="all",
                                   rgb=(1, 1, 1),
                                   envelope_params=envelope_params,
                                   note_channel=0)

instrument_rack = [instrument, instrument2]

while 1:
    for device, midi_port in port_dict.iteritems():

        # if two cc messages with the same control and channel have come then only append most recent