Field of the invention
[0001] The present invention relates to a device and method for playing back MIDI melodies,
as defined in the preambles of claims 1 and 11, respectively.
Background of the invention
[0002] The popularity and number of mobile phones is constantly increasing and the phones
also include an increasing number of different features. For example, almost every
new mobile telephone sold today is able to play polyphonic melodies. That is, the
telephone is able to play more advanced melodies than can be created with a simple
pulse-width modulated signal or a tone generator able to synthesize perhaps one, two
or up to four simultaneous frequencies.
[0003] Musical Instrument Digital Interface (MIDI) is a technology that represents music
in digital form, as is explained on the Internet site www.midi.org. Unlike other digital
music technologies such as MP3 or CDs, MIDI messages contain individual instructions
for playing each individual note of each individual instrument. With MIDI it is therefore
possible to change just one note in a song or to orchestrate an entire song with entirely
different instruments. Each instrument in a MIDI performance is separate from the
rest, and it is easy to "solo", that is, listen to just one individual instrument
and to mute individual instruments in a song.
[0004] A MIDI file thus basically contains a data stream of commands on when to play a certain
note and with what instrument to play it with. As mentioned, MIDI has lately become
popular with its adoption into mobile phones. MIDI is for example used to play back
the ring tones of MIDI capable phones.
[0005] In order to play a MIDI file a synthesizer is needed that from a given MIDI file
can create sound. Since the MIDI file itself does not contain the instrument definitions
the MIDI synthesizer has to know how to play the different instruments that may be
required by the MIDI file. Stated differently, the synthesizer must, in some way,
have access to instrument definitions.
[0006] Besides being versatile, mobile phones should be as small as possible to be convenient
to bring along, but still large enough for enabling the different functions to be
performed. The available memory and amount of available processing power is limited
in such mobile phone environment, and therefore most telephones have a limited possibility
to play MIDI files.
[0007] Typical restrictions put on a MIDI synthesizer of a mobile phone is to limit the
number of simultaneously played notes (or voices) and the number of available instruments.
When a telephone tries to play a MIDI file containing instruments that have not been
defined, it typically replaces this instrument with another one that is available.
As long as the instrument set is large enough it will sound quite well even if not
all instruments required by the MIDI file are available. However, it is realised that
at some point there will be severe quality degradation of the produced sound when
the instrument set becomes too limited.
[0008] For a high-end telephone with very good playback quality something in the range of
150-175 instruments have to be defined in the MIDI synthesizer. A mid-range phone
may satisfy with about 80 instruments. A very cheap low-end telephone might have as
little as 50 instruments available.
[0009] Since a MIDI synthesizer does not know in advance when a certain instrument is needed
it has to have all instruments loaded into an easy accessible memory every time the
synthesizer is running. For a high-end phone this translates to a requirement of 10-20
kB on-chip memory. Due to the limited size of mobile phones the chip area as well
as the number of components should be minimized.
[0010] From the above it is clear that an improvement in the handling of polyphonic signals
or MIDI melodies in mobile phones would be desirable. More specifically, it would
be desirable to provide a high play back quality of polyphonic melodies in a mobile
phone, preferably with a decreased space requirement for the components needed for
implementing such function.
Summary of the invention
[0011] It is an object of the invention to provide a high-end MIDI melody playback quality
in a more space efficient way. In particular, it is an object of the invention to
provide such high quality with a reduced on-chip memory requirement compared to the
state of the art requirements on 10-20 kB on-chip memory.
[0012] This object, among others, is achieved by a device for playback of MIDI melodies
as claimed in claim 1 and by a method as claimed in claim 11.
[0013] In accordance with the invention, a device for playback of MIDI melodies is provided.
The device comprises a first memory device for storing a MIDI melody. The device further
comprises an integrated circuit comprising a MIDI synthesizer and a microcontroller.
The microcontroller is arranged to scan a MIDI melody in order to determine all instruments
utilised in the MIDI melody. The microcontroller is further arranged to store, in
the first memory device, the determined instruments in a MIDI instrument log. By means
of the invention, the innovative instrument log is utilised in order to enable a reduction
of the required on-chip memory. The instrument log for a MIDI melody most often comprises
only a sub-set of all available instruments. The instrument log thus provides a way
to load only the instruments actually used in the current MIDI melody to an on-chip
memory of an integrated circuit enabling play back of MIDI melodies.
[0014] In accordance with an embodiment of the invention, the integrated circuit of the
device further comprises a second memory device. The microcontroller is arranged to
copy the instruments of the MIDI instrument log to this second memory device when
a MIDI melody is to be played back. Thereby, only the instruments of the instrument
log are copied to the second, on-chip memory device. This provides the possibility
to reduce the on-chip area or to increase the quality of the playback, by utilising
part of the on-chip memory to increase the output sample rate or to use an improved
instrument definition.
[0015] In accordance with another embodiment of the invention, the second memory device
has the size of only a few kilobytes, which is a substantial reduction of size compared
to the on-chip memory requirements of prior art portable devices comprising such MIDI
playback means.
[0016] In accordance with another embodiment of the invention, the first memory device is
a flash memory. An readily available memory device can thus be utilised for storing
the MIDI melodies and the corresponding MIDI instrument logs.
[0017] In accordance with another embodiment of the invention, the MIDI synthesizer is a
software synthesizer, and in an alternative embodiment the MIDI synthesizer is a hardware
synthesizer. The manufacturer of the device for play back of MIDI melodies is thus
provided with the flexibility to implement the synthesizer in a suitable manner.
[0018] In accordance with yet another embodiment of the invention, the device is a mobile
phone. Improved circuitry for enabling playback of MIDI melodies is thus provided
suitable for a portable device. The manufacturing costs are reduced, as well as the
on-chip area.
[0019] The invention is also related to such method, whereby advantages corresponding to
the above are achieved.
[0020] Further characteristics of the invention and advantages thereof will be evident from
the detailed description of a preferred embodiment of the present invention given
hereinafter and the accompanying figures, which are only given by way of illustration,
and thus are not limitative of the present invention.
Brief description of the drawings
[0021]
Figure 1 illustrates components included in a device in accordance with an embodiment
of the present invention.
Figure 2 illustrates schematically an exemplary device comprising the components illustrated
in figure 1.
Figure 3 is a flow chart of the steps included in an embodiment of a method in accordance
with the invention.
Figure 4 is a flow chart summarizing the steps included when a melody is to be played.
Detailed description of preferred embodiments
[0022] As was explained in the introductory part of the description, a MIDI file basically
contains a data stream of commands on when to play a certain note and with what instrument
to play it with. The inventor of the present invention has taken advantage of the
fact that the MIDI file itself does not contain the instrument definitions in order
to provide a polyphonic feature to a mobile phone, or a similar portable device, in
an improved way. The main improvement consists in the provision of a polyphonic feature
with maintained playback quality, but without the large on-chip memory requirements.
[0023] The basic idea of the invention is thus to be able to offer a high-end MIDI playback
quality without the requirement of 10-20 kB on-chip memory for instrument definitions.
[0024] Even if a good quality MIDI synthesizer require more than 150 instruments there is
very seldom more than 16 instruments actually used in a single melody. The inventor
of the present invention has realized that this fact gives an opening for reducing
en on-chip memory usage, provided that a priori information on what instruments are
going to be used in a specific melody can be obtained. Only the actually used instruments
need to be easily accessible by the MIDI synthesizer. The remaining ones could be
placed off-chip in a fairly slow external memory, typically a serial or parallel flash
memory.
[0025] Figure 1 illustrates schematically an integrated circuit 1 comprising the required
means for implementing the present invention. The integrated circuit 1 comprises a
microcontroller 3, for performing the required processing. An interface, indicated
in the figure by reference numeral 5, is required for accessing an off-chip memory,
hereinafter called an external memory 6. The interface 5 can be of a serial or parallel
type. The external memory device 6, that is, the off-chip memory device, is preferably
a flash memory, but any other memory device suitable for the present application is
conceivable, for example a programmable read-only memory (PROM), an erasable programmable
read-only memory (EPROM) or Electrically EPROM (EEPROM). The external memory device
6 may thus be of a slower kind and is utilized for storing the MIDI melodies and their
corresponding instrument log files (to be described later).
[0026] The integrated circuit 1 further comprises a MIDI synthesizer 2 for providing the
polyphonic features. The MIDI synthesizer 2 can be implemented by means of hardware
or in software. The MIDI synthesizer 2 can thus be a dedicated circuit for producing
MIDI melodies from the MIDI data, or, in an alternative, be implemented in software.
Software synthesizers can be incorporated into the program storage means of the microcontroller
3, e.g. a Read-only memory (ROM). However, a software solution consumes a bit more
processing power and the synthesis method requires memory storage and there is therefore
a slightly larger space requirement.
[0027] Finally, the integrated circuit 1 comprises some on-chip memory 4, for example random-access
memory (RAM). This on-chip memory 4 is utilised for storing the actually used instruments
in each melody. The remaining instruments are stored in the external memory 6, which
can be a relatively slow memory. The on-chip memory 6 can be of a smaller size compared
to the state of the art required 15-20 kB. In accordance with the invention, the on-chip
memory 6 needs only be a few kB, for example in the range of 1-5 kB or possibly up
to 10 kB, depending on the instrument quality.
[0028] The microcontroller 3 also comprises a MIDI parser arranged to scan the MIDI melodies
during download. That is, the MIDI parser or program performs a process of analyzing
an input MIDI file. The MIDI parser scans the MIDI melody in order to log all instruments
used in that particular MIDI melody. The result is a MIDI instrument log. This MIDI
instrument log is preferably stored in the external memory device 6, typically in
connection with the MIDI melody. For example, the MIDI instrument log is stored right
after or before the melody itself, although it is understood that other solutions
are possible.
[0029] When a melody is to be played by a portable device comprising the integrated circuit
1, such as for example a cellular phone, the MIDI instrument log corresponding to
the desired melody is first read by the microcontroller 3 and stored in the on-chip
memory 4. Thereby only the instruments needed for this particular melody needs to
be copied from the external memory device 6. The instruments from the MIDI instrument
log are thus copied from the external memory device 6 into the integrated circuit
1 and made available for and accessible by the MIDI synthesizer 2. Only thereafter
is the MIDI file sent from the external memory device 6 to the MIDI synthesizer 2.
The MIDI synthesizer 2 thereafter produces a melody that is played in a loudspeaker
in a conventional manner.
[0030] Figure 2 illustrates schematically a mobile phone 10 comprising the above-described
circuitry for performing the inventive way of accomplishing playback of polyphonic
melodies. The mobile phone 10 thus comprises an external memory device 6 and an integrated
circuit 1 as described above (not shown to scale). It is understood that the inventive
way of providing polyphonic melodies is applicable to other devices as well, for example
cordless phones such as DECT (Digital Enhanced Cordless telecommunication) or handheld
game consoles. Other portable electronic devices may also take advantage of the present
invention. In a mobile phone 10 this playback solution is particularly suitable, owing
to the reduced on-chip memory requirement provided by the present invention. The reduced
on-chip memory requirement gives reduced manufacturing costs. The size of the integrated
circuit 1 enabling the MIDI melody play back may also be reduced.
[0031] Figure 3 is a summarizing flow chart over the steps included in a method 20 in accordance
with the invention. The first step 21 is to scan a MIDI melody during downloading.
All the instruments of that MIDI melody are thereby logged (step 22). The MIDI melody
is stored in an external memory, step 23, and the instrument log is also stored in
this external memory, step 24.
[0032] Figure 4 is a summarizing flow chart over the steps included in a method 30 for playing
back a MIDI melody. In the first step, the MIDI instrument log corresponding to the
melody to be played is read by the microcontroller 3. Thereafter, in step 32, the
instruments from the instrument log read in the previous step are copied from the
external memory device 6 into the on-chip memory 4 of the integrated circuit 1. The
relevant instruments are thereby accessible by the MIDI synthesizer 2. Subsequently,
the MIDI file is sent to the MIDI synthesizer 2, step 33. The MIDI synthesizer 2 is
now, step 34, able to produce a melody to be played in a loudspeaker.
[0033] In an alternative embodiment, instead of reducing the on-chip memory 4, the on-chip
memory 4 can be utilised for providing a better MIDI playback quality by increasing
the produced output sample rate or by using better instrument definitions.
[0034] In summary, the present invention provides a way to reduce the on-chip memory requirement
of a portable device, thus lowering the costs and enables a size reduction of the
portable device. This reduction of memory requirements is accomplished by avoiding
to load a complete instrument set every time a MIDI file is to be played, and instead
only load a sub-set of the instrument set. Further, the load time for downloading
a melody to the on-chip memory of a mobile phone can thereby also be reduced.
[0035] In the preceding detailed description, the invention is described with reference
to specific exemplary embodiments thereof. Various modifications and changes may be
made thereto without departing from the scope of the invention as set forth in the
claims. The specification and drawing are, accordingly, to be regarded in an illustrative
rather than in a restrictive sense.
1. A device for playback of MIDI melodies, said device comprising a first memory device
(6) for storing a MIDI melody, characterised in an integrated circuit (1) comprising a MIDI synthesizer (2) and a microcontroller
(3), said microcontroller (3) being arranged to scan a MIDI melody in order to determine
all instruments utilised in said MIDI melody, said microcontroller (3) further being
arranged to store, in said first memory device (6), said determined instruments in
a MIDI instrument log.
2. The device as claimed in claim 1, wherein said integrated circuit (1) further comprises
a second memory device (4).
3. The device as claimed in claim 3, wherein said microcontroller (3) is arranged to
copy the instruments of said MIDI instrument log to said second memory device (4)
when said MIDI melody is to be played back by said device.
5. The device as claimed in any of claims 3 or 4, wherein said second memory device
(4) has the size of only a few kilobytes, such as in the range of 1-10 kB.
6. The device as claimed in any of the preceding claims, wherein said first memory device
(6) is a flash memory.
7. The device as claimed in any of the preceding claims, wherein said MIDI synthesizer
(2) is a software synthesizer.
8. The device as claimed in any of the preceding claims, wherein said MIDI synthesizer
(2) is a hardware synthesizer.
9. The device as claimed in any of the preceding claims, wherein said device is one
of the following: a mobile phone (10), a cordless phone or a handheld game console.
10. The device as claimed in any of the preceding claims, wherein said first memory device
(6) is arranged external to said integrated circuit (1).
11. A method for enabling playback of MIDI melodies in a device (10) comprising a first
memory device (6)
characterised in that the device (10) further comprises an integrated circuit (1) comprising a second memory
device (4), a microcontroller (3), and a MIDI synthesizer (2) for use in playback
of a MIDI melody, wherein the method comprises the steps of:
- downloading to said first memory device (6) a MIDI melody,
- determining, during said downloading, all instruments used in said MIDI melody,
- storing, in said first memory device (6), said MIDI melody into a MIDI file, and
- storing, in said first memory device (6), a MIDI instrument log obtained in said
step of determining, whereby said MIDI instrument log is utilised for determining
which instruments to copy from said first memory device (6) to said second memory
device (4) of said integrated circuit (1) when playing back said MIDI melody.
12. The method as claimed in claim 11, wherein said step of determining all instruments
used in said melody comprises scanning, by a MIDI parser, said MIDI melody during
the downloading in order to determine all instruments used in said MIDI melody.