Exemple #1
0
 def get_notes_for_key(self, key, rotate_by=0, slice=None):
     """ Get the notes for the note_seq starting from a given key. Then
         rotates the sequence (by rotate_by). Then slices it (using the
         argument in the slice parameter).
     """
     default_seq = self.nseq_temp.get_note_sequence(key, self.nseq_posn, 
         self.nseq_nat_posns); #C
     modulus = self.nseq_temp.no_nat_keys; 
     if slice:
         return multislice(default_seq, slice, offset=rotate_by, 
             mod=modulus);
     else:
         return rotate(default_seq, rotate_by);
Exemple #2
0
 def get_notes_for_key(self, key, rotate_by=0, slice=None):
     """ Get the notes for the note_seq starting from a given key. Then
         rotates the sequence (by rotate_by). Then slices it (using the
         argument in the slice parameter).
     """
     default_seq = self.nseq_temp.get_note_sequence(key, self.nseq_posn,
                                                    self.nseq_nat_posns)
     #C
     modulus = self.nseq_temp.no_nat_keys
     if slice:
         return multislice(default_seq,
                           slice,
                           offset=rotate_by,
                           mod=modulus)
     else:
         return rotate(default_seq, rotate_by)
Exemple #3
0
 def get_posn_for_offset(self, rotate_by=0, slice=None, raz = False):
     """ For this noteseq, output its positions relative to its first
         note, then rotates the sequence (by rotate_by), then slices
         it (using slice, if not none). If and only if raz is True, the
         result is rotated-and-zeroed.
     """
     if slice:
         modulus = self.nseq_temp.no_nat_keys; 
         multisliced = multislice(self.nseq_posn, slice, offset=rotate_by,
             mod = modulus);
         if raz:
             return rotate_and_zero(multisliced, 0, self.nseq_temp.no_keys);
         else:
             return multisliced;
     else:
         if raz:
             return rotate_and_zero(self.nseq_posn, rotate_by, 
                 self.nseq_temp.no_keys);
         else:
             return rotate(self.nseq_posn, rotate_by);
Exemple #4
0
 def get_posn_for_offset(self, rotate_by=0, slice=None, raz=False):
     """ For this noteseq, output its positions relative to its first
         note, then rotates the sequence (by rotate_by), then slices
         it (using slice, if not none). If and only if raz is True, the
         result is rotated-and-zeroed.
     """
     if slice:
         modulus = self.nseq_temp.no_nat_keys
         multisliced = multislice(self.nseq_posn,
                                  slice,
                                  offset=rotate_by,
                                  mod=modulus)
         if raz:
             return rotate_and_zero(multisliced, 0, self.nseq_temp.no_keys)
         else:
             return multisliced
     else:
         if raz:
             return rotate_and_zero(self.nseq_posn, rotate_by,
                                    self.nseq_temp.no_keys)
         else:
             return rotate(self.nseq_posn, rotate_by)