The invention relates to data signal processing and, more particularly, to detection of signals of interest in a data signal.
It is known in the entertainment industry to use realistic computer graphics (CG) in various aspects of movie production. Many algorithms for natural behavior in the visual domain have been developed for film. For example, algorithms were developed for movies such as Jurassic Park to determine how a natural gait looked, how muscles moved in relation to a skeleton and how light reflected off of skin. However, similar types of problems in the audio, particularly music, domain remain relatively unaddressed. The necessary step is the ability to accurately transcribe what happens in a music performance into precise measurements that allow the fine nuances of the performance to be recreated.
Characterizing music may be a particularly difficult problem. Various approaches have been attempted to providing “automatic transcription” of music, typically from a waveform audio (WAV) format to a Musical Instrument Digital Interface (MIDI) format. Computer musicians generally refer to “WAV-to-MIDI” with reference to transforming a song in digitized waveforms into the corresponding notes in the MIDI format. The source of the recording could be, for example, analog or digital, and the conversion process can start from a record, tape, CD, MP3 file, or the like. Traditional musicians generally refer to such transformation of a song as “Automatic Transcription.” Manual transcription techniques are typically used by skilled musicians who listen to recordings repeatedly and carefully copy down on a music score the notes they hear; for example, to notate improvised jazz performances.
Numerous academics have looked at some of the problems in a non-commercial context. In addition, various companies offer software for WAV-to-MIDI decoding, for example, Digital Ear™, intelliScore™, Amazing MIDI, AKoff™, MB TRANS™, and Transcribe!™. These products generally focus on songwriters and amateurs and include capability for determining note pitches and durations, to help musicians create a simple score from a recording. However, these known products tend to be generally unreliable in processing more than one note at a time. In addition, these products generally fail to address the full range of characteristics of music. For example, with a piano, note characteristics may include: pitch, duration, strike and release velocities, key angle, and pedals. Academic research on automatic transcription has also occurred, for example, at the Tampere University of Technology in Finland. Known work on automatic transcription has generally not yielded archival-quality recreation of music performances.
There are 100 years of recordings in the vaults of the recording companies and in private collections. Many great recordings have never been released, because they were marred in some way that made them substandard. Live performances are often commercially not releaseable because of background noises or out-of-tune piano strings. Many analog tapes from previous decades are decaying, because of the chemical formula used in making the tape binder. They also may never have been released because they were recorded on low-quality devices, such as cassette recorders. Similarly, many desirable studio recordings have never seen released, due to instrument or equipment problems during their recording sessions.
The recording industry has embarked on the next set of consumer formats, following CDs in the early 1980's: high-definition surround sound. The new formats include DVD-Audio (DVD-A) and Video and Super Audio CD (SACD). There are 33 million home surround sound systems in use today, a number growing quickly along with high-definition TV. The challenge in the recording industry is bringing older audio material forward into modern sound for re-release. Candidates for such a conversion include mono recordings, especially those before 1955; stereo recordings without multi-channel masters; master tapes from the 1970s and 1980s, which are generally now decaying due to an inferior tape binder formulation; and any of these combined with video captures, which are issued as surround-sound DVDs.
Another music related recording area is creating MIDI from a printed score. For example, like optical character reader (OCR) software for text documents, it is known to provide application software for musicians to allow them to place a music score on a scanner and have music-scan application software convert it into a digitized format based on the scanned image. Similarly, application notation software is known to convert MIDI files to printed musical scores.
Application software for converting from MIDI to WAV is also known. The media player on a personal computer typically plays MIDI files. The better the samples it uses (snippets of digital recordings of acoustic instruments), the better the playback will typically sound. MIDI was originally designed, at least in part, as a way to describe performance details to electronic musical instruments, such as MIDI electronic pianos (with no strings or hammers) available, for example, from Korg, Kurzweil, Roland, and Yamaha.
Some embodiments of the present invention provide methods, systems and/or computer program products for detection of a note receive an audio signal and generate a plurality of frequency domain representations of the audio signal over time. A time domain representation is generated from the plurality of frequency domain representations. A plurality of edges are detected in the time domain representation and the note is detected by selecting one of the plurality of edges as corresponding to the note based on characteristics of the time domain representation.
In other embodiments of the present invention, methods, systems and/or computer program products for detection of a note receive an audio signal and generate a plurality of sets of frequency domain representations of the audio signal over time, each of the sets being associated with a different pitch. A plurality of candidate notes are identified based on the sets of frequency domain representations, each of the candidate notes being associated with a pitch. Ones of the candidate notes with different pitches having a common associated time of occurrence are grouped and magnitudes associated with the grouped candidate notes are determined. A slope defined by changes in the determined magnitudes with changes in pitch is determined and the note is detected based on the determined slope.
In further embodiments of the present invention, methods for detection of a note include receiving an audio signal. Non-uniform frequency boundaries are defined to provide a plurality of frequency ranges corresponding to different pitches. A plurality of sets of frequency domain representations of the audio data signal over time are generated, each of the sets being associated with one of the different pitches. The note is detected based on the plurality of sets of frequency domain representations.
In yet other embodiments of the present invention, methods, systems and/or computer program products for detection of a signal edge receive a data signal including the signal edge and noise generated edges. The data signal is processed through a first type of edge detector to provide first edge detection data and through a second type of edge detector, different from the first type of edge detector, to provide second edge detection data. One of the edges in the data signal is selected as the signal edge based on the first edge detection data and the second edge detection data. A third edge detector may also be utilized.
In further embodiments of the present invention, methods, systems and/or computer program products for detection of a note receive an audio signal and generate a plurality of frequency domain representations of the audio signal over time. A time domain representation is generated from the plurality of frequency domain representations. A measure of smoothness of the time domain representation is calculated and the note is detected based on the measure of smoothness.
In other embodiments of the present invention, methods, systems and computer program products for detection of a note receive an audio signal and generate a plurality of frequency domain representations of the audio signal over time. A time domain representation is generated from the plurality of frequency domain representations. An output signal is also generated from an edge detector based on the received audio signal. Characterizing parameters associated with the time domain representation are calculated and characterizing parameters associated with the output signal from the edge detector are calculated. The note is detected based on the calculated characterizing parameters of the time domain representation and the output signal from the edge detector.
FIGS. 3 to 5 are flow charts illustrating operations for detecting a note according to various embodiments of the present invention.
FIGS. 9 to 13 are flow charts illustrating operations for detecting a note according to further embodiments of the present invention.
The invention now will be described more fully hereinafter with reference to the accompanying drawings, in which illustrative embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. Like numbers refer to like elements throughout. As used herein, the term “and/or” includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by one of skill in the art, the invention may be embodied as methods, data processing systems, and/or computer program products. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects, all generally referred to herein as a “circuit” or “module.” Furthermore, the present invention may take the form of a computer program product on a computer-usable storage medium having computer-usable program code embodied in the medium. Any suitable computer readable medium may be utilized including hard disks, CD-ROMs, optical storage devices, a transmission media such as those supporting the Internet or an intranet, or magnetic storage devices.
Computer program code for carrying out operations of the present invention may be written in an object oriented programming language such as JAVA®, Smalltalk or C++. However, the computer program code for carrying out operations of the present invention may also be written in conventional procedural programming languages, such as the “C” programming language or in a visually oriented programming environment, such as VisualBasic. Dynamic scripting languages such as PHP, Python, XUL, etc. may also be used. It is also possible to use combinations of programming languages to provide computer program code for carrying out the operations of the present invention.
The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer. In the latter scenario, the remote computer may be connected to the user's computer through a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
The invention is described in part below with reference to flowchart illustrations and/or block diagrams of methods, systems and/or computer program products according to some embodiments of the invention. It will be understood that each block of the illustrations, and combinations of blocks, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function/act specified in the block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions/acts specified in the block or blocks.
Embodiments of the present invention will now be discussed with reference to
Using computer technology, detection of notes according to various embodiments of the present invention may change how music is created, analyzed, and preserved by advancing audio technology in ways that may provide highly realistic reproduction and increased interactivity. For example, some embodiments of the present invention may provide a capability analogous to optical character recognition (OCR) for piano recordings. In such embodiments, piano recordings may be converted back into the keystrokes and pedal motions that would have been used to create them. This may be done, for example, in a high-resolution MIDI format, which may be played back with high reality on corresponding computer-controlled grand pianos.
In other words, some embodiments of the present invention may allow decoding of recordings back into a format that can be readily manipulated. Doing so may benefit the music industry by unlocking the asset value in historical recording vaults. Such recordings may be regenerated into new performances, which can play afresh on in-tune concert grand pianos in superior halls. The major music labels could thereby re-record their works in modern sound. The music labels could use a variety of recording formats, such as today's high-definition surround-sound Super Audio CD (SACD) or DVD-Audio (DVD-A), and re-release recordings from back catalog. The music labels could also choose to use the latest digital rights management in the re-release.
Referring now to
As shown in
As is further seen in
The data portion 60 of memory 36, as shown in the embodiments illustrated in
While embodiments of the present invention have been illustrated in
Various of the known approaches to automatic transcription of music discussed above process an audio signal though digital signal processing (DSP) operations, such as Laplace transforms, Fast Fourier transforms (FFTs), discrete Fourier transforms (DFTs) or short time Fourier transforms (STFTs). Alternative approaches to this initial processing may include gamma tone filters, band pass filters and the like. The frequency domain information from the DSP is then provided to a note identification process, typically a neural network that has been trained based on some form of known input audio signal.
In contrast, some embodiments of the present invention, as will be described herein, process the frequency domain data through edge detection with the edge detection module 65 and then carry out note detection with the note detection module 66 based on the detected edges. In other words, a plurality of edges are detected in a time domain representation generated for a particular pitch from the frequency domain information. It will be understood that the time domain representation corresponds to a set of frequency domain representations for a particular pitch over time, with a resolution for the time domain representation being dependent on a resolution window used in generating the frequency domain representations, such as FFTs. In other words, a rising edge corresponds to energy appearing at a particular frequency band (pitch) at a particular time.
Note detection then processes the detected edges to distinguish a musical note (i.e., a fundamental) from harmonics, bleeds and/or noise signals from other sources. Further information about a detected note may be determined from the time domain representation in addition to a start time associated with a time of detection of the edge found to correspond to a musical note. For example, a maximum amplitude and duration may be determined for the detected note, which characteristics may further characterize the performance of the note, such as, for a piano key stroke, a strike velocity, duration and/or release velocity. The pitch may be identified based on the frequency band of the frequency domain representations used to build the time domain representation including the detected note.
As will be further described herein, while various techniques are known for edge detection that are suitable for use with embodiments of the present invention, some embodiments of the present invention utilize novel approaches to edge detection, such as processing the time domain representations through multiple edge detectors of different types. One of the edge detectors may be treated as the primary source for identifying the presence of edges in the time domain representation, while the others may be utilized for verification and/or as hints indicating that a detected edge from the primary edge detector is more likely to correspond to a musical note, which information may be used during subsequent note detection operations. An example of a configuration utilizing three edge detectors will now be described.
It will be understood that an edge detector, as used are herein, refers to a shape detector that may be set to detect a sharp rise associated with an edge being present in the data. In some cases the edges may not be readily detected (such as a repeated note, where a second note may have a much smaller rise) and edge detection may be based on detection of other shapes, such as a cap at the top of the peak for the repeated note.
The first or primary edge detector for this example is a conventional edge detector that may be tuned to a rising edge slope generally corresponding to that expected for a typical note occurring over a two octave musical range. However, as each pitch corresponds to a different time domain representation being processed through edge detection, the edge detector may be tuned to an expected slope for a note of a particular pitch corresponding to a time domain representation being processed, and then re-tuned for other time domain representations. As automatic transcription of music may not be time sensitive, a common edge detector may be used that is re-calibrated rather than providing a plurality of separately tuned primary edge detectors for concurrent processing of different pitches. The edge detector may also be tuned to select a start time for a detected rising edge based on a point intermediate to the detected start and peak time, which may reduce variability in the start time detection.
It will also be understood that the sample period for generating the frequency domain representations may be decreased to increase the time resolution of the corresponding time domain representations generated therefrom. For example, while the present inventors have successfully utilized ten millisecond resolution, it may be desirable, in some instances, to increase resolution to one millisecond to provide even more accurate identification of start time for a detected musical note. However, it will be understood that doing so will increase the amount of data processing required in generation of the frequency domain representations.
Continuing with this example of a multiple edge detector embodiment of the present invention, the second edge detector may be a detector responsive to a shape of, rather than energy in, an edge. In other words, normalization of the input signal may be provided to increase the sensitivity for detection of a particular shape of rising edge in contrast with an even greater energy level of a “louder” edge having a different shape. For this particular example, a third edge detector is also used to provide “hints” (i.e., verification of edges detected by the first edge detector). The third edge detector may be configured to be an energy responsive edge detector, like the primary edge detector, but to require more energy to detect an edge. For example, the first edge detector may have an analysis window over ten data points, each of ten milliseconds (for a total of 100 milliseconds), while the third edge detector may have an analysis window of thirty data points (for a total of 300 milliseconds).
The particular length of the longer time analysis window may be selected, for example, based on characteristics of an instrument generating the notes being detected. A piano, for example, typically has a note duration of at least about 150 milliseconds so that a piano note would be expected to last longer than the analysis window of the first edge detector and, thus, provide additional energy when analyzed by the third edge detector, while a noise pulse in the time signal may not provide any additional energy by extension of the analysis window.
As will be described further herein, once an edge is detected, a plurality of characterizing parameters of the time domain representation in which the edge was detected may be generated for uses in detecting a note in various embodiments of the present invention. Particular examples of such characterizing parameters will be provided after describing various embodiments of the present invention with reference to the flow chart illustrations in the figures.
It will be understood that, while the present invention encompasses detection of a single note in a single time domain representation generated from a plurality of frequency domain representations over time, automatic transcription of the music will typically involve capturing a plurality of different notes having different pitches.
Thus, operations at Block 300 may involve generating a plurality of sets of frequency domain representations of the audio signal over time wherein each of the sets is associated with a different pitch. Furthermore, operations at Block 310 may include generating a plurality of time domain representations from the respective sets of frequency domain representations, each of the time domain representations being associated with one of the different pitches. A plurality of edges may be detected at Block 315 in one or more of the time domain representations associated with different notes, bleeds or harmonics of notes.
Operations for detecting a note at Block 320 may include determining a duration of the note. The duration may be associated with the mechanical action generating the note. For example, the mechanical action may be a keystroke on a piano.
As discussed above for the embodiments of
In some embodiments of the present invention, pitch tracking may be provided using frequency tracking algorithms (e.g., phase locked loops, equalization algorithms, etc.) to track notes that go out of tune. One processing module may be provided for the primary frequency and each hannonic. In the case of multiple instances of the frequency producer (e.g., multiple strings used on a piano or different strings on a guitar), multiple processing modules may be provided for the primary frequency and for each corresponding hanmonic. Communication is provided between each of the tracking entities because, as the primary frequency changes, a corresponding change typically needs to be incorporated in each of the related harmonic tracking processing modules.
Pitch tracking could be implemented and applied to the raw data (a priori) or could be run in parallel for during processing adaptation. Alternatively, the pitch tracking process could be applied a posteriori, once it has been determined that notes are missing from an initial transcription pass. The pitch tracking process could then be applied only for notes where there are losses due to being out of tune. In other embodiments of the present invention, manual corrections could also be applied to compensate for frequency drift problems (manual pitch tracking) as an alternative to the automated pitch tracking described herein.
Further embodiments of the present invention for detection of a note will now be described with reference to the flowchart illustration of
Ones of the candidate notes with different pitches having a common associated time of occurrence are grouped (Block 430). Magnitudes associated with a group of candidate notes are determined (Block 440). A slope defined by changes in the determined magnitude with changes in pitch is then determined (Block 450). The note is then detected based on the determined slope (Block 460). Thus, for the embodiments illustrated in
It will be understood that, in other embodiments of the present invention, a relationship between a harmonic and a fundamental note may be utilized in note detection without generating slope information as described with reference to
Operations for detection of a note according to further embodiments of the present invention will now be described with reference to the flowchart illustration of
A plurality of sets of frequency domain representations of the audio signal are generated over time (Block 520). Each of the sets is associated with one of the different pitches. The note is then detected based on the plurality of sets of frequency domain representations (Block 530).
Operations for defining non-uniform frequency boundaries at Block 510 may include defining the non-uniform frequency boundaries to provide a substantially uniform resolution for each of a plurality of pre-defined pitches corresponding to musical notes. Non-uniform frequency boundaries may also be provided so as to provide a frequency range for each of a plurality of pre-defined pitches corresponding to harmonics of the musical notes.
The non-uniform frequency boundaries described with reference to
Operations for detection of a signal edge according to various embodiments of the present invention will now be described with reference to a flowchart illustration of
The data signal representation is further processed through a second type of edge detector different from the first type of edge detector to provide different edge protection data (Block 620). For example, the second of type of edge detector may be normalized so as to be responsive to a shape of an edge detected in the data signal.
In addition to the first and second edge detectors, as illustrated at Block 630, for some embodiments of the present invention, the data signal is further processed through a third edge detector. The third edge detector may be the same type of edge detector as the first edge detector but have a longer time analysis window. A longer time analysis window for the third edge detection may be selected to be at least as long as a characteristic duration associated with the signal edge. For example, when a signal edge corresponds to an edge expected to be generated by strike of a piano key, mechanical characteristics of the key may limit the range of durations expected from a note struck by the key. As such, the third edge detector may detect an edge based on a higher energy level threshold than the first type of edge detector. Thus, in some embodiments of the present invention, a third set of edge detection data is provided in addition to the first and second edge detection data.
One of the edges in the data signal is selected as the signal edge based on the first edge detection data, the second edge detection data and/or the third edge detection data (Block 640). In particular embodiments of the present invention, operations at Block 640 include increasing the likelihood that an edge corresponds to the signal edge based on a correspondence between an edge detected in the first edge detection data and an edge detected in the second edge detection data and/or the third edge detection data. For an instrument, such as a piano, the longer time analysis window for the third edge detector may be about 300 milliseconds.
It will be understood that the signal edge detection operations described with reference to
Operations for detection of a note will now be described for further embodiments of the present invention with reference to the flowchart illustration of
As shown in the illustrated embodiments of
Fraw(t)=S(t)+N(t)
where Fraw(t) is the time domain representation of the FFT data, S(t) is the signal and N(t) is noise. A logarithm, such as a natural log, is taken as follows:
Fln(ti)=ln(Fraw(ti))
An averge function is generated of the natural log as follows:
Ffinal(ti)=(Fln(ti−1)+Fln(ti)+Fln(ti+1))/3
Finally, a measure of smoothness function (var10d) is generated as a ten point average of the difference between the average function and the natural log. For this particular example of a measure of smoothness, a smaller value indicates a smoother shape to the curve.
As illustrated at Block 840, other methods may be utilized to identify a measure of smoothness. For example, for the operations illustrated at Block 840, a measure of smoothness may be determined by determining a number of slope direction changes in the natural log in a count time window around an identified peak in the natural log.
Operations for detection of a note according to yet further embodiments of the present invention will now be described with reference to
Characterizing parameters are calculated associated with the time domain representation (Block 940). As noted above, characterizing parameters may be computed for each edge detected by the first edge detector, or for each edge meeting a minimum amplitude threshold criterion for the output signal from the edge detector. Characterizing parameters may be generated for the time domain representation and may also be generated for the output signal from the edge detector in some embodiments of the present invention as will be described below. An example set of suitable characterizing parameters will now be described for a particular embodiment of the present invention. For this particular embodiment, the characterizing parameters based on the time domain representation include a maximum amplitude, a duration and wave shape properties. The wave shape properties include a leading edge shape, a first derivative and a drop (i.e., at a fixed time past the peak amplitude how far has the amplitude decayed). Other parameters include a time to the peak amplitude, a measure of smoothness, a runlength of the measure of smoothness (i.e. a number of smoothness points in a row below a threshold criterion (either allowing no or a limited number of exceptions), a run length of the measure of smoothness in each direction starting at the peak amplitude, a relative peak amplitude from a declared minimum to a declared maximum and/or a direction change count for an interval before and after the peak amplitude in the measure of smoothness.
Different characterizing parameters may be provided in other embodiments of the present invention. For example, in some embodiments of the present invention, the characterizing parameters associated with a time domain representations include at least one of: a run length of the measure of smoothness satisfying a threshold criterion; a peak run length of the measure of smoothness satisfying a threshold criterion starting at a peak point corresponding to a maximum magnitude of the one of the time domain representations; a maximum magnitude; a duration; wave shape properties; a time associated with the maximum magnitude; and/or a relative magnitude from a determined minimum peak time magnitude value to a determined maximum peak time magnitude value.
Characterizing parameters associated with the output signal from the edge detector are also calculated for the embodiments of
The note is then detected based on the calculated characterizing parameters of the time domain representation and of the output signal from the edge detector (Block 960). Thus, for the particular embodiments illustrated in
Operations for detecting a note according to further embodiments of the present invention will now be described with reference to the flow chart illustration of
For each edge satisfying the threshold criterion at Block 1010, characterizing parameters are calculated (Block 1020). More particularly, it will be understood that the characterizing parameters at Block 1020 are based on a time domain representation for a time period associated with the detected edge in the time domain representation. In other words, the characterizing parameters are based on shape and other characteristics of the signal in the time domain representation, not in the output signal of the edge detector utilized to identify an edge for analysis. Thus, the edge detector output is synchronized on a time basis to the time domain representation so that characterizing parameters may be generated based on the time domain representation and associated with individual detected edges by the edge detector. The note is then detected based on the calculated characterizing parameters of the time domain representation (Block 1030).
Further embodiments of the present invention will now be described with reference to the flow chart illustration of
Referring now to the particular embodiments of
Thus, in the context of the multiple edge detector embodiments illustrated in
Further operations in processing peak hints at Block 1100 may include retaining a detected edge in the second edge detection data when a width associated with the detected edge fails to satisfy a threshold criteria. In other words, in isolation, where the width before or after the peak point for an edge is too narrow, this may indicate that the detected peak/edge is not a valid hint. In particular embodiments of the present invention, an edge from the second or third edge detector need satisfy only one and not necessarily both of these criteria.
Following processing of the peak hints at Block 1100, peak hints are matched (Block 1110). Operations at Block 1110 may include first determining if a detected edge in the first edge detection data corresponds to a retained detected edge in the second detection data and then determining that the detected edge in the first edge detection data is more likely to correspond to the note when the detected edge in the first edge detected data is determined to a correspond retained detected edge in the second edge detection data. Thus, operations at Block 1110 may include processing through each edge identified by the first edge detector and looking through the set of possibly valid peak hints from Block 1100 to determine if any of them are close enough in time and match the note/pitch of the edge indication from the first peak detector being processed (i.e., correspond to the same pitch and occur at the same time indicating that the peak hint makes the likelihood that the edge detected by the first edge detector corresponds to a note greater).
Operations at Block 1120 relate to identifying bleeds to distinguish bleeds from fundamental notes to be detected. Operations at Block 1120 include determining, for a detected edge, if another of the plurality of the detected edge is occurring at about the same time as the detected edge corresponds to a pitch associated with a bleed of the pitch associated with the time domain representation of the detected edge. A lower magnitude one of the detected edge and the other of the plurality of edges is discarded if the other edge is determined to be associated with a bleed of the pitch associated with the time domain representation of the detected edge. In other words, for each peak A (i.e., every peak), for each peak B (i.e., look at every other peak in the set), if the peaks are close in time and at an adjacent pitch (for example, on a keyboard generating the musical notes), then discard as a bleed whichever of the related adjacent peaks has a lower peak value amplitude. In addition, in some embodiments of the present invention, a likelihood of being a note value is increased for the retained peak as detecting the bleed may indicate that the retained peak is more likely to be a musical note.
Operations at Block 1130 relate to calculating harmonics in the detected peaks (edges). Note that, for the embodiments illustrated in
In particular embodiments of the present invention, harmonic calculation operations may be carried for the first through the eighth harmonics to determine if one or more of these harmonics exist. In other words, operations may include, for each peak A (each peak in the set), for each peak B (every other peak in the set), for each harmonic (numbers 1-8), if peak B is a harmonic of peak A, identifying peak B as corresponding to one of the harmonics of peak A.
In some embodiments of the present invention, operations at Block 1130 may further include, for each peak, calculating a slope of the harmonics as described previously with reference to the embodiments of
Operations related to discarding noise peaks are carried out at Block 1140 of
Particular embodiments of a score based approach to the operations for determining whether a detected edge corresponds to noise at Block 1140 are illustrated in the flow chart diagram of
Operations at Block 1150 of
At Block 1160, overlapping peaks are compared to identify the presence of duplicate peaks/edges. For example, if a peak occurs at a time 1000 having a duration of 200 and a second peak occurs at a time 1100 having a duration of 200 from a known piano generated audio signal, both peaks could not be notes, as only one key of the pitch could have been struck and it is appropriate to pick the better of the two overlapping peaks and discard the other. The selection of better peak may be based on a variety of criteria including magnitude and the like.
Operations for comparing overlapping peaks at Block 1160 will now be further described for particular embodiments of the present invention illustrated by the flow chart diagram of
Referring again to
As described above with reference to Block 1130, following the other described edge discarding operations, detected edges corresponding to a harmonic may be discarded at Block 1180.
Finally, a MIDI file or other digital record of the detected notes may be written (Block 1190). In other words, while operations above have generally been described with reference to detecting an individual musical note, it will be understood that a plurality of notes associated with a musical score may be detected and operations to Block 1190 may generate a MIDI file, or the like, for the musical score. For example, with known high quality MIDI file standards, detailed information characterizing a note may be saved for each note including a start time, duration, a peak value (which may be mapped to a note on velocity and further a note off velocity that would be determined based on the note on velocity and the duration). The note information will also include the corresponding pitch of the note.
As discussed with reference to various embodiments of the present invention above, duration of a note may be determined. Operations for determining duration according to particular embodiments of the present invention will now be described. A duration determining process may include, among other things, computing the duration of a note and determining a shape and decay rate of an envelope associated with the note. These calculations may take into account peak shape, which may depend on the instrument being played to generate the note. These calculations may also consider physical factors, such as shape of the signal, delay from when the note was played until its corresponding frequency signals show up, how hard or rapidly the note is played, which may change delay and frequency dependent aspects, such as possible changes in decay and extinction characteristics.
As used herein, the term “envelope” refers to the Fourier data for a single frequency (or bin of the frequency transforms). A note is a longer duration event in which the Fourier data may vary wildly and may contain multiple peaks (generally smaller than the primary peak) and will generally have some amount of noise present. The envelope can be the Fourier data itself or an approximation/idealization of the same data. The envelope may be used to make clear when the note being played starts to be damped, which may indicate that the note's duration is over. Once the noise is reduced and effects from adjacent notes being played are reduced or removed, the envelope for a note may appear with a sharp rise on the left (earlier in time) followed by a peak and then a gentle decay for a while, finishing with a downturn in the graph indicating the damping of the note.
In some embodiments of the present invention, the duration calculation operations determine how long a note is played. This determination may involve a variety of factors. Among these factors is the presence of a spectrum of frequencies related to the note played (i.e., the fundamental frequency and the harmonics). These signal elements may have a limited set of shapes in time and frequency. An important factor may be the decay rate of the envelope of the note's elements. The envelope of these elements' waveforms may start decaying at a higher rate, which may indicate that some dampening factor has been introduced. For example, on a piano, a key might have been released. These envelopes may have multiple forms for an instrument, depending, for example, on the acoustics and the instrument being played. The envelopes may also vary depending on what other notes are being played at the same time.
Depending on the instrument being played, there are generally also physical factors that should be taken into account. For example, there is a generally a delay between when a string is plucked or struck and when it starts to sound. The force used to play the note may also affect the timing (e.g., pressing a piano key harder generally shortens the time until the hammer strikes the string). Frequency dependent responses are also taken into account in some embodiments of the present invention. Among other factors that may affect the duration computations are the rate of change of the decay and extinction, e.g., with a flute there is typically a marked difference in the decay of a note depending on whether the player stopped blowing or the player changed the note being played.
The duration determining process in some embodiments of the present invention begins at a start point on a candidate note, for example, on the fundamental frequency. The start point may be the peak of the envelope for that frequency. The algorithm processes forward in time, computing a number of decay and curvature functions (such as first and second derivative and curvature functions with relative minimums and maximums), which are then evaluated looking for a terminating condition. Examples of terminating conditions include significant change in rate of decay, start of a new note and the like (which may appear as drops or rises in the signal. Distinct duration values may be generated for a last change in the signal envelope and based on a smooth envelope change. These terminating conditions and how the duration is calculated may depend on the shape of the envelope, of which there may be several different kinds depending on a source instrument and acoustic conditions during generation of the note.
The harmonic frequencies may also have useful information about the duration of a note and when harmonic information is available (e.g., no note being played at the harmonic frequency), the harmonic frequencies may be evaluated to provide a check/verification of the fundamental frequency analysis.
The duration determination process may also resolve any extraneous information in the signal such as noise, adjacent notes being played and the like. The signal interference sources may appear in peaks, pits or as spikes in the signal. In some cases there will be a sharp downward spike that might be mistaken for the end of a note that is really just an interference pattern. Similarly an adjacent note being played will generally cause a bleed peak, which could be mistaken for the start of a new note.
The flowcharts and block diagrams of
Many alterations and modifications may be made by those having ordinary skill in the art, given the benefit of present disclosure, without departing from the spirit and scope of the invention. Therefore, it must be understood that the illustrated embodiments have been set forth only for the purposes of example, and that it should not be taken as limiting the invention as defined by the following claims. The following claims are, therefore, to be read to include not only the combination of elements which are literally set forth but all equivalent elements for performing substantially the same function in substantially the same way to obtain substantially the same result. The claims are thus to be understood to include what is specifically illustrated and described above, what is conceptually equivalent, and also what incorporates the essential idea of the invention.