diff --git a/docs/TMIDIX.html b/docs/TMIDIX.html index 0c094c2..0518dae 100644 --- a/docs/TMIDIX.html +++ b/docs/TMIDIX.html @@ -1136,6 +1136,7 @@

Index

  • advanced_score_processor
  • advanced_validate_chord_pitches
  • align_escore_notes_to_bars
  • +
  • all_consequtive
  • analyze_score_pitches
  • ascii_text_words_counter
  • ascii_texts_search
  • @@ -10189,33 +10190,44 @@
    def escore_notes_to_parsons_code(escore_notes, times_index=1, - pitches_index=4 + pitches_index=4, + return_as_list=False ): - parsons = "" + parsons = "*" + parsons_list = [] prev = ['note', -1, -1, -1, -1, -1, -1] for e in escore_notes: if e[times_index] != prev[times_index]: - if parsons == "": - parsons += "*" - - elif e[pitches_index] > prev[pitches_index]: + if e[pitches_index] > prev[pitches_index]: parsons += "U" + parsons_list.append(1) elif e[pitches_index] < prev[pitches_index]: parsons += "D" + parsons_list.append(-1) elif e[pitches_index] == prev[pitches_index]: parsons += "R" + parsons_list.append(0) prev = e - return parsons + if return_as_list: + return parsons_list + + else: + return parsons ################################################################################### + +def all_consequtive(list_of_values): + return all(b > a for a, b in zip(list_of_values[:-1], list_of_values[1:])) + +################################################################################### # # This is the end of the TMIDI X Python module # @@ -14166,6 +14178,27 @@

    Functions

    +
    +
    +

    def all_consequtive(

    list_of_values)

    +
    + + + + +
    + +
    +
    def all_consequtive(list_of_values):
    +  return all(b > a for a, b in zip(list_of_values[:-1], list_of_values[1:]))
    +
    + +
    +
    + +
    + +

    def analyze_score_pitches(

    score, channels_to_analyze=[0])

    @@ -16720,7 +16753,7 @@

    Functions

    -

    def escore_notes_to_parsons_code(

    escore_notes, times_index=1, pitches_index=4)

    +

    def escore_notes_to_parsons_code(

    escore_notes, times_index=1, pitches_index=4, return_as_list=False)

    @@ -16731,31 +16764,37 @@

    Functions

    def escore_notes_to_parsons_code(escore_notes,
                                      times_index=1,
    -                                 pitches_index=4
    +                                 pitches_index=4,
    +                                 return_as_list=False
                                      ):
       
    -  parsons = ""
    +  parsons = "*"
    +  parsons_list = []
     
       prev = ['note', -1, -1, -1, -1, -1, -1]
     
       for e in escore_notes:
         if e[times_index] != prev[times_index]:
     
    -      if parsons == "":
    -          parsons += "*"
    -
    -      elif e[pitches_index] > prev[pitches_index]:
    +      if e[pitches_index] > prev[pitches_index]:
               parsons += "U"
    +          parsons_list.append(1)
     
           elif e[pitches_index] < prev[pitches_index]:
               parsons += "D"
    +          parsons_list.append(-1)
     
           elif e[pitches_index] == prev[pitches_index]:
               parsons += "R"
    +          parsons_list.append(0)
           
           prev = e
     
    -  return parsons
    +  if return_as_list:
    +    return parsons_list
    +  
    +  else:
    +    return parsons