Patent ID: 12229089

DETAILED DESCRIPTION OF EMBODIMENTS

An electronic musical instrument will be described in detail as an example of an electronic device according to an embodiment of the present disclosure with reference to the drawings.

FIG.1is a diagram showing the appearance of an electronic musical instrument1according to an embodiment of the present disclosure.FIG.2is a block diagram showing the configuration of the electronic musical instrument1. The electronic musical instrument1is, for example, an electronic keyboard incorporating a synthesizer tone generator. The electronic musical instrument1may be an electronic instrument other than an electronic keyboard; it may be an electronic percussion instrument, an electronic wind instrument, or an electronic string instrument.

The electronic musical instrument1has a hardware configuration including at least one processor10, a RAM (Random Access Memory)11, a flash ROM (Read Only Memory)12, a USB (Universal Serial Bus) interface13, an LCD (Liquid Crystal Display)14, an LCD controller15, keyboard16, operation unit17, key scanner18, pulse counter19, A/D converter20, sound source LSI (Large Scale Integration)21, D/A converter22, amplifier23, and speaker24. Each of these parts of the electronic musical instrument1is connected by a bus25.

The processor10reads programs and data stored in the flash ROM12and uses the RAM11as a work area to control the electronic musical instrument1in a comprehensive manner.

The processor10is, for example, a single processor or a multiprocessor and includes at least one processor. In the configuration including a plurality of processors, the processor10may be packaged as a single device, or may be composed of a plurality of physically separated devices within the electronic musical instrument1.

The processor10includes, as functional blocks, a selection operation receiving process100athat receives a user's selection operation to select one data type from a plurality of data types, each of which is first data having a hierarchal structure using a second data lower in a lower hierarchal level, and a data saving operation process100bthat causes the first data to be saved in a storage unit(s) based on the data type selected by the selection operation. The operation of these functional blocks makes it easier for the electronic musical instrument1to handle data having a hierarchical structure. A data processing method and a storage medium according to an embodiment of the present disclosure are realized by causing the processor10to execute the functional blocks of respective types of processing. The processor10is an example of a computer that can access the flash ROM12, which is an example of the storage unit.

The RAM11temporarily holds data and programs. The RAM11holds programs and data read from the flash ROM12and other data necessary for communication.

The flash ROM12functions as a storage medium, is a non-volatile semiconductor memory such as flash memory, EPROM (Erasable Programmable ROM), EEPROM (Electrically Erasable Programmable ROM), etc., and plays a role as a secondary storage device or an auxiliary storage device. The flash ROM12stores programs and data, including a data processing program120, used by the processor10to perform various processes.

In this embodiment, each functional block of the processor10is implemented by a data processing program120that is software. Note that each functional block of the processor10may be partially or wholly realized by hardware such as a dedicated logic circuit.

The USB interface13is an interface to which a USB flash memory2, which is an example of an external storage medium, can be connected.

The LCD14is an example of a display device. The LCD14is driven by LCD controller15. When the LCD controller15drives the LCD14according to the control signal from the processor10, a screen corresponding to the control signal is displayed on the LCD14. The LCD14may be replaced with a display device such as an organic EL (Electro Luminescence) or an LED (Light Emitting Diode). The LCD14may be a touch panel. In this case, the touch panel may serve as both an input device and a display device.

The keyboard16is a keyboard having a plurality of white keys and black keys as a plurality of performance operators. Each key is associated with a different pitch.

The operation unit17includes operators such as switches, buttons, knobs, rotary encoders, wheels, touch panels, etc., of mechanical type, capacitance non-contact type, membrane type, and the like.FIG.2shows a switch panel17a, a rotary encoder17b, and a wheel17cas examples of operating elements included in the operation unit.

As a more specific example, the operation unit17includes a pitch bend wheel, a modulation wheel, a volume knob, a function rotary encoder, a layer rotary encoder, a parameter rotary encoder, a data entry section, and a registration section170.

The pitch bend wheel is an operator for generating the pitch bend effect. The modulation wheel is an operator for generating a vibrating sound effect such as vibrato. The volume knob is an operator for adjusting the volume. The function rotary encoder is an operator for selecting a function to change settings. The layer rotary encoder is an operator for selecting a layer whose settings are to be changed. The parameter rotary encoder is an operator for selecting parameters included in the selected function. The data entry section includes a rotary encoder and “+” and “−” keys for changing the value of the selected parameter. The registration section170is an operator for selecting registration data.

As shown in the enlarged view ofFIG.1, the registration section170includes a “BANK+” key172and a “BANK−” key174and ten number buttons176athrough176jfor “1” through “9” and “0”, respectively.

In this embodiment, 200 pieces of registration data are stored in the flash ROM12. The 200 pieces of registration data are divided into a total of 20 groups selectable by the ‘BANK+’ key172and the ‘BANK−’ key174. Each group stores 10 pieces of registration data. The user selects one group by operating the “BANK+” key172and the “BANK−” key174, and presses one of the number buttons176ato176jto select one registration data from the selected group. Information on the selected group and registration data is displayed on the LCD14, for example.

The key scanner18monitors key depression and key release on the keyboard16and operations on some of the operators included in the operation unit17. The key scanner18outputs key depression event information to the processor10, for example, upon detecting a key depression operation by the user. The key depression event information includes pitch information (key number) of the key associated with the key depression operation. A key number is also called a key number, a MIDI key, or a note number.

