EDITING OF MIDI FILES
20220059064 · 2022-02-24
Inventors
Cpc classification
G10H1/0025
PHYSICS
G10H2220/126
PHYSICS
International classification
Abstract
A system is provided for editing an audio file. The system displays, on an electronic device, a piano roll. The system receives a user input to cut a segment of the piano roll. The segment of the piano roll includes a respective tone that extends across both sides of the segment of the piano roll, such that the respective tone includes: a first portion of the respective tone that precedes the segment of the piano roll; and a second portion of the respective tone that follows the segment of the piano roll. In response to the user input to cut the segment of the piano roll, the system cuts the segment from the piano roll and, without user intervention, concatenate the first portion of the respective tone with the second portion of the respective tone.
Claims
1. (canceled)
2. A method, comprising: displaying, on an electronic device, a piano roll; receiving a user input to cut a segment of the piano roll, wherein the segment of the piano roll includes a respective tone that extends across both sides of the segment of the piano roll, such that the respective tone includes: a first portion of the respective tone that precedes the segment of the piano roll; and a second portion of the respective tone that follows the segment of the piano roll; in response to the user input to cut the segment of the piano roll: cutting the segment from the piano roll; and without user intervention, concatenating the first portion of the respective tone with the second portion of the respective tone.
3. The method of claim 2, wherein the piano roll corresponds to an audio file in a Musical Instrument Digital Interface, MIDI, file format.
4. The method of claim 2, wherein cutting the segment from the piano roll comprises cutting the segment from a first position in the piano roll, and the method further comprises, after cutting the segment from the first position in piano roll, inserting the segment at a second position in the piano roll, distinct from the first position.
5. The method of claim 4, wherein inserting the segment at the second position in the piano roll interrupts a tone into a first tone fragment that precedes the segment at the second position and a second tone fragment that follows the segment at the second position.
6. The method of claim 5, further comprising, at the second position in the piano roll, determining whether the respective tone of the segment matches the first tone fragment that precedes the segment at the second position.
7. The method of claim 6, further comprising, in accordance with a determination that the first tone fragment matches the respective tone, concatenating the first tone fragment with the respective tone.
8. The method of claim 6, further comprising, in accordance with a determination that the first tone fragment does not match the respective tone: in accordance with a determination that the first tone fragment is less than a predefined length, concatenating the first tone fragment with the second tone fragment that follows the segment at the second position.
9. A system for editing an audio file, the audio file comprising information about a time stream having a plurality of tones extending over time in said time stream, the system comprising: one or more processors; and memory storing one or more programs, the one or more programs including instructions, which, when executed by the one or more processors, cause the one or more processors to perform a set of operations, including: displaying, on an electronic device, a piano roll; receiving a user input to cut a segment of the piano roll, wherein the segment of the piano roll includes a respective tone that extends across both sides of the segment of the piano roll, such that the respective tone includes: a first portion of the respective tone that precedes the segment of the piano roll; and a second portion of the respective tone that follows the segment of the piano roll; in response to the user input to cut the segment of the piano roll: cutting the segment from the piano roll; and without user intervention, concatenating the first portion of the respective tone with the second portion of the respective tone.
10. The system of claim 9, wherein the piano roll corresponds to an audio file in a Musical Instrument Digital Interface, MIDI, file format.
11. The system of claim 9, wherein cutting the segment from the piano roll comprises cutting the segment from a first position in the piano roll, and the one or more programs further include instructions for, after cutting the segment from the first position in piano roll, inserting the segment at a second position in the piano roll, distinct from the first position.
12. The system of claim 11, wherein inserting the segment at the second position in the piano roll interrupts a tone into a first tone fragment that precedes the segment at the second position and a second tone fragment that follows the segment at the second position.
13. The system of claim 12, wherein the one or more programs further include instructions for, at the second position in the piano roll, determining whether the respective tone of the segment matches the first tone fragment that precedes the segment at the second position.
14. The system of claim 13, wherein the one or more programs further include instructions for, in accordance with a determination that the first tone fragment matches the respective tone, concatenating the first tone fragment with the respective tone.
15. The system of claim 13, wherein the one or more programs further include instructions for, in accordance with a determination that the first tone fragment does not match the respective tone: in accordance with a determination that the first tone fragment is less than a predefined length, concatenating the first tone fragment with the second tone fragment that follows the segment at the second position.
16. A non-transitory computer-readable storage medium storing one or more programs for editing an audio file, the audio file comprising information about a time stream having a plurality of tones extending over time in said time stream, wherein the one or more programs include instructions, which, when executed by a system with one or more processors, cause the system to perform a set of operations, including: displaying, on an electronic device, a piano roll; receiving a user input to cut a segment of the piano roll, wherein the segment of the piano roll includes a respective tone that extends across both sides of the segment of the piano roll, such that the respective tone includes: a first portion of the respective tone that precedes the segment of the piano roll; and a second portion of the respective tone that follows the segment of the piano roll; in response to the user input to cut the segment of the piano roll: cutting the segment from the piano roll; and without user intervention, concatenating the first portion of the respective tone with the second portion of the respective tone.
17. The non-transitory computer-readable storage medium of claim 16, wherein the piano roll corresponds to an audio file in a Musical Instrument Digital Interface, MIDI, file format.
18. The non-transitory computer-readable storage medium of claim 16, wherein cutting the segment from the piano roll comprises cutting the segment from a first position in the piano roll, and the one or more programs further include instructions for, after cutting the segment from the first position in piano roll, inserting the segment at a second position in the piano roll, distinct from the first position.
19. The non-transitory computer-readable storage medium of claim 18, wherein inserting the segment at the second position in the piano roll interrupts a tone into a first tone fragment that precedes the segment at the second position and a second tone fragment that follows the segment at the second position.
20. The non-transitory computer-readable storage medium of claim 19, wherein the one or more programs further include instructions for, at the second position in the piano roll, determining whether the respective tone of the segment matches the first tone fragment that precedes the segment at the second position.
21. The non-transitory computer-readable storage medium of claim 19, wherein the one or more programs further include instructions for, in accordance with a determination that the first tone fragment matches the respective tone, concatenating the first tone fragment with the respective tone.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Embodiments will be described, by way of example, with reference to the accompanying drawings, in which:
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
DETAILED DESCRIPTION
[0027] Embodiments will now be described more fully hereinafter with reference to the accompanying drawings, in which certain embodiments are shown. However, other embodiments in many different forms are possible within the scope of the present disclosure. Rather, the following embodiments are provided by way of example so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art. Like numbers refer to like elements throughout the description.
[0028] Herein, the problem of editing non-quantized, metrical musical sequences represented as e.g. MIDI files is discussed. A number of problems caused by the use of naive edition operations applied to performance data are presented using a motivating example of
[0029]
[0030] An edit operation is illustrated, in which two beats of a measure, between a first time point t.sub.A and a second time point t.sub.B (illustrated by dashed lines in the figure) are cut out and inserted in a later measure of the stream, in a cut a third time point t.sub.C. To perform the edit operation, three cuts A, B and C are made at the first, second and third time points t.sub.A, t.sub.B and t.sub.C, respectively. The first cut A produces a first left cutting end A.sub.L and a first right cutting end A.sub.R. The second cut B produces a second left cutting end B.sub.L and a second right cutting end B.sub.R. The third cut C produces a third left cutting end C.sub.L and a third right cutting end C.sub.R.
[0031]
[0032] In
[0033] In the stream S of
[0034]
[0035] Cut, copy, and paste operations may be performed using two basic primitives: split and concatenate. The split primitive is used to separate an audio stream S (or MIDI file) at a specified temporal position, e.g. time point t.sub.A, yielding two streams (see e.g. streams S1 and S2 of
[0036] 1. Cut sequence S at time point t.sub.B, which returns streams S1 and S2.
[0037] 2. Cut the second sequence S2 at time point t.sub.A, which returns streams S3 and S4, S4 corresponding to the section between time points t.sub.A and t.sub.B.
[0038] 3. Store sequence S4 to a digital clipboard.
[0039] 4. Return the concatenation of S3 and S2.
[0040] Similarly, to insert a stream, e.g. stored stream S4 (as above), in a stream S at time point t.sub.C, one may:
[0041] 1. Cut the stream S at time point t.sub.C, producing two streams S1 (duration of S prior to t.sub.C) and S2 (duration of S after t.sub.C), not identical to S1 and S2 discussed above.
[0042] 2. Return the concatenation of S1, S4, and S2, in this order.
[0043]
[0044] In the first case, none of the first and second tones T1 and T2 extend to the cut A, resulting in both left and right memory cells being empty, indicated as (0,0).
[0045] In the second case, the first tone T1 touches the left cutting end A.sub.L, resulting in information about said first tone T1 being stored in the left memory cell as (12,0) indicating that the first tone extends 12 units of time to the left of the cut A but no time unit to the right of the cut A. None of the first and second tones T1 and T2 extends to the right cutting end A.sub.R (i.e. none of the tones extends to the cut A from the right of the cut), why the right memory cell is empty.
[0046] Conversely, in the third case, the second tone T2 touches the right cutting end A.sub.R, resulting in information about said second tone T2 being stored in the right memory cell as (0,5) indicating that the second tone extends 5 units of time to the right of the cut A but no time unit to the left of the cut A. None of the first and second tones T1 and T2 extends to the left cutting end A.sub.L (i.e. none of the tones extends to the cut A from the left of the cut), why the left memory cell is empty.
[0047] In the fourth case, both of the first and second tones T1 and T2 touch respective cutting ends A.sub.L and A.sub.R (i.e. both tones ends at t.sub.A, without overlapping in time). Thus, information about the first tone T1 is stored in the left memory cell as (12,0) indicating that the first tone extends 12 units of time to the left of the cut A but no time unit to the right of the cut A, and information about the second tone T2 is stored in the right memory cell as (0,5) indicating that the second tone extends 5 units of time to the right of the cut A but no time unit to the left of the cut A.
[0048] In the fifth case, a single (first) tone T1 is shown extending across the cutting time t.sub.A and thus being divided in two parts by the cut A. Thus, information about the first tone T1 is stored in the left memory cell as (5,12) indicating that the first tone extends 5 units of time to the left of the cut A and 12 time units to the right of the cut A, and information about the same first tone T1 is stored in the right memory cell, also as (5,12) indicating that the first tone extends 5 units of time to the left of the cut A and 12 time units to the right of the cut A.
[0049] As discussed herein, the information stored in the respective memory cells may be used for determining how to handle the tones extending to the cut A when concatenating either of the left and right cutting ends with another cutting end (of the same stream S or of another stream). In accordance with embodiments of the present disclosure, a tone extending to a cutting end can, after concatenating with another cutting end, be adjusted based on the information about the tone stored in the memory cell of the cutting end.
[0050] Examples of such adjusting includes: [0051] Removing a fragment of the tone, e.g. if the tone extending to the cutting edge after the cut has been made has a duration which is below a predetermined threshold or has a duration which is less than a predetermined percentage of the original tone (cf. the fragments marked in
[0054] Regarding removal of fragments, in some embodiments, two different duration thresholds may be used, e.g. an upper threshold and a lower threshold. In that case, if the duration of a part of a tone T which is created after making a cut A is below the lower threshold, the part is regarded as a fragment and removed from the audio stream, regardless of its percentage of the original tone duration. On the other hand, if the duration of the part of the tone T which is created after making a cut A is above the upper threshold, the part is kept in the audio stream, regardless of its percentage of the original tone duration. However, if the duration of the part of the tone T which is created after making a cut A is between the upper and lower duration thresholds, whether it is kept or removed may depend on its percentage of the original tone duration, e.g. whether it is above or below a percentage threshold. This may be used e.g. to avoid removal of long tone parts just because they are below a percentage threshold.
[0055]
[0056] In
[0057] In
[0058] In
[0059]
[0060]
[0061]
[0062] In some embodiments of the present disclosure, the audio file 10 is in accordance with a MIDI file format, which is a well-known editable audio format.
[0063] In some embodiments of the present disclosure, the further cutting end B.sub.R or C.sub.R, or B.sub.L or C.sub.L is from the same time stream S as the first cutting end A.sub.L or A.sub.R, e.g. when cutting and pasting within the same stream S. In some embodiments, the further cutting end is a second left or right cutting end B.sub.L or B.sub.R, or C.sub.L or C.sub.R of a second cut B or C produced by cutting the stream S at a second time point t.sub.B or t.sub.C in the stream. In some embodiments, the at least one of the first cutting ends is the first left cutting edge A.sub.L and the further cutting end is the second right cutting edge B.sub.R or C.sub.R.
[0064] In some other embodiments of the present disclosure, the further cutting end B.sub.R or C.sub.R, or B.sub.L or C.sub.L is from another time stream than the time stream S of the first cutting end A.sub.L or A.sub.R, e.g. when cutting from one stream and inserting in another stream.
[0065] In some embodiments of the present disclosure, the adjusting comprises any of: removing a fragment of a tone T; extending a tone over the cutting ends A.sub.L or A.sub.R; and B.sub.R or C.sub.R, or B.sub.L or C.sub.L; and merging a tone extending to the first cutting end A.sub.L or A.sub.R with a tone extending to the further cutting end B.sub.R or C.sub.R, or B.sub.L or C.sub.L (e.g. handling splits and quantized issues).
[0066] Embodiments of the present disclosure may be conveniently implemented using one or more conventional general purpose or specialized digital computer, computing device, machine, or microprocessor, including one or more processors, memory and/or computer readable storage media programmed according to the teachings of the present disclosure. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art.
[0067] In some embodiments, the present disclosure provides a computer program product 3 which is a non-transitory storage medium or computer readable medium (media) having instructions 4 stored thereon/in, in the form of computer-executable components or software (SW), which can be used to program a computer 1 to perform any of the methods/processes of the present disclosure. Examples of the storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
[0068] According to a more general aspect of the present disclosure, there is provided a method of editing an audio stream (S) having at least one tone T extending over time in said stream. The method comprises cutting M1 the stream at a first time point to of the stream, producing a first cut A having a left cutting end A.sub.L and a right cutting end A.sub.R. The method also comprises allocating M2 a respective memory cell 5 to each of the cutting ends. The method also comprises, in each of the memory cells, storing M3 information about the tone T. The method also comprises, for one of the cutting ends A.sub.L or A.sub.R, concatenating M4 the cutting end with a further cutting end B.sub.R or C.sub.R, or B.sub.L or C.sub.L which also has an allocated memory cell 5 with information stored therein about any tones T extending to said further cutting end. The concatenating M4 comprises using the information stored in the memory cells 5 for adjusting any of the tones T extending to the cutting ends A.sub.L or A.sub.R, and B.sub.R or C.sub.R or B.sub.L or C.sub.L.
[0069] The present disclosure has mainly been described above with reference to a few embodiments. However, as is readily appreciated by a person skilled in the art, other embodiments than the ones disclosed above are equally possible within the scope of the present disclosure, as defined by the appended claims.