Previous topic

music21.chord

Next topic

music21.common

Table Of Contents

Table Of Contents

This Page

music21.clef

This module defines numerous subclasses of Clef, providing object representations for all commonly used clefs. Clef objects are often found within Measure objects.

Functions

music21.clef.clefFromString(clefString, octaveShift=0)

Returns a Clef object given a string like “G2” or “F4” etc.

>>> tc = clef.clefFromString("G2")
>>> tc
<music21.clef.TrebleClef>
>>> nonStandard1 = clef.clefFromString("F1")
>>> nonStandard1
<music21.clef.FClef>
>>> nonStandard1.line
1
>>> nonStandard2 = clef.clefFromString("D4")
>>> nonStandard2
<music21.clef.PitchClef>
>>> nonStandard2.sign
'D'
>>> nonStandard2.line
4
>>> tc8vb = clef.clefFromString("G2", -1)
>>> tc8vb
<music21.clef.Treble8vbClef>
>>> tabClef = clef.clefFromString("TAB")
>>> tabClef
<music21.clef.TabClef>

Clef

class music21.clef.Clef

A Clef is a basic music21 object for representing musical clefs (Treble, Bass, etc.)

Some clefs only represent the graphical element of the clef, such as G clef, which is subclassed by TrebleClef() and FrenchViolinClef().

>>> tc = clef.TrebleClef()
>>> tc
<music21.clef.TrebleClef>
>>> tc.sign
'G'
>>> tc.line
2