Note that a unit for measuring the key pressing speed (velocity value) may be separately provided, and the velocity value may be included in the key pressing event information. As the key pressing speed measuring unit, for example, two or three contact switches may be provided for each key so as to measure differences in the time when these contact switches are successively turned on when the key is pressed. The velocity value can also be said to be a value that indicates the strength of the key depression operation.

The pulse counter19is a device that detects movements of various rotary encoders (referred to as “rotary encoder17b” inFIG.2).

The A/D converter20is a device that converts analog voltages corresponding to volume positions of various wheels (referred to as “wheel17c” inFIG.2) into digital data.

The processor10instructs the sound source LSI21to read the corresponding waveform data out of the plurality of waveform data stored in the flash ROM12. The waveform data to be read out is determined according to, for example, the tone color selected by the user's operation and the key depression event information.

The sound source LSI21generates musical tones based on waveform data read from the flash ROM12under instructions from the processor10. The sound source LSI21has, for example, 128 generator sections, and can generate up to 128 musical tones simultaneously. Although the processor10and the sound source LSI21are configured as separate devices in this embodiment, the processor10and the sound source LSI21may be configured as one processor in another embodiment.

A digital audio signal of a musical tone generated by the sound source LSI21is converted into an analog signal by the D/A converter22, amplified by the amplifier23and output from the speaker24.

In this embodiment, the operation of the functional blocks of the processor10makes it easier for the electronic musical instrument1to handle data having a hierarchical structure. In this embodiment, registration data is given as an example of data having a hierarchical structure (first data). Schematically, the registration data has a hierarchical structure having a hierarchically lower level data. In the present embodiment, tone data is given as an example of lower level data (second data) of the registration data. The flash ROM12operates as a storage section that stores registration data that can be processed by the electronic musical instrument1.

Registration data is environment setting data that include the settings related to the overall operation of performance and sound. In this embodiment, four timbres (in other words, four tone data) can be designated simultaneously by registration data. By using such registrations, the user can perform a layered performance in which up to four timbres are superimposed.

FIG.3is a diagram for explaining registration data and tone data.FIG.3shows one registration data230loaded into the RAM11, which is a work area, and a group of data stored in the flash ROM12.

As shown inFIG.3, the data group stored in the flash ROM12includes a tone directory200, a plurality of tone data210, a registration directory220, and a plurality of registration data230.

The tone data210is a collection of parameters related to timbre. The data size of the tone data210is, for example, 200 bytes. The maximum number of tone data210that can be stored in the flash ROM12is, for example, 1,000. The number of tone data210stored in the flash ROM12increases or decreases by operations of newly creating, duplicating, and deleting.

As shown inFIG.3, the registration data230loaded into the RAM11has common parameter area CPA, tone directory area TDA, and physical data of up to four tone data corresponding to four layers1-4. Hereinafter, for the sake of convenience, the physical data of tone data will be referred to as “tone physical data”.

The flash ROM12stores registration data230of a plurality of data types.FIG.4illustrates data types of the registration data230stored in the flash ROM12.

As indicated by symbol A inFIG.4, as one data type, the flash ROM12stores registration data230having a total of four tone physical data corresponding to layers1-4. The data type having tone physical data for at least some of the layers is referred to as “data inclusion type”. For convenience, the registration data230having tone physical data corresponding to all layers1to4is referred to as “all-inclusive registration data230”.

When loading the all-inclusive registration data230into the RAM11, the processor10copies the registration data230itself to the RAM11. This allows the user to perform using the registration data230.

As indicated by symbol B inFIG.4, as another data type, the flash ROM12stores registration data230that has one or more and three or less tone physical data and that is a mixture of the data inclusion type and the reference type. The reference type is a layer data type that does not have tone physical data. In the reference type, the tone number assigned to the tone data210, which is the reference destination, is described in the tone directory area TDA instead of having actual tone physical data. The tone number described in the tone directory area TDA is reference information for referring to tone data210, which is an example of the second data.

Here, the tone directory area TDA manages whether or not there is tone physical data and the tone number indicating the reference destination tone data210. Specifically, the tone directory area TDA specifies a value of 0 to 1000 associated with each layer. A value of 0 indicates that it has tone physical data. Values 1 to 1000 indicate tone numbers of tone data210stored in flash ROM12.

In the example of symbol B inFIG.4, the value “0, 99, 0, 0” are described in the tone directory area TDA, and these values indicate the information for layers1to4in that order. Specifically, the leading value 0, the third value 0, and the fourth value 0 indicate information of layers1,3, and4, respectively. The value 99 indicates layer2information. In this example, the registration data230includes tone physical data for the layers1,3and4, and indicates that the reference destination for the layer2is a tone data210having the tone number99. Here, all values other than the value 0 indicate tone numbers.

Thus, the registration data230indicated by symbol B inFIG.4is registration data230in which the reference type and the data inclusion type are mixed. For convenience, such registration data230is referred to as “mixed-type registration data230”.

When loading the mixed-type registration data230into the RAM11, the processor10copies the registration data230itself to the RAM11. During use of registration data230, processor10will read tone data210from flash ROM12as needed for reference-type layers.

