def create_riff_1():
    '''Create tick list'''

    PATTERN_LENGTH = 256
    steps = [0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30]
    phrase_length = 32

    repeats = int(PATTERN_LENGTH / phrase_length)
    expanded_tick_sequence = []

    nominal_tick_position = 0
    for repeat in range(repeats):
        for entry in steps:
            expanded_tick_sequence.append(entry + nominal_tick_position)
        nominal_tick_position += 32

    for tick_event in expanded_tick_sequence:
        if tick_event >= 0:
            notes = from_chord(["C-3", "E-3", "B-3", "G-2"])
        if tick_event >= 64:
            notes = from_chord(["D-3", "F#3", "B-3", "G-3"])
        if tick_event >= 128:
            notes = from_chord(["C#3", "E-3", "B-3", "A-2"])
        if tick_event >= 176:
            notes = from_chord(["C#3", "Eb3", "F#3", "Bb3"])
        if tick_event >= 208:
            notes = from_chord(["C#3", "F-3", "F#3", "Bb3"])

        for track, note in enumerate(notes):
            pattern.insert_value(chordnoteplug.get_id(), 2, track, 0,
                                 tick_event, note, 0)
            pattern.insert_value(chordnoteplug.get_id(), 2, track, 0,
                                 tick_event + 1, to_note("off"), 0)  # note off

    app_wait(6)
def create_riff_1():
    '''Create tick list'''
    
    PATTERN_LENGTH = 256
    steps = [0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30]
    phrase_length = 32

    repeats = int(PATTERN_LENGTH / phrase_length)
    expanded_tick_sequence = []

    nominal_tick_position = 0
    for repeat in range(repeats):
        for entry in steps:
            expanded_tick_sequence.append(entry + nominal_tick_position)
        nominal_tick_position += 32

    for tick_event in expanded_tick_sequence:
      if tick_event >= 0:
        notes = from_chord(["C-3", "E-3", "B-3", "G-2"])
      if tick_event >= 64:
        notes = from_chord(["D-3", "F#3", "B-3", "G-3"])
      if tick_event >= 128:
        notes = from_chord(["C#3", "E-3", "B-3", "A-2"])
      if tick_event >= 176:
        notes = from_chord(["C#3", "Eb3", "F#3", "Bb3"])
      if tick_event >= 208:
        notes = from_chord(["C#3", "F-3", "F#3", "Bb3"])

      for track, note in enumerate(notes):
        pattern.insert_value(chordnoteplug.get_id(), 2, track, 0, tick_event, note, 0)
        pattern.insert_value(chordnoteplug.get_id(), 2, track, 0, tick_event+1, to_note("off"), 0) # note off
      
    app_wait(6)
cur_path = os.getcwd()
file_and_path = os.path.join(cur_path, "Samples", "HHCD4.WAV")
target = player.get_wave(0)
doc.import_wave(file_and_path, target)



# fill the stab pattern
tick_list = get_tick_triggers()
synthID = synth.get_id()
for tick_event in range(PATTERN_LENGTH):
    if tick_event in tick_list:
        notes = from_chord(["C-3", "E-3", "B-3", "G-2"])
        for track, note in enumerate(notes):
            stabs_pattern.insert_value(synthID, 2, track, 0, tick_event, note, 0)
            stabs_pattern.insert_value(synthID, 2, track, 0, tick_event+1, to_note("off"), 0) # note off
player.history_commit(0, 0, "Filled Stabs Pattern")


# fill the kick pattern
for tick_event in range(0, PATTERN_LENGTH, 8):
    kick_pattern.insert_value(kicksynth.get_id(), 2, 0, 0, tick_event, 1, 0)


# add stabs to the first track of the sequence_pattern, assumes presence of one track.
seq_plug = player.get_plugin_by_name("Pattern")
sequence_pattern = player.get_pattern_by_name("00")
sequence_pattern.insert_value(seq_plug.get_id(), 2, 0, 0, 0, stabs_pattern.get_id(), 0)
sequence_pattern.set_row_count(128)
sequence_pattern.set_display_resolution(16)
player.history_commit(0, 0, "Added Stabs Pattern to Sequence Pattern 00")
示例#4
0
file_and_path = os.path.join(cur_path, "Samples", "Carilon_HHC.wav")
target = player.get_wave(0)
doc.import_wave(file_and_path, target)
''' F i l l i n g   P a t t e r n s '''

