Ejemplo n.º 1
0
    def _getIncipit(self):
        '''
        Gets the Incipit PolyphonicSnippet of the piece.
        
        
        The incipit keeps its time signature
        in a different location from all the other snippets.
        hence, it's a little different
        

        Returns None if the piece or timeSignature is 
        undefined
        
        
        
        >>> bs = trecento.cadencebook.BallataSheet()
        >>> accur = bs.makeWork(2)
        >>> accurIncipit = accur.incipit
        >>> print(accurIncipit)
        <music21.trecento.polyphonicSnippet.Incipit ...>
        '''
        rowBlock = self.rowvalues[8:12]
        rowBlock.append(self.rowvalues[7])
        if (rowBlock[0] == "" or self.timeSigBegin == ""):
            return None
        else: 
            blockOut = self.convertBlockToStreams(rowBlock)
            return polyphonicSnippet.Incipit(blockOut, self)
Ejemplo n.º 2
0
    def getSnippetAtPosition(self, snippetPosition, snippetType="end"):
        '''
        gets a "snippet" which is a collection of up to 3 lines of music, a timeSignature
        and a description of the cadence.

        
        >>> bs = trecento.cadencebook.BallataSheet()
        >>> accur = bs.makeWork(2)
        >>> print(accur.getSnippetAtPosition(12))
        <music21.trecento.polyphonicSnippet.FrontPaddedSnippet ...>
        '''
        
        if self.rowvalues[snippetPosition].strip() != "":
            thisBlock = self.rowvalues[snippetPosition:snippetPosition+5]
            if thisBlock[4].strip() == "":
                if self.timeSigBegin == "":
                    return None  ## need a timesig
                thisBlock[4] = self.timeSigBegin
            blockOut = self.convertBlockToStreams(thisBlock)
            if snippetType == 'begin':
                return polyphonicSnippet.Incipit(blockOut, self)
            else:
                return polyphonicSnippet.FrontPaddedSnippet(blockOut, self)