When the mixed-type registration data230is loaded into the RAM11, the processor10may read the tone data210indicated by the tone number described in the tone directory area TDA from the flash ROM12and copy it to the corresponding layer. In this case, the registration data230on the RAM11is in the same state as the all-inclusive type. Therefore, the processor10can use the registration data230only by reading the registration data230that has been loaded into the RAM11(from another point of view, without reading the flash ROM12). As a result, processing speeds up.

As indicated by symbol C inFIG.4, as another data type, the flash ROM12stores reference-only registration data230that does not have any tone physical data. For convenience, the reference-only registration data230is referred to as “all-reference-type registration data230”.

When loading the all-reference-type registration data230into the RAM11, the processor10copies the registration data230itself to the RAM11. The processor10will read the tone data210from the flash ROM12as needed for each layer while using the registration data230.

The data size of the registration data230differs depending on how many tone physical data it holds. That is, the registration data230is variable length data. For example, the data size of all-reference-type registration data230that does not have any tone physical data is 100 bytes. The data size of all-inclusive registration data230having four tone physical data is 900 bytes.

In this embodiment, the area in the flash ROM12that is allocated for the registration data230is 100,000 bytes. Therefore, if all the registration data230are of the all-inclusive type, the flash ROM12can store up to 111 registration data230. However, in view of the efficiency of data, it is thought that there are many cases where the reference type is applied. Therefore, in this embodiment, the maximum number of registration data230that can be stored in the flash ROM12is set to 200, and the maximum number of tone physical data that can be included in all the registration data230is set to 400. In this case, up to 100 vall-inclusive registration data230can be stored in flash ROM12.

All the data in the flash ROM12is managed by a file system. Therefore, each of the plurality of tone data210is treated as one file. Each of the plurality of registration data230is also handled as one file. These data are managed by file names instead of addresses.

The tone directory200is a directory for associating the tone number assigned to each tone data210with the file name. The registration directory220is a directory for associating a number assigned to each registration data230(hereinafter referred to as “registration number”) with a file name.

FIG.5is a diagram showing an example of the registration directory220. The registration directory220manages the registration data230by associating the registration number, the file name, the number of tone physical data contained, and the data size (unit: bytes).

Conventionally, when changing one tone data shared by a plurality of registration data, the timbre/tone color is changed in all of the registration data that refer to the changed tone data. If the user did not want to change the tone color in some of these registration data, the user had to search for all of the registration data that have been affected and had to edit these registration data so that the timbre is not changed unintentionally. Such work imposes a heavy burden on the user.

Also, when copying registration data to another compatible electronic musical instrument, passing it to other users, or uploading and sharing it on a network, the tone data referenced by the registration data could not be omitted and needed to be copied or like. However, such work is cumbersome for users. Furthermore, in order to use registration data, tone data and registration data, which are separate and independent data, must be managed as a set. Therefore, the mixed-type registration data including the reference-type registration data and the all-reference-type registration data are inconvenient in terms of portability.

On the other hand, with all-inclusive registration data, there is no need to duplicate tone data, and there is no need to manage separate tone data as a separate data. For example, simply by copying registration data alone to another electronic musical instrument, the registration data can be used in another electronic musical instrument. Therefore, all-inclusive registration data is excellent in terms of portability.

However, since it is not a data structure in which multiple registration data share and refer to one tone data, there may be cases where multiple registration data contain the same tone data, or a single registration data contains the same tone data in a plurality, for example. Therefore, this data structure is inferior to reference types in terms of efficient data management. The large data size puts pressure on the memory, and a large amount of data transfer when switching registration data may cause the processing load to increase undesirably.

Therefore, in this embodiment, the data processing program120described below is executed. Execution of the data processing program120makes it easier for the electronic musical instrument1to handle the registration data230.

FIG.6is a flow chart showing processing of the data processing program120executed by the processor10in one embodiment of the present disclosure. For example, when the user operates the function rotary encoder, execution of the data processing program120is started.

The processor10detects a function that is set by operating the function rotary encoder (step S101).

The processor10determines whether the function detected in step S101is the selection function for the registration data230(step S102).

If the function detected in step S101is the selection function of the registration data230(step S102: YES), the processor10executes the selection process of the registration data230(step S103).

Specifically, the processor10accepts operations on the registration section170. The user can select the bank that manages the registration data230by pressing the ‘BANK+’ key172or the ‘BANK−’ key174, for example. The bank being selected is displayed on the LCD14. When the user presses one of the number buttons176a-176j, the selection for the registration data230is confirmed.

When the selection for the registration data230is confirmed, the processor10acquires the corresponding registration number. The processor10reads the registration data230to which the acquired registration number is assigned (in other words, the registration data230selected by the selection operation) from the flash ROM12, transfers it to and loads it into the RAM11, and performs the processing according to this flowchart. The processor then terminates the process of this flowchart.

If the function detected in step S101is the editing function of registration data230(step S102: NO and step S104: YES), the processor10executes an editing process for editing registration data230(step S105). The registration data230to be edited is, for example, the registration data230selected by the selection function and loaded into the RAM11.

The user can edit the parameters defined in the common parameter area CPA of the registration data230by operating the operation unit17. The editable parameters are, for example, the file name of registration data230, mode, and the tone number.