# fill the stab pattern
tick_list = get_tick_triggers()
synthID = synth.get_id()
for tick_event in range(PATTERN_LENGTH):
    if tick_event in tick_list:
        notes = from_chord(["C-3", "E-3", "B-3", "G-2"])
        for track, note in enumerate(notes):
            stabs_pattern.insert_value(synthID, 2, track, 0, tick_event, note,
                                       0)
            stabs_pattern.insert_value(synthID, 2, track, 0, tick_event + 1,
                                       to_note("off"), 0)
player.history_commit(0, 0, "Filled Stabs Pattern")

# fill the kick pattern
for tick_event in range(0, PATTERN_LENGTH, 8):
    kick_pattern.insert_value(kicksynth.get_id(), 2, 0, 0, tick_event, 1, 0)

# fill the samples pattern, // TODO maybe set active wave table slot instead..
sample_slot = 1  # 01
for tick_event in range(4, PATTERN_LENGTH, 8):
    samples_pattern.insert_value(matilde_one.get_id(), 2, 0, 0, tick_event,
                                 to_note("C-4"), 0)
    samples_pattern.insert_value(matilde_one.get_id(), 2, 0, 1, tick_event,
                                 sample_slot, 0)
    samples_pattern.insert_value(matilde_one.get_id(), 2, 0, 2, tick_event, 78,
                                 0)  # volume
示例#5
0
    subset:     list of 1 or more parameters to add.  f.ex [2,4,5,9] of lunar verb.
    '''
    column_idx = count_format_columns(format)
    for column in subset:
        format.add_column(plugin, group, track, column, column_idx)
        column_idx += 1


synth_location = (-.25, -1)
synth = create_machine(LUNAR_SYNTH, synth_location, 6, "Synthline")
connect_machines("Synthline > Master")
synthline_format = create_simple_format_from_machine(synth)
player.history_commit(0, 0, "Added Default Format(s)")

# Create the pattern
pattern = player.create_pattern(synthline_format, "Stabs", PATTERN_LENGTH)
player.history_commit(0, 0, "Added Stabs Pattern")

# then iterate over it
tick = 0
for tick_event in range(PATTERN_LENGTH):
    if tick_event in make_rhythm():
        # print("trigger")
        notes = from_chord(["C-3", "E-3", "B-3", "G-2"])
        for track, note in enumerate(notes):
            pattern.insert_value(synth.get_id(), 2, track, 0, tick_event, note,
                                 0)
            pattern.insert_value(synth.get_id(), 2, track, 0, tick_event + 1,
                                 to_note("off"), 0)  # note off
player.history_commit(0, 0, "Filled Stabs Pattern")


''' F i l l i n g   P a t t e r n s '''



# fill the stab pattern
tick_list = get_tick_triggers()
synthID = synth.get_id()
for tick_event in range(PATTERN_LENGTH):
    if tick_event in tick_list:
        notes = from_chord(["C-3", "E-3", "B-3", "G-2"])
        for track, note in enumerate(notes):
            stabs_pattern.insert_value(synthID, 2, track, 0, tick_event, note, 0)
            stabs_pattern.insert_value(synthID, 2, track, 0, tick_event+1, to_note("off"), 0)
player.history_commit(0, 0, "Filled Stabs Pattern")


# fill the kick pattern
for tick_event in range(0, PATTERN_LENGTH, 8):
    kick_pattern.insert_value(kicksynth.get_id(), 2, 0, 0, tick_event, 1, 0)


# fill the samples pattern, // TODO maybe set active wave table slot instead..
sample_slot = 6 # 01
for tick_event in range(4, PATTERN_LENGTH, 8):
    samples_pattern.insert_value(matilde_one.get_id(), 2, 0, 0, tick_event, to_note("C-4"), 0)
    samples_pattern.insert_value(matilde_one.get_id(), 2, 0, 1, tick_event, sample_slot, 0)
    samples_pattern.insert_value(matilde_one.get_id(), 2, 0, 2, tick_event, 78, 0) # volume