Use python MIDI to write some simple music

Related tags

Audio music
Overview

Use Python MIDI to write songs

本项目使用python的MIDI库和pygame库实现了用计算机演奏音乐

目录结构

music.py中定义了弹奏单个音符和弹奏和弦的函数,play_midi用于演奏音乐;fsj.py和hls.py分别实现了《我是一个粉刷匠》和《欢乐颂》的片段; chord.py实现了一个非常通用的和弦旋律 CAFG,可以使用该旋律作为大部分流行歌曲的伴奏。如《传奇》,《好久不见》,《菊花台》,《感恩的心》,《听海》等。

单轨音乐

函数play_note定义了如何弹出一个音符

# note表示音高,length表示拍子的长度,base_note是do开始的音高,octachord表示跨越几个八度, velocity表示音乐击打的速度,表现为强度
play_note(note, length, track, bpm, program, base_note=60, octachord=0, velocity=64, channel=0)

和弦

函数play_chord定义了如何弹奏出一个大三和弦

# 大三和弦(全全半全全全半)
def play_chord(note, track, track1, track2, track3, bpm, program, octachord=0, base_note=60, length=1):
You might also like...
A collection of free MIDI chords and progressions ready to be used in your DAW, Akai MPC, or Roland MC-707/101
A collection of free MIDI chords and progressions ready to be used in your DAW, Akai MPC, or Roland MC-707/101

A collection of free MIDI chords and progressions ready to be used in your DAW, Akai MPC, or Roland MC-707/101

Tradutor de um arquivo MIDI para ser usado em um simulador RISC-V(RARS)

Tradutor_MIDI-RISC-V Tradutor de um arquivo MIDI para ser usado em um simulador RISC-V(RARS) *O resultado sai com essa formatação: nota,duração,nota,d

Algorithmic and AI MIDI Drums Generator Implementation
Algorithmic and AI MIDI Drums Generator Implementation

Algorithmic and AI MIDI Drums Generator Implementation

Convert complex chord names to midi notes
Convert complex chord names to midi notes

ezchord Simple python script that can convert complex chord names to midi notes Prerequisites pip install midiutil Usage ./ezchord.py Dmin7 G7 C timi

MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling
MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling

MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling Demos | Blog Post | Colab Notebook | Paper | MIDI-DDSP is a hierarchical

A lightweight yet powerful audio-to-MIDI converter with pitch bend detection
A lightweight yet powerful audio-to-MIDI converter with pitch bend detection

Basic Pitch is a Python library for Automatic Music Transcription (AMT), using lightweight neural network developed by Spotify's Audio Intelligence La

We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.
We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

Music player - endlessly plays your music
Music player - endlessly plays your music

Music player First, if you wonder about what is supposed to be a music player or what makes a music player different from a simple media player, read

Music player and music library manager for Linux, Windows, and macOS
Music player and music library manager for Linux, Windows, and macOS

Ex Falso / Quod Libet - A Music Library / Editor / Player Quod Libet is a music management program. It provides several different ways to view your au

Owner
小宝
小宝
❤️ Hi There Im Cozmo Music Bot A next gen powerful telegram group Music bot for get your Songs and music @Venuja_Sadew

?? Cozmo MUSIC ?? Cozmo Music is a Music powerfull bot for playing music on telegram voice chat groups. Requirements FFmpeg NodeJS nodesource.com Pyth

Venuja Sadew 3 Jan 8, 2022
Okaeri-Music is a telegram music bot project, allow you to play music on voice chat group telegram.

Okaeri-Music is a telegram bot project that's allow you to play music on telegram voice chat group

Wahyusaputra 1 Dec 22, 2021
Okaeri-Music is a telegram music bot project, allow you to play music on voice chat group telegram.

??️ PROJECT MUSIC,THIS IS MAINTAINED Okaeri-Music is a telegram bot project that's allow you to play music on telegram voice chat group Features ?? Th

Okaeri-Project 2 Dec 23, 2021
NovaMusic is a music sharing robot. Users can get music and music lyrics using inline queries.

A music sharing telegram robot using Redis database and Telebot python library using Redis database.

Hesam Norin 7 Oct 21, 2022
A small project where I identify notes and key harmonies in a piece of music and use them further to recreate and generate the same piece of music through Python

A small project where I identify notes and key harmonies in a piece of music and use them further to recreate and generate the same piece of music through Python

null 5 Oct 7, 2022
This is a python package that turns any images into MIDI files that views the same as them

image_to_midi This is a python package that turns any images into MIDI files that views the same as them. This package firstly convert the image to AS

Rainbow Dreamer 4 Mar 10, 2022
A python program for visualizing MIDI files, and displaying them in a spiral layout

SpiralMusic_python A python program for visualizing MIDI files, and displaying them in a spiral layout For a hardware version using Teensy & LED displ

Gavin 6 Nov 23, 2022
ianZiPu is a way to write notation for Guqin (古琴) music.

JianZiPu Font JianZiPu is a way to write notation for Guqin (古琴) music. This document will cover how to use this font, and how to contribute to its de

Nancy Yi Liang 8 Nov 25, 2022
Users can transcribe their favorite piano recordings to MIDI files after installation

Users can transcribe their favorite piano recordings to MIDI files after installation

null 190 Dec 17, 2022
Learn chords with your MIDI keyboard !

miditeach miditeach is a music learning tool that can be used to practice your chords skills with a midi keyboard ?? ! Features Midi keyboard input se

Alexis LOUIS 3 Oct 20, 2021