In the common parameter area CPA, the mode of each layer1to4is defined. The mode of each layer1-4indicates the data type of the tone corresponding to each layer1-4. The data types indicated by modes include two reference types and one data inclusion type. One of the reference types is a content-dependent reference type (first reference type). Another reference type is a content-guaranteed reference type (second reference type). Mode 0 indicates a content-dependent reference type. Mode 1 indicates a content-guaranteed reference type. Mode 2 indicates a data inclusion type.

For example, when “0012” is described in the common parameter area CPA as the mode value, this value is the information of layers1to4arranged in order. Specifically, the leading value 0 and the following value 0 indicate layer1and layer2information, respectively. The value of 1 indicates layer3information. The value of 2 indicates layer4information. In this example, layers1and2are defined as the content-dependent reference types, layer3is defined as the content-guaranteed reference types, and layer4is defined as the data inclusion types.

When the content of the tone data210shared (referred to by) by a plurality of registration data230is changed, among all the layers of the registration data230describing this tone data210as the reference destination, for the layers describing it as a content-dependent reference type, the tone number described as the reference destination in the tone directory area TDA is not changed. Therefore, the registration data230including such layers are affected by the change in timbre accompanying the change in the tone data210.

On the other hand, among all the layers of the registration data230in which the tone data210is described as the reference destination, for the layers describing it as the content-guaranteed reference type, the tone number in the tone directory area TDA as a reference destination is modified in the following manner.

Specifically, when the content of the tone data210is changed and saved, the processor10creates a copy of the tone data210before change, assigns a new tone number, and saves it in the flash ROM12. For a layer defined as the content-guaranteed reference type, the tone number described in the tone directory area TDA is rewritten with the new tone number assigned to the duplicated tone data210(which is the original tone data210before being changed). Because of such a rewriting process, in a layer defined as the content-guaranteed reference type, the content of the reference destination tone data210remains the same as before the change. Therefore, such registration data230is not affected by changes in tone color caused by changes in tone data210.

In this way, when the tone data210(second data) referenced by the content-guaranteed reference type (second reference type) is changed, the processor10duplicates the tone data210before the change, The tone number (reference information) indicating the reference destination is changed so that the content-guaranteed reference type registration data230refers to the original tone data210.

FIG.7is a subroutine showing details of the editing process in step S105ofFIG.6. As shown inFIG.7, the processor10first confirms the parameters defined in the common parameter area CPA (step S201).

When the user performs an operation to change the file name (step S202: YES), the processor10updates the file name (step S203). Specifically, in step S203, the processor10updates the file name defined in the common parameter area CPA, and also updates the file name of the registration data230to be edited, which has been registered in the registration directory220. The processor10saves the updated registration data230in the flash ROM12and terminates the processing of the flowchart ofFIG.6.

When the user performs an operation to change the layer mode (step S202: NO and step S204: YES), the processor10determines whether the operation is a change operation from a reference type (content-dependent reference type or content-guaranteed reference type) to the data inclusion type (step S205).

If it is a change operation from a data reference type to the data inclusion type (step S205: YES), processor10changes the corresponding layer from the original data reference type to the data inclusion type (step S206).

Specifically, in step S206, the processor10reads the tone data210indicated by the tone number described in the tone directory area TDA from the flash ROM12, and copies it to the corresponding layer. Furthermore, the processor10updates the value corresponding to this layer (as described inFIG.4, the value 0 indicates layer information and the value other than 0 indicates the tone number) to zero, and describes the mode after change (that is, data value 2 indicating a data inclusion type) in the common parameter area CPA. The processor10saves the thus updated registration data230in the flash ROM12and terminates the processing of the flowchart ofFIG.6.

If the change operation is from the data inclusion type to a data reference type (step S205: NO and step S207: YES), the processor10changes the corresponding layer from the data inclusion type to a data reference type (step S208).

Specifically, in step S208, the processor10writes the tone number indicating the reference destination in the tone directory area TDA, deletes the tone physical data of the corresponding layer, and describes an appropriate mode after the change (that is, the value 0 indicating the content-dependent reference type or value 1 indicating the content-guaranteed reference type) in the common parameter area CPA. The processor10saves the updated registration data230in the flash ROM12and terminates the processing of the flowchart ofFIG.6. Note that the tone number described in the tone directory area TDA is designated by, for example, a user's operation.

When the mode is changed from the content-dependent reference type to the content-guaranteed reference type or from the content-guaranteed reference type to the content-dependent reference type, the processor10changes the value of the mode from 0 to 1 or from 1 to 0, and saves it in the flash ROM12. Thereafter, the processing of the flowchart ofFIG.6is terminated.

In this way, in the editing process of step S105inFIG.6, the processor10performs as selection operation receiving process100athat receives a selection operation by a user selecting one data type from a plurality of selectable data types of the first data (registration data230) (that is, among the data inclusion type, the content-dependent reference type, and the content-guaranteed reference type), and performs the data saving operation process100bthat saves the first data (registration data230) in the flash ROM12, which is an example of a storage unit/memory, based on the data type selected by the selection operation.

By simply changing the mode, the user can change the complex registration data230with a hierarchical structure to, for example, a data type that is easy for him/herself to handle.

