Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 251003
Collapse All | Expand All

(-)aubio-0.3.2-old/python/aubio/bench/onset.py (-6 / +6 lines)
Lines 111-117 class benchonset(bench): Link Here
111
		for i in self.vlist:
111
		for i in self.vlist:
112
			gd.append(i['GD']) 
112
			gd.append(i['GD']) 
113
			fp.append(i['FP']) 
113
			fp.append(i['FP']) 
114
		d.append(Gnuplot.Data(fp, gd, with='linespoints', 
114
		d.append(Gnuplot.Data(fp, gd, with_='linespoints', 
115
			title="%s %s" % (plottitle,i['mode']) ))
115
			title="%s %s" % (plottitle,i['mode']) ))
116
116
117
	def plotplotroc(self,d,outplot=0,extension='ps'):
117
	def plotplotroc(self,d,outplot=0,extension='ps'):
Lines 147-153 class benchonset(bench): Link Here
147
		for i in self.vlist:
147
		for i in self.vlist:
148
			x.append(i['prec']) 
148
			x.append(i['prec']) 
149
			y.append(i['recl']) 
149
			y.append(i['recl']) 
150
		d.append(Gnuplot.Data(x, y, with='linespoints', 
150
		d.append(Gnuplot.Data(x, y, with_='linespoints', 
151
			title="%s %s" % (plottitle,i['mode']) ))
151
			title="%s %s" % (plottitle,i['mode']) ))
152
152
153
	def plotplotpr(self,d,outplot=0,extension='ps'):
153
	def plotplotpr(self,d,outplot=0,extension='ps'):
Lines 172-178 class benchonset(bench): Link Here
172
		for i in self.vlist:
172
		for i in self.vlist:
173
			x.append(i['thres']) 
173
			x.append(i['thres']) 
174
			y.append(i['dist']) 
174
			y.append(i['dist']) 
175
		d.append(Gnuplot.Data(x, y, with='linespoints', 
175
		d.append(Gnuplot.Data(x, y, with_='linespoints', 
176
			title="%s %s" % (plottitle,i['mode']) ))
176
			title="%s %s" % (plottitle,i['mode']) ))
177
177
178
	def plotplotfmeas(self,d,outplot="",extension='ps', title="F-measure"):
178
	def plotplotfmeas(self,d,outplot="",extension='ps', title="F-measure"):
Lines 205-211 class benchonset(bench): Link Here
205
		for i in self.vlist:
205
		for i in self.vlist:
206
			x.append(i[var]) 
206
			x.append(i[var]) 
207
			y.append(i['dist']) 
207
			y.append(i['dist']) 
208
		d.append(Gnuplot.Data(x, y, with='linespoints', 
208
		d.append(Gnuplot.Data(x, y, with_='linespoints', 
209
			title="%s %s" % (plottitle,i['mode']) ))
209
			title="%s %s" % (plottitle,i['mode']) ))
210
	
210
	
211
	def plotplotfmeasvar(self,d,var,outplot="",extension='ps', title="F-measure"):
211
	def plotplotfmeasvar(self,d,var,outplot="",extension='ps', title="F-measure"):
Lines 244-250 class benchonset(bench): Link Here
244
		total = v['Torig']
244
		total = v['Torig']
245
		for i in range(len(per)): per[i] /= total/100.
245
		for i in range(len(per)): per[i] /= total/100.
246
246
247
		d.append(Gnuplot.Data(val, per, with='fsteps', 
247
		d.append(Gnuplot.Data(val, per, with_='fsteps', 
248
			title="%s %s" % (plottitle,v['mode']) ))
248
			title="%s %s" % (plottitle,v['mode']) ))
249
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
249
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
250
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
250
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
Lines 275-281 class benchonset(bench): Link Here
275
		total = v['Torig']
275
		total = v['Torig']
276
		for i in range(len(per)): per[i] /= total/100.
276
		for i in range(len(per)): per[i] /= total/100.
277
277
278
		d.append(Gnuplot.Data(val, per, with='fsteps', 
278
		d.append(Gnuplot.Data(val, per, with_='fsteps', 
279
			title="%s %s" % (plottitle,v['mode']) ))
279
			title="%s %s" % (plottitle,v['mode']) ))
280
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
280
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (mean,smean))
281
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
281
		#d.append('mean=%f,sigma=%f,eps(x) title \"\"'% (amean,samean))
