-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9d8fad
commit ac766d2
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Canon in DDDDDDDDDD | ||
|
||
Gives maximum `D` to your music – this python program finds all occurences of the `D` note in your music sheet, and applies `B i g D` to jam in as many `D` semiquavers as possible! | ||
|
||
Canon in D, before `B i g D`: | ||
|
||
 | ||
|
||
After `B i g D`: | ||
|
||
 | ||
|
||
Johann Pachelbel would be proud. [MuseScore Demo here for listening](https://musescore.com/user/14865386/scores/5745835) | ||
|
||
## Usage: | ||
|
||
Install dependency: | ||
|
||
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Big D a music score in MusicXML format: | ||
|
||
``` | ||
python canon.py input.musicxml destination.musicxml | ||
``` | ||
|
||
Big * a music score with other notes: | ||
|
||
``` | ||
python canon.py input.musicxml dest.musicxml --note A | ||
``` | ||
|
||
This will spam AAAAAAAAAA instead of DDDDDDDDDD inside your music score. | ||
|
||
## Features | ||
|
||
- Big D | ||
- Works on both treble and bass clef | ||
- Very Big D | ||
- It sounds nicer | ||
- Can also do big F | ||
|
||
## Limitations | ||
|
||
- You might get a warning when opening the result MusicXML file in MuseScore, but it should work out fine. Lowly mortal programs cannot handle the amount of `B i g D` in our school's curriculum. | ||
- Titles and other cosmetic items, including some dynamics, in the MusicXML file are stripped after processing. | ||
- Your orchestra will not play this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import argparse | ||
import partitura | ||
import copy | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('in', help="Input musicxml file") | ||
parser.add_argument('out', help="Destination file") | ||
parser.add_argument('--note', help='Change the note to replicate') | ||
args = parser.parse_args() | ||
|
||
score = partitura.load_musicxml(getattr(args, "in")) | ||
|
||
to_purge = [] | ||
added_notes = [] | ||
|
||
for note in score.timeline.iter_all(partitura.score.Note, include_subclasses=True): | ||
if note.step == "D" and note not in added_notes and note.duration > 1: | ||
containing_timepoint = next(iter([point for point in score.timeline.points if note in point.starting_objects[partitura.score.Note]])) | ||
for i in range(0, note.duration): | ||
new_d = copy.copy(note) | ||
new_d._sym_dur = None | ||
new_d.start = score.timeline.get_or_add_point(note.start.t + i) | ||
new_d.end = score.timeline.get_or_add_point(new_d.start.t + 1) | ||
score.timeline.add(new_d, containing_timepoint.t + i, containing_timepoint.t + i + 1) | ||
to_purge.append(note) | ||
added_notes.append(new_d) | ||
|
||
for note in to_purge: | ||
score.timeline.remove(note) | ||
|
||
f = open(args.out, "wb") | ||
partitura.save_musicxml(score, f) | ||
f.close() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.