History

python/demos/demo_keyboard.py: remove gnuplot stuff

Paul Brossier committed 13 years ago

Commit 5caf4741 parent 03f27b01 file · +5 −27Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/demos/demo_keyboard.py+5−27
@@ -1,6 +1,6 @@
1#! /usr/bin/env python1#! /usr/bin/env python
2 2
3def get_keyboard_edges(firstnote = 21, lastnote = 108, y0 = 0, y1 = 1):3def get_keyboard_edges(firstnote = 21, lastnote = 108):
4 octaves = 104 octaves = 10
5 5
6 # build template of white notes6 # build template of white notes
@@ -22,18 +22,7 @@ def get_keyboard_edges(firstnote = 21, lastnote = 108, y0 = 0, y1 = 1): · 15 unmodified lines
22 if curnote > firstnote-1 and curnote < lastnote+1:22 if curnote > firstnote-1 and curnote < lastnote+1:
23 xw = xw + [curnote]23 xw = xw + [curnote]
24 24
25 xwdelta = [1/2. * scalew for i in range(len(xw))]25 return xb, xw, 2/3. *scaleb, 1/2. * scalew
26 yw = [y0+(y1-y0)*1/2. for i in range(len(xw))]
27 ywdelta = [(y1-y0)*1/2. for i in range(len(xw))]
28
29 xbdelta = [2/3. * scaleb for i in range(len(xb))]
30 yb = [y0+(y1-y0)*2/3. for i in range(len(xb))]
31 ybdelta = [(y1-y0)*1/3. for i in range(len(xb))]
32
33 whites,white_height = xw,yw
34 blacks,black_height = xb,yb
35
36 return blacks,whites, 2/3. *scaleb, 1/2. * scalew
37 26
38def create_keyboard_patches(firstnote, lastnote, ax = None):27def create_keyboard_patches(firstnote, lastnote, ax = None):
39 import numpy as np28 import numpy as np
@@ -69,17 +58,6 @@ def create_keyboard_patches(firstnote, lastnote, ax = None): · 29 unmodified lines
69 58
70if __name__ == '__main__':59if __name__ == '__main__':
71 60
72 if 0:61 import matplotlib.pyplot as plt
73 from aubio.gnuplot import gnuplot_create62 create_keyboard_patches(firstnote = 58, lastnote = 84)
74 import Gnuplot63 plt.show()
75 whites = Gnuplot.Data(blacks, yw,xwdelta,ywdelta,with_ = 'boxxyerrorbars')
76 blacks = Gnuplot.Data(whites, yb,xbdelta,ybdelta,with_ = 'boxxyerrorbars fill solid')
77 g = gnuplot_create('','')
78 #g('set style fill solid .5')
79 #g('set xrange [60-.5:72+.5]')
80 #g('set yrange [-0.1:1.1]')
81 g.plot(whites,blacks)
82 else:
83 import matplotlib.pyplot as plt
84 create_keyboard_patches(firstnote = 61, lastnote = 108)
85 plt.show()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t