When the user performs an operation to change the tone number (step S204: NO and step S209: YES), the processor10determines whether the mode of the corresponding layer is the data inclusion type (step S210). If it is the data inclusion type (step S210: YES), the processor10ends the processing of the flowchart ofFIG.6.

If the mode of the corresponding layer is the data reference type (step S210: NO), in step S211, processor10changes the tone number corresponding to this layer described in tone directory area TDA to the tone number specified by the change operation, thereby updating the tone number. The processor10saves the updated registration data230in the flash ROM12and terminates the processing of the flowchart ofFIG.6.

If a change operation is performed for parameters other than the file name, mode, and tone number (step S209: NO), the processor10executes a processing according to such a change operation in step S212, and the processing of the flow chart ofFIG.6terminates.

Here, in this editing process, it has been described that the updated registration data230is saved in the flash ROM12, but the process according to the present disclosure is not limited to this. The updated registration data230may be stored in the flash ROM12through the writing process in step S107described below.

If the function detected in step S101is the function to write the registration data230(step S104: NO and step S106: YES), the processor10executes a write process to write the registration data230to the flash ROM12(step S107). The registration data230to be written may be, for example, registration data230newly created and held in the RAM11, or registration data230edited by the editing process in step S105.

FIG.8is a subroutine showing the details of the writing process in step S107ofFIG.6. As shown inFIG.8, the processor10selects the registration number of the write destination (step S301). The registration number may be a number designated by a user's operation, or a number automatically determined by the processor10.

The processor10acquires the number A of tone physical data included in the registration data230to be written (step S302).

The processor10acquires the number B of tone physical data included in the registration data230corresponding to the registration number of the write destination (step S303). If the registration data230corresponding to the registration number has not been registered, the number B of tone physical data acquired here is zero.

The processor10acquires the total number C of all the tone physical data stored in the entire flash ROM12(step S304).

The processor10subtracts the number B obtained in step S303from the sum of the number A obtained in step S302and the number C obtained in step S304, and determines whether or not the resulting value is greater than 400 (which is the maximum number of tone physical data that can be included in all of the registration data230) (step S305).

If the value does not exceed400(step S305: NO), the processor10saves the to-be-written registration data230in the flash ROM12(step S306), and terminates the processing of the flowchart ofFIG.6. As a result, the registration data230corresponding to the registration number of the write destination is updated.

If the above value exceeds400(step S305: YES), the processor10displays an error message (step S307) and terminates the processing of the flowchart ofFIG.6. As an example, an error message such as “MEMORY FULL” is displayed. In this case, in order to write the to-be-written registration data230, the user needs to reduce the number of tone data210stored in the flash ROM12by, for example, moving part of the registration data230in the flash ROM12to an external storage medium.

If the function detected in step S101is the editing function of the tone data210(step S106: NO and step S108: YES), the processor10executes an editing processing for editing the tone data210(step S109). The tone data210to be edited is, for example, the tone data210corresponding to the layer specified by the user's operation in the registration data230selected by the selection function and loaded into the RAM11.

If the editing target is included in the registration data230as tone physical data (that is, if it is of the data inclusion type), the processor10changes this tone physical data according to the user's operation. If there is no tone physical data and the referenced tone number is described (that is, if it is of a data reference type), the processor10reads the tone data210indicated by the referenced tone number from the flash ROM12, copies it to the corresponding layer, and change this tone data210according to the user's operation. The processor10stores the changed tone data210in the flash ROM12.

If the function detected in step S101is the writing function of the tone data210(step S108: NO and step S110: YES), the processor10executes a writing processing to write the tone data210to the flash ROM12(step S111). The tone data210to be written is, for example, the tone data210corresponding to the layer specified by the user's operation in the registration data230selected by the selection function and loaded into the RAM11.

FIG.9is a subroutine showing the details of the writing process in step S111ofFIG.6. As shown inFIG.9, the processor10selects a tone number to write to (step S401). The tone number may be designated by a user's operation, or may be automatically determined by the processor10.

The processor10searches for the registration data230that include the content-guaranteed reference layer describing, as the reference destination, the tone number that has been selected in step S402among the all of the registration data230stored in the flash ROM12.

Then, the processor10determines whether or not such registration data230exists (step S403). If the corresponding registration data230does not exist (step S403: NO), the processor10writes the to-be-written tone data210in the flash ROM12(step S404), and terminates the processing of the flowchart ofFIG.6. As a result, the updated tone data210corresponding to the destination tone number is stored in the flash ROM12.

If the corresponding registration data230exists (step S403: YES), the processor10searches flash ROM12for an unused tone number (that is, a tone number to which a tone data210has not been assigned), and acquires an unused tone number found as a result of the search (step S405). The acquired tone number is held as value E. If no unused tone number is found, the value E is set to −1.

If the value E is not −1 (step S406: NO), the processor10duplicates the original tone data210indicated by the tone number selected in step S401, and saves the duplicated tone data210at the tone number indicated by the value E in the flash ROM12(step S407).

With respect to all of the applicable layers in the registration data230found in step S402(that is, all content-guaranteed reference-type layers in which the tone number selected in step S401is described as the reference destination), the processor10changes the reference destination tone number to the tone number indicated by the value E (step S408). Next, the processor10stores the to-be-written tone data210in the flash ROM12as the tone data210of the tone number selected in step S401(step S404).

