Python的MIDI开发包 MIDIUtil

码农软件 · 软件分类 · 多媒体处理 · 2019-09-15 11:27:36

软件介绍

MIDIUtil 是一个 Python 包,用来生成 MIDI 音乐文件。

示例代码:

#Import the library

from midiutil.MidiFile import MIDIFile

# Create the MIDIFile Object with 1 track
MyMIDI = MIDIFile(1)

# Tracks are numbered from zero. Times are measured in beats.

track = 0  
time = 0

# Add track name and tempo.
MyMIDI.addTrackName(track,time,"Sample Track")
MyMIDI.addTempo(track,time,120)

# Add a note. addNote expects the following information:
track = 0
channel = 0
pitch = 60
time = 0
duration = 1
volume = 100

# Now add the note.
MyMIDI.addNote(track,channel,pitch,time,duration,volume)

# And write it to disk.
binfile = open("output.mid", 'wb')
MyMIDI.writeFile(binfile)
binfile.close()

本文地址:https://codercto.com/soft/d/14642.html

计算机算法基础

计算机算法基础

余祥宣、崔国华、邹海明 / 华中科技大学出版社 / 2006-4 / 29.80元

《计算机算法基础》围绕算法设计的基本方法,对计算机领域中许多常用的非数值算法作了精辟的描述,并分析了这些算法所需的时间和空间。《计算机算法基础》可作为高等院校与计算机有关的各专业的教学用书,也可作为从事计算机科学、工程和应用的工作人员的自学教材和参考书。一起来看看 《计算机算法基础》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具