nussl/separation/primitive/melodia.py
def extract_melody(self):
        """
        Extracts melody from the audio using the melodia vamp plugin. Uses arguments kept 
        in self:
        
        - `self.minimum_frequency` (default: 55 Hz)
        - `self.maximum_frequency` (default: 1760 Hz)
        - `self.voicing_tolerance` (default: 0.2)
        - `self.minimum_peak_salience` (default: 0.0)

        This function sets two class members used in other parts:

        - `self.melody`: (numpy array) contains the melody in Hz for every timestep 
          (0 indicates no voice).
        - `self.timestamps`: (numpy array) contains the timestamps for each melody note
        """

        params = {
            'minfqr': self.minimum_frequency,
            'maxfqr': self.maximum_frequency,
            'voicing': self.voicing_tolerance,
            'minpeaksalience': self.minimum_peak_salience
        }

        data = vamp.collect(self.audio_signal.audio_data, self.sample_rate,
                            "mtg-melodia:melodia", parameters=params)

        _, melody = data['vector']
        hop = 128. / 44100.  # hard coded hop in Melodia vamp plugin, converting it to frames.
        timestamps = 8 * hop + np.arange(len(melody)) * hop
        melody[melody < 0] = 0
        self.melody = melody
        self.timestamps = timestamps

        Extracts melody from the audio using the melodia vamp plugin. Uses arguments kept 
        in self:
        
        - `self.minimum_frequency` (default: 55 Hz)
        - `self.maximum_frequency` (default: 1760 Hz)
        - `self.voicing_tolerance` (default: 0.2)
        - `self.minimum_peak_salience` (default: 0.0)

        This function sets two class members used in other parts:

        - `self.melody`: (numpy array) contains the melody in Hz for every timestep 
          (0 indicates no voice).
        - `self.timestamps`: (numpy array) contains the timestamps for each melody note
        
Extracts melody from the audio using the melodia vamp plugin. Uses arguments kept
in self.



This function sets two class members used in other parts.

`self.melody`: (numpy array) contains the melody in Hz for every timestep
(0 indicates no voice).
`self.timestamps`: (numpy array) contains the timestamps for each melody note
Extracts melody from the audio using the melodia vamp plugin . Uses arguments kept in self . This function sets two class members used in other parts . ` self . melody ` : ( numpy array ) contains the melody in Hz for every timestep ( 0 indicates no voice ) . ` self . timestamps ` : ( numpy array ) contains the timestamps for each melody note
def extract_melody(self):
        params = {
            'minfqr': self.minimum_frequency,
            'maxfqr': self.maximum_frequency,
            'voicing': self.voicing_tolerance,
            'minpeaksalience': self.minimum_peak_salience
        }
        data = vamp.collect(self.audio_signal.audio_data, self.sample_rate,
                            "mtg-melodia:melodia", parameters=params)
        _, melody = data['vector']
        hop = 128. / 44100.  
        timestamps = 8 * hop + np.arange(len(melody)) * hop
        melody[melody < 0] = 0
        self.melody = melody
        self.timestamps = timestamps
def extract_melody ( self ) : params = { 'minfqr' : self . minimum_frequency , 'maxfqr' : self . maximum_frequency , 'voicing' : self . voicing_tolerance , 'minpeaksalience' : self . minimum_peak_salience } data = vamp . collect ( self . audio_signal . audio_data , self . sample_rate , "mtg-melodia:melodia" , parameters = params ) _ , melody = data [ 'vector' ] hop = 128. / 44100. timestamps = 8 * hop + np . arange ( len ( melody ) ) * hop melody [ melody < 0 ] = 0 self . melody = melody self . timestamps = timestamps
Extracts melody from the audio using the melodia vamp plugin.
Extracts melody from the audio using the melodia vamp plugin .
"""
        Extracts melody from the audio using the melodia vamp plugin. Uses arguments kept 
        in self:
        
        - `self.minimum_frequency` (default: 55 Hz)
        - `self.maximum_frequency` (default: 1760 Hz)
        - `self.voicing_tolerance` (default: 0.2)
        - `self.minimum_peak_salience` (default: 0.0)

        This function sets two class members used in other parts:

        - `self.melody`: (numpy array) contains the melody in Hz for every timestep 
          (0 indicates no voice).
        - `self.timestamps`: (numpy array) contains the timestamps for each melody note
        """ # hard coded hop in Melodia vamp plugin, converting it to frames.
self