Thus, for a layer defined as content-guaranteed reference type, the tone number described in the tone directory area TDA is rewritten to the new tone number assigned to the duplicated original tone data210. Since this rewrite processing is performed, the contents of the tone data210referred to are the same as before the change. Therefore, these registration data230are not affected by changes in tone color caused by changes in tone data210. Therefore, the user does not have to perform complicated editing work on the registration data230in order to avoid unintended changes in tone color.

Note that if writing of the to-be-written tone data210into the flash ROM12would result in the number of tone physical data in the flash ROM12exceeding the maximum number of 400, the processor10does not perform the processing of step S408, and displays an error message as in the writing process of S107. Therefore, the process of the flowchart ofFIG.6is terminated. Further, if the value E is −1 in step S406(step S406: YES), the processor10displays an error message because there is no area in the flash ROM12for writing the tone data210to be written (step S409), and the process of the flowchart ofFIG.6is terminated.

Next, operations for handling tone data210and registration data230using an external storage medium (for example, USB flash memory2) connected to electronic musical instrument1will be described.

If the function detected in step S101is the function to save the registration data230(step S110: NO and step S112: YES), the processor10executes a saving process of saving the registration data230stored in the flash ROM12in the external storage medium (step S113). The registration data230to be saved is, for example, the registration data230specified by the user's operation.

FIG.10is a subroutine showing the details of the saving process in step S113ofFIG.6. As shown inFIG.10, the processor10determines whether or not the storage destination external storage medium can be normally accessed (step S501). For example, if the storage destination external storage medium is not connected to the electronic musical instrument1, normal access cannot be performed. In this case (step S501: NO), the processor10displays an error message (step S502) and terminates the processing of the flowchart ofFIG.6.

If the storage destination external storage medium can be normally accessed (step S501: YES), the processor10acquires the file name (step S503) and the registration number (step S504) of the registration data230to be saved.

The processor10saves the image file of the registration data230indicated by the registration number acquired in step S504in the external storage medium with the file name acquired in step S503(step S505).

While writing to the external storage medium, an error will occur if there is insufficient free space on the external storage medium. If such an error occurs (step S506: YES), the processor10displays an error message (step S507), cancels writing to the external storage medium, and terminates the processing of the flowchart ofFIG.6. If no such error occurs (step S506: NO), the registration data230is normally saved in the external storage medium. Note that if the registration data230with the same file name has already been stored in the external storage medium, it is overwritten.

This say, the user can save the registration data230stored in the flash ROM12to an external storage medium while maintaining the data type by using the saving function of the registration data230. As an example, the user can save the reference-type registration data230with a small data size in the external storage medium as it is. The saving function of the registration data230is useful when it is easier for the user to handle the registration data230while maintaining the data type thereof.

If the function detected in step S101is the function to load the registration data230(step S112: NO and step S114: YES), the processor10executes a load process of loading the registration data230stored in the external storage medium into the flash ROM12(step S115). The registration data230to be loaded and saved is, for example, the registration data230specified by the user's operation.

FIG.11is a subroutine showing the details of the load processing in step S115ofFIG.6. As shown inFIG.11, the processor10determines whether or not it is possible to access the storage source external storage medium normally (step S601). For example, if the external storage medium, which is the storage source, is not connected to the electronic musical instrument1, normal access cannot be performed. In this case (step S601: NO), the processor10displays an error message (step S602) and terminates the processing of the flowchart ofFIG.6.

If the storage source external storage medium can be normally accessed (step S601: YES), the processor10acquires the file name of the registration data230to be stored (step S603), and acquires the registration number in the flash ROM12, which is the save destination (step S604). The destination registration number may be a number designated by a user's operation, or may be a number automatically determined by the processor10.

The processor10saves the image file of the to-be-saved registration data230in the flash ROM12with the file name obtained in step S603as the registration data230having the registration number obtained in step S604(step S605).

If the free space in the flash ROM12is insufficient during writing to the flash ROM12, an error will occur. If such an error occurs (step S606: YES), the processor10displays an error message (step S607), cancels writing to the flash ROM12, and terminates the processing of the flowchart ofFIG.6. If no such error occurs (step S606: NO), the registration data230is normally stored in the flash ROM12. Here, the registration data230of the registration number of the save destination is overwritten.

By using the registration data230load function, the user can store the registration data230stored in the external storage medium in the flash ROM12while maintaining the data type. As an example, the user can store data-inclusion type registration data230in flash ROM12with its original data type. The function of loading the registration data230is useful when it is easier for the user to handle the registration data230while maintaining the data type thereof.

If the function detected in step S101is the automatic saving function of registration data230(step S114: NO and step S116: YES), the processor10executes an automatic save process of saving registration data230stored in flash ROM12to an external storage medium (step S117). The registration data230to be saved is, for example, the registration data230specified by the user's operation.

FIG.12is a subroutine showing the details of the automatic save processing in step S117ofFIG.6. Schematically, in response to a prescribed operation by the user (an operation of selecting the automatic saving function of the registration data230), the processor10converts a reference-type registration data230(first data) stored in the flash ROM12, which is an example of a storage unit, into a data inclusion type and stores it in an external storage medium.

