예제 #1
0
 def __init__(self):
     SparseHMM.__init__(self)
     self.m_minFreq = 61.735
     self.m_nBPS = 5
     self.m_nPitch = 0
     self.m_selfTrans = 0.99
     self.m_yinTrust = 0.5
     self.m_transitionWidth = 5*(np.uint64(self.m_nBPS/2)) + 1  # 2 semi-tones of frame jump
     self.m_nPitch = 69 * self.m_nBPS  # 69 semi-tone, each semi-tone divided to 5, step is 20 cents
     self.m_freqs = np.zeros(2*self.m_nPitch, dtype=np.float64)
     for iPitch in range(self.m_nPitch):
         self.m_freqs[iPitch] = self.m_minFreq * pow(2, iPitch * 1.0 / (12 * self.m_nBPS))  # 0 to m_nPitch-1 positive pitch
         self.m_freqs[iPitch+self.m_nPitch] = -self.m_freqs[iPitch]  # m_nPitch to 2*m_nPitch-1 negative pitch
     self.build()
예제 #2
0
파일: MonoNoteHMM.py 프로젝트: xrick/pypYIN
 def __init__(self, STEPS_PER_SEMITONE, NUMBER_SEMITONES,
              with_bar_dependent_probs, hopTime, usul_type):
     self.with_bar_dependent_probs = with_bar_dependent_probs
     self.par = MonoNoteParameters(STEPS_PER_SEMITONE, NUMBER_SEMITONES,
                                   with_bar_dependent_probs, hopTime,
                                   usul_type)
     if with_bar_dependent_probs:  # list of trans matrices
         num_beats = self.par.barPositionDistance_Probs.shape[
             0]  # num beats in a bar for rhythmic pattern
         dist_from_beat = self.par.barPositionDistance_Probs.shape[
             1] + 1  # distance from beat (in number of frames) last is default (limit distance) transition
         SparseHMM.__init__(self, num_beats, dist_from_beat)  #
     else:  # only the  trans matrix of model of Mauch
         SparseHMM.__init__(self, 1, 1)
     self.pitchDistr = []
예제 #3
0
 def __init__(self):
     SparseHMM.__init__(self)
     self.par = MonoNoteParameters()
     self.pitchDistr = []
     self.build()
예제 #4
0
 def __init__(self):
     SparseHMM.__init__(self)
     self.par = MonoNoteParameters()
     self.pitchDistr = []
     self.build()