Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tracks_array = { "PART DRUMS" : 999,
- "PART GUITAR" : 999,
- "PART BASS" : 999,
- "PART VOCALS" : 999,
- "PART KEYS" : 999,
- "PART REAL_KEYS_X": 999,
- "PART REAL_KEYS_H": 999,
- "PART REAL_KEYS_M": 999,
- "PART REAL_KEYS_E": 999,
- "PART KEYS_ANIM_LH": 999,
- "PART KEYS_ANIM_RH": 999,
- "HARM1": 999,
- "HARM2": 999,
- "HARM3": 999,
- "EVENTS": 999,
- "BEAT": 999,
- "PART DRUMS 2X": 999,
- "VENUE": 999,
- "PART RHYTHM": 999,
- "PART REAL_GUITAR": 999,
- "PART REAL_GUITAR_22": 999,
- "PART REAL_BASS": 999,
- "PART REAL_BASS_22": 999
- }
- array_instruments = {
- "Drums" : "PART DRUMS",
- "2x Drums" : "PART DRUMS 2X",
- "Rhythm" : "PART RHYTHM",
- "Guitar" : "PART GUITAR",
- "Bass" : "PART BASS",
- "Keys" : "PART KEYS",
- "Pro Keys" : "PART REAL_KEYS",
- "Vocals" : "PART VOCALS",
- "Harmony 1" : "HARM1",
- "Harmony 2" : "HARM2",
- "Harmony 3" : "HARM3",
- "Pro Guitar" : "PART REAL_GUITAR",
- "Pro Guitar 22" : "PART REAL_GUITAR_22",
- "Pro Bass" : "PART REAL_BASS",
- "Pro Bass 22" : "PART REAL_BASS_22"
- }
- ...
- def pg_root_notes(instrument, estringlow, astring, dstring, gstring, bstring, estringhigh):
- #instrument (PART REAL_GUITAR, PART REAL_GUITAR_22, PART REAL_BASS, PART REAL_BASS_22)
- #all strings : tuning
- global maxlen
- instrument_track = tracks_array[instrument]
- notes_dict = notesname_array[notesname_instruments_array[instrument]]
- division = int(math.floor((correct_tqn*4)*divisions_array[grid]))
- array_instrument_data = process_instrument(instrument_track)
- array_instrument_notes = array_instrument_data[1]
- end_part = array_instrument_data[2]
- start_part = array_instrument_data[3]
- array_notesevents = create_notes_array(array_instrument_notes)
- array_notes = array_notesevents[0]
- array_events = array_notesevents[1]
- notes_found = 0
- result = 0
- string1 = 0 + estringlow
- string2 = 0 + astring
- string3 = 0 + dstring
- string4 = 0 + gstring
- string5 = 0 + bstring
- string6 = 0 + estringhigh
- for x in range(0, len(array_notes)):
- note = array_notes[x]
- if notes_dict[note[2]][1] == "root_notes":
- notes_found = 1
- result = RPR_MB( "Root notes found. Do you want to delete them and proceed?", "Root notes found", 1 )
- break
- if result == 1 or notes_found == 0:
- array_temp = list(array_notes)
- array_notes = []
- for x in range(0, len(array_temp)):
- note = array_temp[x]
- if notes_dict[note[2]][1] != "root_notes":
- array_notes.append(note)
- else:
- return
- for x in range(0, len(array_notes)):
- note = array_notes[x]
- if notes_dict[note[2]][1] == "notes_x":
- #It's an expert note, let's add it as a root note
- new_note = list(note)
- if(pitch == 96): #Which string? Which note?
- openstring = 4 + string1
- if(pitch == 97):
- openstring = 9 + string2
- if(pitch == 98):
- openstring = 14 + string3
- if(pitch == 99):
- openstring = 7 + string4
- if(pitch == 100):
- openstring = 11 + string5
- if(pitch == 101):
- openstring = 4 + string6
- root = openstring + velocity
- if (root > 3 or root < 16):
- while True: #Determining the right MIDI note by adding/removing an octave if necessary
- if (root < 4):
- newroot = root + 12
- if newroot > 3 or newroot < 16:
- break
- if (root > 15):
- newroot = root - 12
- if newroot > 3 or newroot < 16:
- break
- new_note[2] = newroot
- array_notes.append(new_note)
- array_notes = add_objects(array_validnotes, array_validobjects)
- write_midi(instrument_track, [array_notes, array_events], end_part, start_part)
Advertisement
Add Comment
Please, Sign In to add comment