Specifically, as shown inFIG.12, the processor10first determines whether or not the storage destination external storage medium can be normally accessed (step S701). If the storage destination external storage medium cannot be normally accessed (step S701: NO), the processor10displays an error message (step S702) and terminates the processing of the flowchart ofFIG.6.

If the storage destination external storage medium can be normally accessed (step S701: YES), the processor10acquires the file name (step S703) and the registration number (step S704) of the registration data230to be saved.

The processor10loads the image file of the registration data230indicated by the registration number acquired in step S704into the RAM11(step S705).

In the flowchart ofFIG.12, when the value L is set to 0, the processing target is layer1, when the value L is set to 1, the processing target is layer2, when the value L is set to 2, the processing target is layer3, and when the value L is set to 3, the processing target is layer4. The processor10executes the process of step S706for each of the layers1to4of the registration data230loaded into the RAM11.

Specifically, in step S706, the processor10determines whether or not the mode described in the common parameter area CPA for the layer being processed is the data inclusion type (step S706). If it is the data inclusion type (step S706: YES), the processor10does not change the layer. If it is not the data inclusion type (that is, a reference type) (step S706: NO), the processor10changes the layer being processed to the data inclusion type (step S707). Specifically, in S707, the processor10copies the tone data210indicated by the referenced tone number into the layer being processed, changes the value corresponding to this layer described in the tone directory area TDA (seeFIG.4; the value 0 indicates layer information, and the value other than 0 indicates the tone number) to 0, and sets the mode after the change (that is, the value 2 indicating the data inclusion type) in the common parameter area CPA. By executing this process, if the registration data230loaded into the RAM11is of a reference type, it is automatically converted to the all-inclusive type.

The processor10saves the thus processed registration data230loaded into the RAM11in the external storage medium under the file name obtained in step S703(step S708).

While writing to the external storage medium, an error will occur if there is insufficient free space on the external storage medium. If such an error occurs (step S709: YES), the processor10displays an error message (step S710), cancels writing to the external storage medium, and terminates the processing of the flowchart ofFIG.6. If no such error occurs (step S709: NO), the registration data230is normally saved in the external storage medium. Note that if the registration data230with the same file name has already been stored in the external storage medium, it is overwritten.

By using the automatic storage function of the registration data230, the user can automatically convert the reference-type (or mixed-type) registration data230stored in the flash ROM12into the all-inclusive registration data230that is excellent in terms of portability, and can save it in an external storage medium. For example, the user can use the registration data230in another electronic musical instrument simply by copying the all-inclusive registration data230saved in the external storage medium to another electronic musical instrument. The auto-save feature of registration data230is useful when all-inclusive registration data230is suitable to users.

The user can select either the saving function (seeFIG.10) or the automatic saving function (seeFIG.12) of the registration data230; that is whether to save the registration data230in the external storage medium while maintaining the data type, or to save it in the external storage medium after changing it to the all-inclusive type, if necessary. That is, the operation of selecting either the saving function or the automatic saving function of the registration data230is an operation that can be received by the selection operation receiving process100a. This is an example of an operation of selecting a particular data type from a plurality of the data types (i.e., data inclusion type, content-dependent reference type and content-guaranteed reference type) of the first data (registration data230).

If the function detected in step S101is the automatic loading function of the registration data230(step S116: NO and step S118: YES), the processor10executes an automatic load process of loading the registration data230stored in the external storage medium into the flash ROM12(step S119). The registration data230to be saved is, for example, the registration data230specified by the user's operation.

FIG.13is a subroutine showing the details of the automatic loading process in step S119ofFIG.6. Schematically, the processor10determines whether a tone data210(second data) in a registration data230(first data) stored in an external storage medium is stored in in flash ROM12, which is an example of a storage unit, and if the tone data210is stored in the flash ROM12, the data inclusion type registration data230in the external storage medium is converted to a reference type that refers to the tone data210stored in the flash ROM12.

Specifically, as shown inFIG.13, the processor10first determines whether or not it is possible to normally access the storage source external storage medium (step S801). If the storage source external storage medium cannot be normally accessed (step S801: NO), the processor10displays an error message (step S802) and terminates the processing of the flowchart ofFIG.6.

If the storage source external storage medium can be normally accessed (step S801: YES), the processor10acquires the file name of the registration data230to be saved (step S803), and acquires the destination registration number in the flash ROM12(step S804). The registration number of the save destination may be a number designated by a user's operation, or may be a number automatically determined by the processor10.

The processor10reads the registration data230of the file name acquired in step S803from the external storage medium and loads it into the RAM11(step S805).

The processor10executes the process of step S806for each of the layers1to4of the registration data230that has been loaded into the RAM11.

Specifically, in step S806, the processor10determines whether or not the mode described in the common parameter area CPA for the layer being processed is the data inclusion type (step S806). If it is the data inclusion type (step S806: YES), the processor10compares the tone physical data held by the layer being processed and each of the tone data210indicated by the tone numbers (value T=1 to 1,000) stored in the flash ROM12(step S807). If the content of the tone physical data held by the layer being processed matches the content of the tone data210that has been compared (step S808: YES), the processor10changes the layer being processed from the data inclusion type to the content-guarantee reference type (step S809). Specifically, in step S809, the processor10changes the mode of the layer being processed to the content-guaranteed reference type, describes, as the reference destination, the tone number indicating the tone data210whose contents match the layer being processed, and deletes the tone physical data of the layer being processed. Note that if the layer is not of the data inclusion type (that is, if it is of the reference type) (step S806: NO), the processor10does not change the layer being processed. Further, if there is no tone data210whose content matches (step S808: NO), the processor10does not change the layer being processed. By executing the above processing, the data inclusion type layer in the registration data230that has been loaded into the RAM11is automatically converted to the content-guaranteed reference type.

