Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transpose by semitone? #5

Open
chrisspen opened this issue Jun 3, 2021 · 5 comments
Open

Transpose by semitone? #5

chrisspen opened this issue Jun 3, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@chrisspen
Copy link

Is there anyway to transpose by just a semitone and not an entire step?

Currently, calling up(1) on a C gives you a D and not a C#.

I tried calling up(0.5) but that seems to round up to up(1).

@lets00
Copy link
Member

lets00 commented Jun 3, 2021

I've added support to transpose semitones. Now when you call

...
abc-transpose.up(abcfile, 1)

It will transpose 1 semitone. To transpose 1 tone, you must call up(2).

@lets00 lets00 added the bug Something isn't working label Jun 3, 2021
@lets00 lets00 closed this as completed Jun 3, 2021
@chrisspen
Copy link
Author

Awesome. Thanks.

@chrisspen
Copy link
Author

chrisspen commented Jun 4, 2021

Actually, I think this has introduced a bug.

For the abc:

X:1
M:C
K:A
L:1/8
c2 c2 d2 e2|e2 d2 c2 B2|A2 A2 B2 c2|c3 B B4

if I transpose this up(1), it changes the duration of several notes to:

X:1
M:C
K:A#
L:1/8
c^2 c^2 d^2 f2|f2 d^2 c^2 c2|A^2 A^2 c2 c^2|c^3 c c4

Notice the c2 notes are now c notes. I think you're trying to add the sharp ^ symbol to the note, but it has to go before the note letter, not between the note letter and duration number.

I'm not sure how this effects the key, but that also might be wrong. If I manually fix the sharp symbols, then I get:

X:1
M:C
K:A#
L:1/8
^c2 ^c2 ^d2 f2|f2 ^d2 ^c2 c2|^A2 ^A2 c2 ^c2|^c3 c c4

However, that doesn't sound right.

@lets00 lets00 reopened this Jun 4, 2021
@lets00
Copy link
Member

lets00 commented Jun 4, 2021

Hmm, I got confused and changed the sharp symbol after a note (when the correct is before). I'll fix it.

@Askaholic
Copy link

I'm not sure how this effects the key, but that also might be wrong. If I manually fix the sharp symbols, then I get:

X:1
M:C
K:A#
L:1/8
^c2 ^c2 ^d2 f2|f2 ^d2 ^c2 c2|^A2 ^A2 c2 ^c2|^c3 c c4

However, that doesn't sound right.

A# isn't really a key that you would naturally write in as it would require the key signature to have double sharps. What you would really expect is for the output to be in Bb. It should look like this:

X:1
M:C
K:Bb
L:1/8
d2 d2 e2 f2|f2 e2 d2 c2|B2 B2 c2 d2|d3 c c4

However, there are a few situations in which there is a choice of which key the output could reasonably be notated in. In particular for the keys of Cb/B, Gb/F#, and Db/C#.

An interface like this might work nicely:

abc-transpose.to_key(abcfile, "Bb")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants