Pitch ExampleΒΆ

[1]:
from musicnpy import *
from IPython.display import Image
[2]:
a = Scale([0, 1, 2, 3, 4, 5, 6], 60)
b = a.sort('<').shift(-9)
c = b.interleave(a)
c -= 23
a = Staff(a.values, 4, 90).out
b = Staff(b.values, 4, 90).out
c = Staff(c.values, 4, 90).out

Score((a, b, c), filename='./images/scale', format='png', size=(150, 100)).make_file
Image(filename='./images/scale.png')
Changing working directory to: `./images'
Processing `./images/scale.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Interpreting music...
MIDI output to `scale.midi'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to PNG...
Success: compilation successfully completed
[2]:
../_images/example_pitch_example_2_1.png

Chord

[3]:
a = Chord.new(ChordModel.min, 48)
b = Chord.new(ChordModel.maj, 78)
c = a.interpolation(b, 10, 2.5)
d = b.interpolation(a, 10, 5.25)

a += 12
b -= 12

sequenza = PitchSequence((b, c, d, a)).out

d = Staff(sequenza, 4, 90).out

Score((d), filename='./prova', format='png', size=(220, 50)).make_file
Image(filename='./prova.png')
Processing `./prova.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Interpreting music...
MIDI output to `./prova.midi'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to PNG...
Success: compilation successfully completed
[3]:
../_images/example_pitch_example_4_1.png