The processor10saves the registration data230loaded into the RAM11in the flash ROM12as the registration data230with the file name obtained in step S803and the registration number obtained in step S804(step S810).

If the free space in the flash ROM12is insufficient during writing to the flash ROM12, an error will occur. When such an error occurs (step S811: YES), the processor10displays an error message (step S812), cancels writing to the flash ROM12, and terminates the processing of the flowchart ofFIG.6. If no such error occurs (step S811: NO), the registration data230is stored in the flash ROM12. Note that the registration data230of the registration number of the save destination is overwritten.

By using the automatic loading function of the registration data230, the data inclusion type layers in the registration data230stored in the external storage medium are auto-converted to the data reference type with a small data size (the content-guaranteed reference type in this example), and then the converted registration data230is stored in the flash ROM12. Thereby, the registration data230is efficiently managed in the flash ROM12. Further, since it is the content-guaranteed reference type, an unintended change in tone color due to a change in the reference destination tone data210does not occur. The automatic loading function of the registration data230is useful when the reference-type registration data230is easy for the user to handle. Here, the automatic load function may automatically convert to the content-dependent reference type instead of the content-guaranteed reference type.

The user can select either the load function (seeFIG.11) or the automatic load function (seeFIG.13) for registration data230in saving the registration data230in the flash ROM12; i.e. whether to save it in the flash ROM12while maintaining the data type, or after changing it to the reference type if necessary. That is, the operation of selecting either the loading function or the automatic loading function of the registration data230is an operation that can be received by the selection operation receiving process100a, and is an example of an operation of selecting one data type from from a plurality of data types (that is, the data inclusion type, the content-dependent reference type, and the content-guaranteed reference type) of first data (registration data230)

If the function detected in step S101is the function of saving tone data210(step S120: YES), the processor10executes a saving process of saving tone data210stored in flash ROM12to an external storage medium. (Step S121). The tone data210to be saved is, for example, tone data210designated by a user's operation.

The processor10saves the image file of the tone data210to be saved in the external storage medium with the file name of the tone data210to be saved. Note that if the tone data210with the same file name has already been saved in the external storage medium, it will be overwritten. If the storage destination external storage medium is not connected to the electronic musical instrument1or the free space of the external storage medium is insufficient, the storage process in step S121ends with an error.

If the function detected in step S101is the function to load the tone data210(step S122: YES), the processor10executes a loading process of saving the tone data210saved in the external storage medium to the flash ROM12(step S123). The tone data210to be saved is, for example, tone data210designated by a user's operation.

Specifically, in step S123, the processor10saves the image file of the tone data210to be saved in the flash ROM12as the tone data210having the tone number designated by the user's operation or the like with the file name of the tone data210to be saved. Note that the tone data210of the tone number of the storage destination is overwritten. If, for example, the connection of the external storage medium to the electronic musical instrument1is cut during writing to the flash ROM12, the saving process in step S123ends with an error.

If the function detected in step S101is other than the functions described above, the processor10executes processing according to such a selected function (step S124), and terminates the processing of the flowchart ofFIG.6.

As described above, the present embodiment provides the electronic musical instrument1, the data processing method, and data processing program120executed by the processor10of the electronic musical instrument1, which is an example of a computer, which can facilitate handling of data having a hierarchical structure.

In the above embodiments, in the reference type, the tone data210stored in the flash ROM12is always set as a reference destination, but the configuration of the present disclosure is not limited to this. For example, when two mixed-type registration data230are loaded into the RAM11and these registration data230include reference-type layers that refer to a common tone data210, one registration data230may refer to the tone data210stored in the flash ROM12, and the other registration data230may refer to a corresponding layer in the one registration data referring to the same tone data210(i.e., a layer in said one registration data230loaded into RAM11).

In the above embodiment, the data processing program is stored in the flash ROM12, but the present disclosure is not limited to this; the data processing program may be stored in a removable storage medium such as a USB memory, CD, DVD, etc., or may be stored in a server. The electronic musical instrument1may acquire the data processing program from such a storage medium, or may acquire it from a server via a network.

In addition, the present invention is not limited to the above-described embodiments, and can be variously modified in the implementation stage without departing from the gist of the present invention. Also, the functions executed in the above-described embodiments may be combined as appropriate as possible. Various steps are included in the above-described embodiments, and various inventions can be extracted by appropriately combining the disclosed multiple constituent elements. For example, even if some constituent elements are deleted from all the constituent elements shown in the embodiments, if an effect can be obtained, a configuration in which these constituent elements are deleted can be extracted as an invention. It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention cover modifications and variations that come within the scope of the appended claims and their equivalents. In particular, it is explicitly contemplated that any part or whole of any two or more of the embodiments and their modifications described above can be combined and regarded within the scope of the present invention.