(-)aubio-0.3.2-old/python/aubio/gnuplot.py (-2 / +2 lines)
Lines 155-161 def make_audio_plot(time,data,maxpoints= Link Here
155
  """ create gnuplot plot from an audio file """
155
  """ create gnuplot plot from an audio file """
156
  import Gnuplot, Gnuplot.funcutils
156
  import Gnuplot, Gnuplot.funcutils
157
  x,y = downsample_audio(time,data,maxpoints=maxpoints)
157
  x,y = downsample_audio(time,data,maxpoints=maxpoints)
158
  return Gnuplot.Data(x,y,with='lines')
158
  return Gnuplot.Data(x,y,with_='lines')
159
159
160
def make_audio_envelope(time,data,maxpoints=10000):
160
def make_audio_envelope(time,data,maxpoints=10000):
161
  """ create gnuplot plot from an audio file """
161
  """ create gnuplot plot from an audio file """
Lines 165-171 def make_audio_envelope(time,data,maxpoi Link Here
165
  x = [i.mean() for i in numarray.array(time).resize(len(time)/bufsize,bufsize)] 
165
  x = [i.mean() for i in numarray.array(time).resize(len(time)/bufsize,bufsize)] 
166
  y = [i.mean() for i in numarray.array(data).resize(len(time)/bufsize,bufsize)] 
166
  y = [i.mean() for i in numarray.array(data).resize(len(time)/bufsize,bufsize)] 
167
  x,y = downsample_audio(x,y,maxpoints=maxpoints)
167
  x,y = downsample_audio(x,y,maxpoints=maxpoints)
168
  return Gnuplot.Data(x,y,with='lines')
168
  return Gnuplot.Data(x,y,with_='lines')
169
169
170
def gnuplot_addargs(parser):
170
def gnuplot_addargs(parser):
171
  """ add common gnuplot argument to OptParser object """
171
  """ add common gnuplot argument to OptParser object """
(-)aubio-0.3.2-old/python/aubio/plot/keyboard.py (-2 / +2 lines)
Lines 30-37 def draw_keyboard(firstnote = 21, lastno Link Here
30
  yb      = [y0+(y1-y0)*2/3. 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))]
31
  ybdelta = [(y1-y0)*1/3. for i in range(len(xb))]
32
32
33
  whites  = Gnuplot.Data(xw,yw,xwdelta,ywdelta,with = 'boxxyerrorbars')
33
  whites  = Gnuplot.Data(xw,yw,xwdelta,ywdelta,with_ = 'boxxyerrorbars')
34
  blacks  = Gnuplot.Data(xb,yb,xbdelta,ybdelta,with = 'boxxyerrorbars fill solid')
34
  blacks  = Gnuplot.Data(xb,yb,xbdelta,ybdelta,with_ = 'boxxyerrorbars fill solid')
35
35
36
  return blacks,whites
36
  return blacks,whites
37
37
(-)aubio-0.3.2-old/python/aubio/task/beat.py (-2 / +2 lines)
Lines 247-253 class taskbeat(taskonset): Link Here
247
247
248
	def plot(self,oplots,results):
248
	def plot(self,oplots,results):
249
		import Gnuplot
249
		import Gnuplot
250
		oplots.append(Gnuplot.Data(results,with='linespoints',title="auto"))
250
		oplots.append(Gnuplot.Data(results,with_='linespoints',title="auto"))
251
251
252
	def plotplot(self,wplot,oplots,outplot=None,extension=None,xsize=1.,ysize=1.,spectro=False):
252
	def plotplot(self,wplot,oplots,outplot=None,extension=None,xsize=1.,ysize=1.,spectro=False):
253
		import Gnuplot
253
		import Gnuplot
Lines 258-262 class taskbeat(taskonset): Link Here
258
		#f = make_audio_plot(time,data)
258
		#f = make_audio_plot(time,data)
259
259
260
		g = gnuplot_create(outplot=outplot, extension=extension)
260
		g = gnuplot_create(outplot=outplot, extension=extension)
261
		oplots = [Gnuplot.Data(self.gettruth(),with='linespoints',title="orig")] + oplots
261
		oplots = [Gnuplot.Data(self.gettruth(),with_='linespoints',title="orig")] + oplots
262
		g.plot(*oplots)
262
		g.plot(*oplots)
(-)aubio-0.3.2-old/python/aubio/task/notes.py (-5 / +5 lines)
Lines 95-109 class tasknotes(task): Link Here
95
		import numarray
95
		import numarray
96
		import Gnuplot
96
		import Gnuplot
97
97
98
		oplots.append(Gnuplot.Data(now,freq,with='lines',
98
		oplots.append(Gnuplot.Data(now,freq,with_='lines',
99
			title=self.params.pitchmode))
99
			title=self.params.pitchmode))
100
		oplots.append(Gnuplot.Data(now,ifreq,with='lines',
100
		oplots.append(Gnuplot.Data(now,ifreq,with_='lines',
101
			title=self.params.pitchmode))
101
			title=self.params.pitchmode))
102
102
103
		temponsets = []
103
		temponsets = []
104
		for i in onset:
104
		for i in onset:
105
			temponsets.append(i*1000)
105
			temponsets.append(i*1000)
106
		oplots.append(Gnuplot.Data(now,temponsets,with='impulses',
106
		oplots.append(Gnuplot.Data(now,temponsets,with_='impulses',
107
			title=self.params.pitchmode))
107
			title=self.params.pitchmode))
108
108
109
	def plotplot(self,wplot,oplots,outplot=None,multiplot = 0):
109
	def plotplot(self,wplot,oplots,outplot=None,multiplot = 0):
Lines 117-126 class tasknotes(task): Link Here
117
		# check if ground truth exists
117
		# check if ground truth exists
118
		#timet,pitcht = self.gettruth()
118
		#timet,pitcht = self.gettruth()
119
		#if timet and pitcht:
119
		#if timet and pitcht:
120
		#	oplots = [Gnuplot.Data(timet,pitcht,with='lines',
120
		#	oplots = [Gnuplot.Data(timet,pitcht,with_='lines',
121
		#		title='ground truth')] + oplots
121
		#		title='ground truth')] + oplots
122
122
123
		t = Gnuplot.Data(0,0,with='impulses') 
123
		t = Gnuplot.Data(0,0,with_='impulses') 
124
124
125
		g = gnuplot_init(outplot)
125
		g = gnuplot_init(outplot)
126
		g('set title \'%s\'' % (re.sub('.*/','',self.input)))
126
		g('set title \'%s\'' % (re.sub('.*/','',self.input)))
(-)aubio-0.3.2-old/python/aubio/task/onset.py (-4 / +4 lines)
Lines 103-109 class taskonset(task): Link Here
103
		self.maxofunc = max(ofunc)
103
		self.maxofunc = max(ofunc)
104
		# onset detection function 
104
		# onset detection function 
105
		downtime = numarray.arange(len(ofunc))*self.params.step
105
		downtime = numarray.arange(len(ofunc))*self.params.step
106
		oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode))
