{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"import music21\n",
"from music21.midi import MidiFile\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import mido"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# midi messages"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "\n\n\n\nprogram_change channel=0 program=30 time=0\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=60 velocity=100 time=0\nnote_on channel=0 note=48 velocity=0 time=220\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=55 velocity=100 time=0\nnote_on channel=0 note=60 velocity=0 time=0\nnote_on channel=0 note=60 velocity=100 time=0\nnote_on channel=0 note=48 velocity=0 time=220\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=55 velocity=0 time=0\nnote_on channel=0 note=55 velocity=100 time=0\nnote_on channel=0 note=60 velocity=0 time=0\nnote_on channel=0 note=60 velocity=100 time=0\nnote_on channel=0 note=48 velocity=0 time=440\nnote_on channel=0 note=55 velocity=0 time=0\nnote_on channel=0 note=60 velocity=0 time=0\nnote_on channel=0 note=48 velocity=0 time=110\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=45 velocity=100 time=770\nnote_on channel=0 note=50 velocity=100 time=0\nnote_on channel=0 note=57 velocity=100 time=0\nnote_on channel=0 note=45 velocity=0 time=220\nnote_on channel=0 note=46 velocity=100 time=0\nnote_on channel=0 note=50 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=57 velocity=0 time=0\nnote_on channel=0 note=58 velocity=100 time=0\nnote_on channel=0 note=46 velocity=0 time=220\nnote_on channel=0 note=46 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=58 velocity=0 time=0\nnote_on channel=0 note=58 velocity=100 time=0\nnote_on channel=0 note=46 velocity=0 time=220\nnote_on channel=0 note=46 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=58 velocity=0 time=0\nnote_on channel=0 note=58 velocity=100 time=0\nnote_on channel=0 note=46 velocity=0 time=440\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=58 velocity=0 time=0\nnote_on channel=0 note=60 velocity=100 time=0\nnote_on channel=0 note=48 velocity=0 time=440\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=60 velocity=0 time=0\nnote_on channel=0 note=60 velocity=100 time=0\nnote_on channel=0 note=48 velocity=0 time=220\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=60 velocity=0 time=0\nnote_on channel=0 note=48 velocity=0 time=220\nnote_on channel=0 note=51 velocity=100 time=0\nnote_on channel=0 note=48 velocity=100 time=220\nnote_on channel=0 note=51 velocity=0 time=0\nnote_on channel=0 note=48 velocity=0 time=220\nnote_on channel=0 note=60 velocity=100 time=0\nnote_on channel=0 note=51 velocity=100 time=220\nnote_on channel=0 note=60 velocity=0 time=0\nnote_on channel=0 note=51 velocity=0 time=220\nnote_on channel=0 note=51 velocity=100 time=0\nnote_on channel=0 note=51 velocity=0 time=220\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=46 velocity=100 time=440\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=58 velocity=100 time=0\nnote_on channel=0 note=46 velocity=0 time=990\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=58 velocity=0 time=0\nnote_on channel=0 note=46 velocity=100 time=110\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=58 velocity=100 time=0\nnote_on channel=0 note=46 velocity=0 time=220\nnote_on channel=0 note=46 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=58 velocity=0 time=0\nnote_on channel=0 note=58 velocity=100 time=0\nnote_on channel=0 note=41 velocity=100 time=220\nnote_on channel=0 note=46 velocity=0 time=0\nnote_on channel=0 note=48 velocity=100 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=53 velocity=100 time=0\nnote_on channel=0 note=57 velocity=100 time=0\nnote_on channel=0 note=58 velocity=0 time=0\nnote_on channel=0 note=41 velocity=0 time=220\nnote_on channel=0 note=48 velocity=0 time=0\nnote_on channel=0 note=53 velocity=0 time=0\nnote_on channel=0 note=57 velocity=0 time=0\n\n\nprogram_change channel=1 program=1 time=0\nnote_on channel=1 note=60 velocity=100 time=0\nnote_on channel=1 note=60 velocity=0 time=220\nnote_on channel=1 note=62 velocity=100 time=0\nnote_on channel=1 note=62 velocity=0 time=220\nnote_on channel=1 note=63 velocity=100 time=0\nnote_on channel=1 note=63 velocity=0 time=220\nnote_on channel=1 note=62 velocity=100 time=220\nnote_on channel=1 note=62 velocity=0 time=220\nnote_on channel=1 note=75 velocity=100 time=0\nnote_on channel=1 note=58 velocity=100 time=220\nnote_on channel=1 note=75 velocity=0 time=0\nnote_on channel=1 note=75 velocity=100 time=0\nnote_on channel=1 note=58 velocity=0 time=220\nnote_on channel=1 note=75 velocity=0 time=0\nnote_on channel=1 note=75 velocity=100 time=0\nnote_on channel=1 note=75 velocity=0 time=220\nnote_on channel=1 note=75 velocity=100 time=0\nnote_on channel=1 note=75 velocity=0 time=220\nnote_on channel=1 note=72 velocity=100 time=220\nnote_on channel=1 note=72 velocity=0 time=220\nnote_on channel=1 note=75 velocity=100 time=440\nnote_on channel=1 note=75 velocity=0 time=220\nnote_on channel=1 note=72 velocity=100 time=220\nnote_on channel=1 note=72 velocity=0 time=220\nnote_on channel=1 note=75 velocity=100 time=0\nnote_on channel=1 note=75 velocity=0 time=220\nnote_on channel=1 note=72 velocity=100 time=220\nnote_on channel=1 note=72 velocity=0 time=220\nnote_on channel=1 note=75 velocity=100 time=440\nnote_on channel=1 note=75 velocity=0 time=220\nnote_on channel=1 note=72 velocity=100 time=220\nnote_on channel=1 note=72 velocity=0 time=220\nnote_on channel=1 note=70 velocity=100 time=220\nnote_on channel=1 note=70 velocity=0 time=220\nnote_on channel=1 note=70 velocity=100 time=0\nnote_on channel=1 note=70 velocity=0 time=220\nnote_on channel=1 note=70 velocity=100 time=0\nnote_on channel=1 note=70 velocity=0 time=220\nnote_on channel=1 note=70 velocity=100 time=0\nnote_on channel=1 note=70 velocity=0 time=440\nnote_on channel=1 note=71 velocity=100 time=0\nnote_on channel=1 note=71 velocity=0 time=440\n\n\nprogram_change channel=2 program=35 time=0\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=22 velocity=100 time=0\nnote_on channel=2 note=22 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=29 velocity=100 time=0\nnote_on channel=2 note=29 velocity=0 time=220\nnote_on channel=2 note=31 velocity=100 time=0\nnote_on channel=2 note=31 velocity=0 time=220\nnote_on channel=2 note=31 velocity=100 time=0\nnote_on channel=2 note=31 velocity=0 time=220\nnote_on channel=2 note=32 velocity=100 time=220\nnote_on channel=2 note=32 velocity=0 time=220\nnote_on channel=2 note=32 velocity=100 time=0\nnote_on channel=2 note=32 velocity=0 time=220\nnote_on channel=2 note=34 velocity=100 time=220\nnote_on channel=2 note=34 velocity=0 time=220\nnote_on channel=2 note=34 velocity=100 time=0\nnote_on channel=2 note=24 velocity=100 time=220\nnote_on channel=2 note=34 velocity=0 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\nnote_on channel=2 note=24 velocity=100 time=0\nnote_on channel=2 note=24 velocity=0 time=220\n\n\nprogram_change channel=9 program=1 time=0\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=110\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=49 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=49 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=110\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=110\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=110\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=49 velocity=100 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=49 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=36 velocity=100 time=0\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\nnote_on channel=9 note=38 velocity=100 time=0\nnote_on channel=9 note=36 velocity=100 time=220\nnote_on channel=9 note=38 velocity=0 time=0\nnote_on channel=9 note=36 velocity=0 time=220\n\n"
}
],
"source": [
"filepath = '/home/altarin/praca-magisterska/docs/images/seq2seq_generated_midi_7.mid'\n",
"mid = mido.MidiFile(filepath)\n",
"for i, track in enumerate(mid.tracks):\n",
" for msg in track:\n",
" print(msg)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Regresja liniowa"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": "[]"
},
"metadata": {},
"execution_count": 7
},
{
"output_type": "display_data",
"data": {
"text/plain": "