Pursuant to 35 U.S.C. § 119(a), this application claims the benefit of earlier filing date and right of priority to Korean Application No. 10-2004-0019381, filed on Mar. 22, 2004, the contents of which are hereby incorporated by reference herein in their entirety.
1. Field of the Invention
The present invention relates to an apparatus and a method for processing MIDI data, and more particularly, to an apparatus and a method for processing MIDI data which are capable of outputting rich sound quality with few system resources by controlling a volume of sound sources before converting the sound sources to a frequency.
2. Description of the Related Art
A wireless terminal is an apparatus for performing communication or transmitting/receiving data while moving. For example, the wireless terminal may be a cellular phone or a personal digital assistant (PDA).
Musical instrument digital interface (MIDI) is a standard protocol enabling data communication between electronic musical instruments. The MIDI is a standard specification for hardware and data structure that provide compatibility for the input/output between musical instruments or between musical instruments and computers through digital interface. Accordingly, devices having the MIDI can share data with each other because compatible data are created therein.
A MIDI file contains information such as intensity and tempo of a note, command language related to musical characteristics, and a type of a musical instrument as well as an actual musical score. However, unlike a wave file, a MIDI file does not store waveform information, the file size of the MIDI file is relatively small, and it is easy to edit the MIDI file (for example, adding or deleting an instrument).
In the early days, an artificial sound was produced by using a frequency modulation (FM) method to reproduce a sound of a musical instrument. The FM method has an advantage of using a small amount of memory since no separate sound source is used when reproducing the sound of the musical instrument. However, the FM method has a disadvantage of not being able to reproduce a natural sound close to an original sound.
As the price of memory has fallen, a method has been developed for producing and storing individual sound sources for each musical instrument and each of its notes in a memory, and producing sound by changing frequencies and vibrations while maintaining the instrument's unique waveform. This method uses a wave-table, in which the above-mentioned sound source samples are stored, and is widely used because it is capable of producing a natural sound closer to the original sound.
As illustrated in
The MIDI file, containing information about certain music, is stored in a storage medium and may include a score such as a plurality of notes, note playback duration information, and timbre. The note is information representing a minimum unit of a sound, and a plurality of notes represents a musical scale. The musical scale provides information about a note's tone (low or high), and seven notes (for example, C, D, E, etc.) are generally used in the musical scale. The note playback duration information provides information about a length of each note. The timbre represents a tone color and includes the note's unique characteristic that distinguishes two notes having the same tone, intensity, and length. For example, a ‘C’ note of the piano may be distinguished from a ‘C’ note of the violin according to their difference in characteristic timbres.
Further, the note playback duration means a length of playback time for each of the notes included in the MIDI file, and contains information about the note's playback length. For example, if a playback duration of a note ‘D’ is ⅛ second, the note ‘D’ from a sound source is played for ⅛ second.
Sound sources for each instrument and each note of the individual instruments are recorded in the wave table 130. Although, the scale is normally in a range of 1 through 128, there are limitations in recording all sound sources for all of the notes in the wave table 130. Accordingly, only a number of sound source samples are recorded for representative several notes in the wave table 130.
The envelope generator 140 generates an envelope which determines levels of a volume and a pitch according to envelope information preset by a user or in the MIDI file, and controls the volume or the pitch of the sound source samples played in response to the notes included in the MIDI file. Therefore, the envelope has a great influence on quality of the sound source sample played, and may use considerable resources of a central processing unit (CPU).
The envelope may be an envelope for volume or an envelope for pitch. The envelope for volume may be classified into four sections including an attack, a decay, a sustain, and a release.
Since those four sections for the sound source's volume are included in volume section information, they are used in synthesizing a sound.
The frequency converter 150 reads a sound source sample for each note from the wave table 130 if a playback duration for a note is inputted, applies an envelope generated from the envelope generator 140 to the read sound source sample, and outputs the sound source sample by converting the envelope to a frequency assigned to the note. An oscillator may be used as a frequency converter 150.
For example, if the sound source sample recorded in the wave table 130 was sampled with 20 KHz and a note of music is sampled with 40 KHz, the frequency converter 150 converts the 20 KHz sound source sample into a 40 KHz sound source sample to output the 40 KHz sound source sample.
Further, if the sound source sample for each note is not recorded in the wave table 130, a representative sound source sample for each note is read from the wave table 130, and the frequency of the read sound source sample is converted into a frequency of a sound source sample that corresponds to each note. If a sound source sample for a certain note is recorded in the wave table 130, the corresponding sound source sample can be read and outputted from the wave table 130 without any frequency conversion.
The above-described process is performed repeatedly whenever the note playback duration information for each note is inputted until the playback of the MIDI is terminated.
However, the conventional MIDI player sequentially applies the envelope to the sound source sample and converts the envelope to the frequency that corresponds to each note. Accordingly, a system requires a considerable amount of operations and consumes considerable CPU resources. Further, the MIDI file should be played and outputted in real time. However, since the frequency conversion is performed for each note as described above, music might not be played in real time.
Consequently, since the conventional MIDI player consumes considerable CPU resources, it is difficult to produce rich sound quality without using a CPU capable of high performance. Therefore, a technology capable of guaranteeing a sound quality level good enough for a user to hear, while using less CPU resources is desired.
Accordingly, the present invention is directed to an apparatus and a method for processing MIDI that substantially obviate one or more problems due to limitations and disadvantages of the related art.
An object of the present invention is to provide an apparatus and a method for processing MIDI without significantly increasing a system load which may be caused by playback of the MIDI.
Another object of the present invention is to provide an apparatus and a method for processing MIDI to generate rich sound quality while using less CPU resources.
A further another object of the present invention is to provide an apparatus and a method for processing MIDI capable of reducing the amount of CPU resources used for frequency synthesis by controlling a volume of sound source samples before synthesizing the frequency.
A further another object of the present invention is to provide an apparatus and a method for processing MIDI capable of controlling a volume of a sound source sample using increments for the sound sample's volume and a volume summation.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
To achieve these objects and other advantages and in accordance with the purpose of the invention, as embodied and broadly described herein, an apparatus for processing MIDI includes: a MIDI parser for parsing a MIDI file to extract a plurality of notes, volume levels, volume section information, and note playback duration information from the inputted MIDI file; a MIDI sequencer for sorting and outputting the parsed notes in an order of playback duration; a wave table in which a plurality of sound source samples are recorded; a volume controller for controlling a volume of sound source samples that correspond to the notes using the volume sample number in each section in a volume section of the notes; and a frequency converter for converting the frequency of the volume-controlled sound source samples to a frequency assigned to the each note outputted from the MIDI sequencer and outputting the sound source samples.
In another aspect of the present invention, there is provided a method for processing MIDI, which includes: extracting a plurality of notes, volume levels, volume section information, and note playback duration information from an inputted MIDI file; calculating the volume sample number in each section using the extracted volume levels and the volume section information; controlling a volume of sound source samples using the calculated volume sample number in each section; and converting the frequency of the controlled sound source samples to a frequency assigned to the notes.
The present invention controls the volume of the sound source samples for MIDI to be played before performing frequency synthesis, thereby reducing a system load which may be caused by real time play of the MIDI.
It is to be understood that both the foregoing general description and the following detailed description of the present invention are exemplary and explanatory and are intended to provide further explanation of the invention as claimed.
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principle of the invention. In the drawings:
Reference will now be made in detail to the preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings.
Referring to
The above-described apparatus for processing MIDI will be described in detail with reference to the accompanying drawings.
Referring to
The MIDI file contains a MIDI-based tune having score data. The MIDI file is stored within a terminal or downloaded through a communication system. The ringtone for the wireless terminal is generally generated from a MIDI file except for a simple monotone sound. The MIDI file is structured to have numerous notes and control signals for the ringtone. Accordingly, for each ringtone, an instrument that corresponds to each note and additional data related to the instrument are analyzed from the sound source samples, and a sound is produced and played using the sound source samples.
The volume section information includes an attack section, a decay section, a sustain section, and a release section. Since the volume section information is represented differently according to the notes, the volume section information may be set such that it corresponds to each note.
Specifically, referring to
Though the envelope is shown in a linear form, the envelope can be a linear form or a concave form depending on the kind of the envelope and characteristics of each step. Further, articulation data which is information representing unique characteristics of the sound source samples includes time point information corresponding to the four sections of an attack, a decay, a sustain, and a release, and is used in synthesizing a sound.
The MIDI file inputted to the MIDI parser 11 already contains information about certain music and is stored in a storage medium or downloaded in real time. The MIDI file may include a plurality of notes and note playback duration information. The note is information representing a sound. For example, the note represents musical scale information, such as ‘C’, ‘D’, and ‘E’. Since the note is not an actual sound, the note should be produced from actual sound sources. Generally, the musical scale is in a range of 1 to 128.
Further, the MIDI file may be a musical piece having a beginning and an end. The musical piece may include numerous notes and lengths of each note. Therefore, the MIDI file may include information about the scale and the playback duration that correspond to the each note.
Further, a certain number of sound source samples may be pre-recorded in the wave table 18. The notes are produced from the sound source samples closest to an original sound.
Generally, since the number of the sound source samples recorded in the wave table 18 is limited and insufficient to produce all of the notes, the frequency of the sound source samples are converted to produce all of the notes.
Accordingly, the number of the sound source samples may be less than the number of the possible notes. That is, there are limitations in recording all of the 128 notes as the sound source samples in the wave table 18. Generally, only a representative number of sound source samples are selected out of the 128 notes and recorded in the wave table 18.
The MIDI file inputted to the MIDI parser 11 may include tens of notes or all of the 128 notes depending on a score. If the MIDI file is inputted, the MIDI parser 11 parses the MIDI file to extract a plurality of notes, volume levels, volume section information, and note playback duration information for the notes. Here, the note playback duration means a length of each note included in the MIDI file and is information about how long the note is played.
For example, if a playback duration of a note ‘D’ is ⅛ second, a sound source that corresponds to the note ‘D’ is played for ⅛ second.
At this point, the notes and the note playback duration are inputted to the MIDI sequencer 12. The MIDI sequencer sorts the notes in an order of the note playback duration. That is, the MIDI sequencer 12 sorts the notes according to the length of the duration for each track or the instrument.
The parsed volume levels are inputted to the volume summation calculator 13 and the volume section information is inputted to the sample calculator 14.
The volume summation calculator 13 divides the inputted volume level into a plurality of sections between zero and one, and applies the volume level for each section to the following equation 1 to calculate the volume summation level.
Wev=(1−V)/log 10(1/V) [Equation 1]
Therefore, the volume summation for each step can be outputted as many as the number of the sections divided from the volume level. For example, presuming that the volume level is divided into ten sections between zero and one, the volume level can be divided into a total of ten sections, including 0.1, 0.2, . . . , 1. At this point, the dividing of the volume level into a plurality of sections should be optimized. That is, as the volume level is divided into a greater number of sections (e.g., more than ten sections), the volume is generated in a more natural manner but the amount of CPU operation increases as well. On the contrary, as the volume level is divided into a lesser number of sections (e.g., less than ten sections), it becomes more difficult to generate a natural volume. Therefore, it is preferable to divide the volume level into optimized number of sections in consideration of the amount of CPU operation and the natural volume.
The volume summation for each section calculated by the volume summation calculator 13 is inputted to the sample calculator 14. The sample calculator 14 calculates the number of the volume samples using the volume summation for each section inputted from the volume summation calculator 13 and the volume section information inputted from the MIDI parser 11.
The sample calculator 14 determines a final time point for each volume section that will be applied in the volume section information using the volume summation for each section. The volume section information contains time points set for the respective sections currently determined, i.e., an attack section, a decay section, a sustain section, and a release section. The time points for the respective volume sections are newly determined by the volume summation for each section calculated so that the final time point for the respective volume sections are determined.
Further, the numbers of the volume samples for each section in the respective volume section where a final time point has been determined are calculated using the volume summation for each section. The number of the volume samples can be calculated by the following equation 2.
Sev=Wev/(SR*Wnote*Td) [Equation 2]
That is, Sev is proportional to Wev and inversely proportional to SR, Wnote, and Td. The Sev is obtained by dividing the Wev by a product SR*Wnote*Td.
Therefore, the numbers of the volume samples for each section(Sev) in the respective volume section where the final time point has been determined are calculated using the equation 2. The calculated number of the volume samples corresponds to the number of the sections of the volume levels.
The number of the volume samples for each section (Sev) can be constructed in a form of a table as provided by the following equation 3.
Table[Nvol]={Sev1, Sev2, Sev3, . . . , SevNvol} [Equation 3]
For example, presuming that the number of the sections of the volume level is ten, the table contains a total of ten volume samples. That is, the number of elements in the table is the same as the number of the sections of the volume.
The volume controller 15 controls a volume of the sound source samples using the number of the volume samples represented by the table.
For example, referring to
The MIDI sequencer 12 receives a plurality of notes and note playback duration information from the MIDI parser 11 and sequentially outputs the note playback duration for the notes to the frequency converter 16 after a predetermined period of time elapses.
The frequency converter 16 converts the frequency of the sound source samples whose volumes have been controlled by the volume controller 15 according to a frequency assigned to each of the notes outputted from the MIDI sequencer 12 and outputs a music file to the outside.
Though the examples have been explained on the assumption of one note, a volume value and volume section information for the note, and a note playback duration, the present invention can be applied in the same way to all of the notes included in the MIDI file in connection with the playing of the MIDI as discussed above.
Referring to
The number of volume samples for each section is then calculated using the extracted volume information (S23). For that purpose, the volume level included in the volume information is divided into optimized sections, and the volume summation for each section is then calculated. Further, the final time point for each volume section is newly determined using the volume summation for each section, and the number of volume samples for each section in the respective volume section is calculated.
Next, the volume of the sound source samples that correspond to the note play information is controlled using the number of volume samples for each section (S25). The frequency of the sound source samples whose volumes have been controlled are then converted to a frequency assigned to the notes and the sound source samples with the converted frequencies are outputted (S27).
As described above, according to the present invention, the frequency converter does not control the volume. Instead, the volume of the sound source samples is controlled in advance such that the volume may be appropriate for the respective notes, and the frequency converter converts the frequency of the sound source samples to output only the frequency of the sound source samples whose volumes have been controlled. In the related art, the operation gets congested and a CPU becomes overloaded when the frequency is converted and outputted in real time whenever loop data is repeated. The present invention can prevent the CPU overload and achieve more efficient and reliable processing of MIDI.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention. Thus, it is intended that the present invention covers the modifications and variations of this invention provided they come within the scope of the appended claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
10-2004-0019381 | Mar 2004 | KR | national |
Number | Name | Date | Kind |
---|---|---|---|
4336736 | Mishima | Jun 1982 | A |
5117726 | Lisle et al. | Jun 1992 | A |
5119711 | Bell et al. | Jun 1992 | A |
5315057 | Land et al. | May 1994 | A |
5367117 | Kikuchi | Nov 1994 | A |
5367120 | Hoshiai | Nov 1994 | A |
5444818 | Lisle | Aug 1995 | A |
5451707 | Suzuki | Sep 1995 | A |
5471006 | Schwartz et al. | Nov 1995 | A |
5734118 | Ashour et al. | Mar 1998 | A |
5744739 | Jenkins | Apr 1998 | A |
5824936 | DuPuis et al. | Oct 1998 | A |
5837914 | Schwartz et al. | Nov 1998 | A |
5880392 | Wessel et al. | Mar 1999 | A |
5917917 | Jenkins et al. | Jun 1999 | A |
5981860 | Isozaki et al. | Nov 1999 | A |
6008446 | Van Buskirk et al. | Dec 1999 | A |
6096960 | Scott | Aug 2000 | A |
6199163 | Dumas et al. | Mar 2001 | B1 |
6225546 | Kraft et al. | May 2001 | B1 |
6255577 | Imai | Jul 2001 | B1 |
6362411 | Suzuki et al. | Mar 2002 | B1 |
6365817 | Suzuki et al. | Apr 2002 | B1 |
6392135 | Kitayama | May 2002 | B1 |
6437227 | Theimer | Aug 2002 | B1 |
6525256 | Boudet et al. | Feb 2003 | B2 |
6867356 | Nishimoto | Mar 2005 | B2 |
7126051 | Fay et al. | Oct 2006 | B2 |
7151215 | Hsieh | Dec 2006 | B2 |
20010023634 | Tamura | Sep 2001 | A1 |
20010045155 | Boudet et al. | Nov 2001 | A1 |
20020156938 | Wong et al. | Oct 2002 | A1 |
20020170415 | Hruska et al. | Nov 2002 | A1 |
20030012367 | Seo | Jan 2003 | A1 |
20030017808 | Adams | Jan 2003 | A1 |
20040039924 | Baldwin et al. | Feb 2004 | A1 |
20040055444 | Ishii et al. | Mar 2004 | A1 |
20040077342 | Cho | Apr 2004 | A1 |
20040209629 | Virolainen et al. | Oct 2004 | A1 |
20050056143 | Fay | Mar 2005 | A1 |
20050188819 | Lin et al. | Sep 2005 | A1 |
20050211075 | Desai et al. | Sep 2005 | A1 |
20060086238 | Lee et al. | Apr 2006 | A1 |
20060180006 | Kim | Aug 2006 | A1 |
20060230909 | Song et al. | Oct 2006 | A1 |
20070063877 | Shmunk et al. | Mar 2007 | A1 |
Number | Date | Country |
---|---|---|
0600639 | Jun 1994 | EP |
WO 9811531 | Mar 1998 | WO |
WO 9811531 | Mar 1998 | WO |
Number | Date | Country | |
---|---|---|---|
20050204903 A1 | Sep 2005 | US |