This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<music21.note.Note A> 0.0 | |
<music21.note.Note A> 0.0 | |
<music21.note.Note A> 0.0 | |
<music21.note.Note A> 0.25 | |
<music21.note.Note G> 2/3 | |
<music21.note.Note G> 2/3 | |
<music21.note.Note F#> 1.0 | |
<music21.note.Note F#> 1.25 | |
<music21.note.Note D> 1.5 | |
<music21.note.Note D> 1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from music21 import converter, instrument, note, chord, stream | |
import glob | |
import pickle | |
import numpy as np | |
from keras.utils import np_utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
np.diag(a) | |
Output: array([1, 2, 3, 4]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.diag([1,2,3,4]) | |
print(a) | |
Output: | |
[[1 0 0 0] | |
[0 2 0 0] | |
[0 0 3 0] | |
[0 0 0 4]] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.eye(5) | |
print(a) | |
Output: | |
[[1. 0. 0. 0. 0.] | |
[0. 1. 0. 0. 0.] | |
[0. 0. 1. 0. 0.] | |
[0. 0. 0. 1. 0.] | |
[0. 0. 0. 0. 1.]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.ones(5) | |
print(a) | |
Output: [1. 1. 1. 1. 1.] | |
a = np.ones((5,5)) | |
print(a) | |
Output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.zeros(4) | |
print(a) | |
Output: [0. 0. 0. 0.] | |
a = np.zeros((3,4)) | |
print(a) | |
Output: | |
[[0. 0. 0. 0.] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.array([[[1,2],[3,4]],[[5,6],[7,8]]]) | |
print(a) | |
Output: | |
[[[1 2] | |
[3 4]] | |
[[5 6] | |
[7 8]]] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.array([[1,2,3,4],[5,6,7,8]]) | |
print(a) | |
Output: | |
[[1 2 3 4] | |
[5 6 7 8]] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.linspace(1,10,5) | |
print(a) | |
Output: | |
[ 1. 3.25 5.5 7.75 10. ] | |