Most clefs also have a “lowest note” function which represents the diatonicNoteNum of the note. (Where C4,C#4,C##4,C-4 etc. = 29, all types of D4 = 30, etc.)

>>> tc.lowestLine
31

Clef bases

Clef read-only properties

Read-only properties inherited from Music21Object:

Clef read/write properties

Read/write properties inherited from Music21Object:

Clef methods

Methods inherited from Music21Object:

Clef instance variables

Instance variables inherited from Music21Object:

TrebleClef

class music21.clef.TrebleClef

TrebleClef bases

TrebleClef read-only properties

Read-only properties inherited from Music21Object:

TrebleClef read/write properties

Read/write properties inherited from Music21Object:

TrebleClef methods

Methods inherited from Music21Object:

TrebleClef instance variables

Instance variables inherited from GClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

BassClef

class music21.clef.BassClef

BassClef bases

BassClef read-only properties

Read-only properties inherited from Music21Object:

BassClef read/write properties

Read/write properties inherited from Music21Object:

BassClef methods

Methods inherited from Music21Object:

BassClef instance variables

Instance variables inherited from FClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

AltoClef

class music21.clef.AltoClef

AltoClef bases

AltoClef read-only properties

Read-only properties inherited from Music21Object:

AltoClef read/write properties

Read/write properties inherited from Music21Object:

AltoClef methods

Methods inherited from Music21Object:

AltoClef instance variables

Instance variables inherited from CClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

Bass8vaClef

class music21.clef.Bass8vaClef

Bass8vaClef bases

Bass8vaClef read-only properties

Read-only properties inherited from Music21Object:

Bass8vaClef read/write properties

Read/write properties inherited from Music21Object:

Bass8vaClef methods

Methods inherited from Music21Object:

Bass8vaClef instance variables

Instance variables inherited from FClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

Bass8vbClef

class music21.clef.Bass8vbClef

Bass8vbClef bases

Bass8vbClef read-only properties

Read-only properties inherited from Music21Object:

Bass8vbClef read/write properties

Read/write properties inherited from Music21Object:

Bass8vbClef methods

Methods inherited from Music21Object:

Bass8vbClef instance variables

Instance variables inherited from FClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

CBaritoneClef

class music21.clef.CBaritoneClef

CBaritoneClef bases

CBaritoneClef read-only properties

Read-only properties inherited from Music21Object:

CBaritoneClef read/write properties

Read/write properties inherited from Music21Object:

CBaritoneClef methods

Methods inherited from Music21Object:

CBaritoneClef instance variables

Instance variables inherited from CClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

FBaritoneClef

class music21.clef.FBaritoneClef

FBaritoneClef bases

FBaritoneClef read-only properties

Read-only properties inherited from Music21Object:

FBaritoneClef read/write properties

Read/write properties inherited from Music21Object:

FBaritoneClef methods

Methods inherited from Music21Object:

FBaritoneClef instance variables

Instance variables inherited from FClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

FrenchViolinClef

class music21.clef.FrenchViolinClef

FrenchViolinClef bases

FrenchViolinClef read-only properties

Read-only properties inherited from Music21Object:

FrenchViolinClef read/write properties

Read/write properties inherited from Music21Object:

FrenchViolinClef methods

Methods inherited from Music21Object:

FrenchViolinClef instance variables

Instance variables inherited from GClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

GSopranoClef

class music21.clef.GSopranoClef

GSopranoClef bases

GSopranoClef read-only properties

Read-only properties inherited from Music21Object:

GSopranoClef read/write properties

Read/write properties inherited from Music21Object:

GSopranoClef methods

Methods inherited from Music21Object:

GSopranoClef instance variables

Instance variables inherited from GClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

MezzoSopranoClef

class music21.clef.MezzoSopranoClef

MezzoSopranoClef bases

MezzoSopranoClef read-only properties

Read-only properties inherited from Music21Object:

MezzoSopranoClef read/write properties

Read/write properties inherited from Music21Object:

MezzoSopranoClef methods

Methods inherited from Music21Object:

MezzoSopranoClef instance variables

Instance variables inherited from CClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

SopranoClef

class music21.clef.SopranoClef

SopranoClef bases

SopranoClef read-only properties

Read-only properties inherited from Music21Object:

SopranoClef read/write properties

Read/write properties inherited from Music21Object:

SopranoClef methods

Methods inherited from Music21Object:

SopranoClef instance variables

Instance variables inherited from CClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

SubBassClef

class music21.clef.SubBassClef

SubBassClef bases

SubBassClef read-only properties

Read-only properties inherited from Music21Object:

SubBassClef read/write properties

Read/write properties inherited from Music21Object:

SubBassClef methods

Methods inherited from Music21Object:

SubBassClef instance variables

Instance variables inherited from FClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

TabClef

class music21.clef.TabClef

represents a Tablature clef.

TabClef bases

TabClef read-only properties

Read-only properties inherited from Music21Object:

TabClef read/write properties

Read/write properties inherited from Music21Object:

TabClef methods

Methods inherited from Music21Object:

TabClef instance variables

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

TenorClef

class music21.clef.TenorClef

TenorClef bases

TenorClef read-only properties

Read-only properties inherited from Music21Object:

TenorClef read/write properties

Read/write properties inherited from Music21Object:

TenorClef methods

Methods inherited from Music21Object:

TenorClef instance variables

Instance variables inherited from CClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

Treble8vaClef

class music21.clef.Treble8vaClef

Treble8vaClef bases

Treble8vaClef read-only properties

Read-only properties inherited from Music21Object:

Treble8vaClef read/write properties

Read/write properties inherited from Music21Object:

Treble8vaClef methods

Methods inherited from Music21Object:

Treble8vaClef instance variables

Instance variables inherited from TrebleClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from GClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object:

Treble8vbClef

class music21.clef.Treble8vbClef

Treble8vbClef bases

Treble8vbClef read-only properties

Read-only properties inherited from Music21Object:

Treble8vbClef read/write properties

Read/write properties inherited from Music21Object:

Treble8vbClef methods

Methods inherited from Music21Object:

Treble8vbClef instance variables

Instance variables inherited from TrebleClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from GClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from PitchClef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Clef:

  • isStream
  • hideObjectOnPrint
  • classSortOrder
  • groups
  • isVariant
  • id
  • isSpanner
  • xPosition

Instance variables inherited from Music21Object: