Esempio n. 1
0
 def __call__(self):
     task.__call__(self)
     isonset, val = self.opick.do(self.myvec)
     if aubio_silence_detection(self.myvec(), self.params.silence):
         isonset = 0
     if self.params.storefunc:
         self.ofunc.append(val)
     if self.params.localmin:
         if val > 0:
             self.ovalist.append(val)
         else:
             self.ovalist.append(0)
         self.ovalist.pop(0)
     if isonset > 0.0:
         if self.params.localmin:
             # find local minima before peak
             i = len(self.ovalist) - 1
             while self.ovalist[i - 1] < self.ovalist[i] and i > 0:
                 i -= 1
             now = self.frameread + 1 - i
         else:
             now = self.frameread
             # take back delay
         if self.params.delay != 0.0:
             now -= self.params.delay
         if now < 0:
             now = 0
         if self.params.mintol:
             # prune doubled
             if (now - self.last) > self.params.mintol:
                 self.last = now
                 return now, val
         else:
             return now, val
Esempio n. 2
0
	def __call__(self):
		task.__call__(self)
		isonset,val = self.opick.do(self.myvec)
		if (aubio_silence_detection(self.myvec(),self.params.silence)):
			isonset=0
		if self.params.storefunc:
			self.ofunc.append(val)
		if self.params.localmin:
			if val > 0: self.ovalist.append(val)
			else: self.ovalist.append(0)
			self.ovalist.pop(0)
		if (isonset == 1):
			if self.params.localmin:
				# find local minima before peak 
				i=len(self.ovalist)-1
				while self.ovalist[i-1] < self.ovalist[i] and i > 0:
					i -= 1
				now = (self.frameread+1-i)
			else:
				now = self.frameread
			# take back delay
			if self.params.delay != 0.: now -= self.params.delay
			if now < 0 :
				now = 0
			if self.params.mintol:
				# prune doubled 
				if (now - self.last) > self.params.mintol:
					self.last = now
					return now, val
			else:
				return now, val 
Esempio n. 3
0
 def __call__(self):
     task.__call__(self)
     if (aubio_silence_detection(self.myvec(), self.params.silence) == 1):
         if self.wassilence == 1: self.issilence = 1
         else: self.issilence = 2
         self.wassilence = 1
     else:
         if self.wassilence <= 0: self.issilence = 0
         else: self.issilence = -1
         self.wassilence = 0
     if self.issilence == -1:
         return max(self.frameread - self.params.delay, 0.), -1
     elif self.issilence == 2:
         return max(self.frameread + self.params.delay, 0.), 2
Esempio n. 4
0
	def __call__(self):
		task.__call__(self)
		if (aubio_silence_detection(self.myvec(),self.params.silence)==1):
			if self.wassilence == 1: self.issilence = 1
			else: self.issilence = 2
			self.wassilence = 1
		else: 
			if self.wassilence <= 0: self.issilence = 0
			else: self.issilence = -1 
			self.wassilence = 0
		if self.issilence == -1:
			return max(self.frameread-self.params.delay,0.), -1
		elif self.issilence == 2:
			return max(self.frameread+self.params.delay,0.), 2 
Esempio n. 5
0
 def __call__(self):
     from aubio.median import short_find
     task.__call__(self)
     if (aubio_silence_detection(self.myvec(), self.params.silence) == 1):
         freq = -1.
     else:
         freq = self.pitchdet(self.myvec)
     minpitch = self.params.pitchmin
     maxpitch = self.params.pitchmax
     if maxpitch and freq > maxpitch:
         freq = -1.
     elif minpitch and freq < minpitch:
         freq = -1.
     if self.params.pitchsmooth:
         self.shortlist.append(freq)
         self.shortlist.pop(0)
         smoothfreq = short_find(self.shortlist, len(self.shortlist) / 2)
         return smoothfreq
     else:
         return freq
Esempio n. 6
0
	def __call__(self):
		from aubio.median import short_find
		task.__call__(self)
		if (aubio_silence_detection(self.myvec(),self.params.silence)==1):
			freq = -1.
		else:
			freq = self.pitchdet(self.myvec)
		minpitch = self.params.pitchmin
		maxpitch = self.params.pitchmax
		if maxpitch and freq > maxpitch : 
			freq = -1.
		elif minpitch and freq < minpitch :
			freq = -1.
		if self.params.pitchsmooth:
			self.shortlist.append(freq)
			self.shortlist.pop(0)
			smoothfreq = short_find(self.shortlist,
				len(self.shortlist)/2)
			return smoothfreq
		else:
			return freq