Standard MIDI File

Standard MIDI File (SMF)

class mutagen.smf.SMF(filething)

Bases: mutagen.FileType

Standard MIDI File (SMF)

info
Type

SMFInfo

tags

None

add_tags()

Adds new tags to the file.

Raises

mutagen.MutagenError – if tags already exist or adding is not possible.

static score(filename, fileobj, header)

Returns a score for how likely the file can be parsed by this type.

Parameters
  • filename (fspath) – a file path

  • fileobj (fileobj) – a file object open in rb mode. Position is undefined

  • header (bytes) – data of undefined length, starts with the start of the file.

Returns

negative if definitely not a matching type, otherwise a score,

the bigger the more certain that the file can be loaded.

Return type

int

class mutagen.smf.SMFInfo
length

Length in seconds

Type

float

pprint()
Returns

Print stream information

Return type

text