106
		oplot.append(Gnuplot.Data(downtime,ofunc,with_='lines',title=self.params.onsetmode))
107
107
108
		# detected onsets
108
		# detected onsets
109
		if not nplot:
109
		if not nplot:
Lines 114-121 class taskonset(task): Link Here
114
			#x1 = numarray.array(onsets)*self.params.step
114
			#x1 = numarray.array(onsets)*self.params.step
115
			#y1 = self.maxofunc*numarray.ones(len(onsets))
115
			#y1 = self.maxofunc*numarray.ones(len(onsets))
116
			if x1:
116
			if x1:
117
				oplot.append(Gnuplot.Data(x1,y1,with='impulses'))
117
				oplot.append(Gnuplot.Data(x1,y1,with_='impulses'))
118
				wplot.append(Gnuplot.Data(x1,y1p,with='impulses'))
118
				wplot.append(Gnuplot.Data(x1,y1p,with_='impulses'))
119
119
120
		oplots.append((oplot,self.params.onsetmode,self.maxofunc))
120
		oplots.append((oplot,self.params.onsetmode,self.maxofunc))
121
121
Lines 128-134 class taskonset(task): Link Here
128
			t_onsets = aubio.txtfile.read_datafile(datafile)
128
			t_onsets = aubio.txtfile.read_datafile(datafile)
129
			x2 = numarray.array(t_onsets).resize(len(t_onsets))
129
			x2 = numarray.array(t_onsets).resize(len(t_onsets))
130
			y2 = self.maxofunc*numarray.ones(len(t_onsets))
130
			y2 = self.maxofunc*numarray.ones(len(t_onsets))
131
			wplot.append(Gnuplot.Data(x2,y2,with='impulses'))
131
			wplot.append(Gnuplot.Data(x2,y2,with_='impulses'))
132
			
132
			
133
			tol = 0.050 
133
			tol = 0.050 
134
134
(-)aubio-0.3.2-old/python/aubio/task/pitch.py (-2 / +2 lines)
Lines 156-162 class taskpitch(task): Link Here
156
156
157
		time = [ (i+self.params.pitchdelay)*self.params.step for i in range(len(pitch)) ]
157
		time = [ (i+self.params.pitchdelay)*self.params.step for i in range(len(pitch)) ]
158
		pitch = [aubio_freqtomidi(i) for i in pitch]
158
		pitch = [aubio_freqtomidi(i) for i in pitch]
159
		oplots.append(Gnuplot.Data(time,pitch,with='lines',
159
		oplots.append(Gnuplot.Data(time,pitch,with_='lines',
160
			title=self.params.pitchmode))
160
			title=self.params.pitchmode))
161
		titles.append(self.params.pitchmode)
161
		titles.append(self.params.pitchmode)
162
162
Lines 170-176 class taskpitch(task): Link Here
170
		if truth:
170
		if truth:
171
			timet,pitcht = self.gettruth()
171
			timet,pitcht = self.gettruth()
172
			if timet and pitcht:
172
			if timet and pitcht:
173
				oplots = [Gnuplot.Data(timet,pitcht,with='lines',
173
				oplots = [Gnuplot.Data(timet,pitcht,with_='lines',
174
					title='ground truth')] + oplots
174
					title='ground truth')] + oplots
175
175
176
		g = gnuplot_create(outplot=outplot, extension=extension)
176
		g = gnuplot_create(outplot=outplot, extension=extension)

Return to bug 251003