-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add musical symbols for unicode completions #54182
Conversation
I am fine with this PR being merged, but I think we need to consider the original meaning of the completion. julia> \two # TAB
\twocaps \twocups \twoheaddownarrow
\twoheadleftarrow \twoheadleftarrowtail \twoheadleftdbkarrow
\twoheadmapsfrom \twoheadmapsto \twoheadrightarrow
\twoheadrightarrowtail \twoheaduparrow \twoheaduparrowcircle
\twonotes Wouldn't it be better to extend what is used in a particular field with a particular package? |
Agree. My question is, is it possible to extend Unicode completion using a third party package? |
I believe you got the solution. Something like: module MusicalSymbolCompletions
import REPL
function __init__()
isdefined(REPL, :REPLCompletions) || return
isdefined(REPL.REPLCompletions, :latex_symbols) || return
REPL.REPLCompletions.latex_symbols["\\dflat"] = "𝄫"
end
end |
Nice! I will respect the maintainer's decision whether or not to merge this pull request. Or just pick a few to merge. Feel free to merge or close this pull request. |
It's cool that Unicode has all of these symbols, but if we want to add some more to base (not to a package) perhaps we should limit the additions to a few of the most common and well-known symbols. |
I don't love that we have our own custom mapping from strings to unicode characters. It is not friendly to users who switch between Julia and other programs that define similar though not identical mappings. Given that we do have this mapping, I think we should
|
Strongly agree, unicode completions in the REPL should be representative and reduce uncommon symbols. I have removed Mensural notation and Gregorian notation because they are rarely used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cross checked this PR (at a3ad268) against https://www.unicode.org/charts/nameslist/c_1D100.html and found no typos or mistranscriptions.
One inconsistency is musicalbreve
vs musicbrace
/musicbracket
. We should use a single prefix: either music or musical, I don't have much preference for which. Music is shorter, and this is for user input type once read never. Musical is the term unicode uses.
Some additional characters that may warrant the music(al) prefix:
"\\tr"=>"𝆖",
"\\turn"=>"𝆗",
"\\invertedturn"=>"𝆘",
"\\turnslash"=>"𝆙",
That said, I couldn't (after a brief search) find any other unicode characters that could plausibly be called "tr" or "turn" (with the possible exception of "turnstyle" ⊢.
I have added "music" prefix for these symbols. Another change is barline: # Bars
"\\musicsinglebarline"=>"𝄀",
"\\musicdoublebarline"=>"𝄁",
"\\musicfinalbarline"=>"𝄂",
"\\musicreversefinalbarline"=>"𝄃", I think these symbols may easily confuse users, and it must be noted that they are symbols specifically representing musical notation, so I add "music“ prefix |
change naming Co-authored-by: Lilith Orion Hafner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
In consideration of the controversy, I once again removed some symbols that were difficult to read or confusing. Only key symbols such as Accidentals, Codas, Clefs, Rests, Notes are retained. |
@topolarity, does this seem reasonable to you in its current state? |
Maybe this is worth sending to triage for more feedback? I'm significantly happier with the latest version, but many glyphs are still difficult to read/distinguish and I think this is something of a departure from the conventions for Unicode completions so far (which are mostly math symbols/letters, exponents, etc.) |
As Julia's usage extends outside of math, IMO it makes sense to expand Unicode completions. |
We have all the emoji, too… I'm inclined to be permissive with any symbol that a large number of people might reasonably recognize and use (excluding language-specific symbols that have their own input methods already), and the common music symbols certainly qualify. |
Considering that REPL Unicode completion can be extended through third-party packages, I'm actually neutral on whether this PR will be merged or not. If adding a lot of music symbols is considered too radical, I think it would be acceptable to just add Accidental to provide basic support for MusicTheory.jl. But I still believe that other musical Unicode symbols can bring potential benefits. |
@tecosaur has a link to a latex symbol table that might have some of these. Barring external, conflicting, canonical names for these symbols, triage is happy with this. In general, this sort of addition is perfectly fine/good. |
Chapter 7 of https://ctan.org/pkg/comprehensive lists some (all?) latex musical symbols defined across 12 distinct packages with distinct naming conventions. Some arbitrarily chosen examples: \musDoubleFlat \musEighth \bassclef (not fclef) \wholeNote Seems eclectic and not possible to follow sensibly. I'm going to go ahead and merge soon unless anyone thinks there's a problem with this PR in it's current state. |
Regarding chapter 7 of The LaTeX comprehensive symbols list, it's inconsistent across packages, but the package I think would be worth using as a reference would be lillyglyphs. Your names are mostly consistent with lillyglyphs, but there are a few differences that I think may be worth drawing attention to:
Other than these comments, this PR looks good to me 🙂. Thanks for making it! |
Thank you very much for the review and provided a very good reference, but I don't quite agree with the naming of lillyglyphs.
I think
Same, I think it's important to be consistent with spoken language. I guess no one will call this "flat flat", in reality we would just call it "double flat". |
I think the naming of Notes and Rests is still worth discussing, my current naming is to be consistent with the existing
I find a better naming in SMuFL "\\rest8th"=>"𝄾",
"\\rest16th"=>"𝄿",
"\\rest32th"=>"𝅀",
"\\rest64th"=>"𝅁",
"\\rest128th"=>"𝅂", Obviously SMuFL's naming is more readable, but would be inconsistent with existing naming if adopted. |
Maybe? # Music Symbols - Rests
"\\multirest" => "𝄺",
"\\wholerest" => "𝄻",
"\\halfrest" => "𝄼",
"\\rest4th" => "𝄽",
"\\rest8th" => "𝄾",
"\\rest16th" => "𝄿",
"\\rest32th" => "𝅀",
"\\rest64th" => "𝅁",
"\\rest128th" => "𝅂",
# Music Symbols - Notes
"\\musicbreve" => "𝅜",
"\\wholenote" => "𝅝",
"\\halfnote" => "𝅗𝅥",
"\\note4th" => "𝅘𝅥", #U+1D15F
"\\note8th" => "𝅘𝅥𝅮", #U+1D160
"\\note16th" => "𝅘𝅥𝅯",
"\\note32th" => "𝅘𝅥𝅰",
"\\note64th" => "𝅘𝅥𝅱",
"\\note128th" => "𝅘𝅥𝅲", In this way, newly added Musical Symbols can remain compatible with existing Miscellaneous Symbols. "\\quarternote" => "♩", #U+2669
"\\eighthnote" => "♪", #U+266A |
The advantage of putting |
Thanks for reminding me! I didn't notice that Unicode completion only starts from the beginning of the string! |
Any more comments for this PR?... |
Looks good to me! I still think it would be nice to have a few note names like |
Thanks for the contribution! |
I found that julia was missing some useful music notation unicode completions and sometimes [had to copy and paste these unicodes to use the published package](JuliaMusic/MusicTheory.jl#27). So I picked out some unicode music symbols that might be useful, named from the [unicode standard](https://www.unicode.org/charts/PDF/U1D100.pdf). I didn't add the test, I don't think it's necessary. Thanks for reviewing. Please reply if any changes are needed. --------- Co-authored-by: Lilith Orion Hafner <[email protected]>
I found that julia was missing some useful music notation unicode completions and sometimes [had to copy and paste these unicodes to use the published package](JuliaMusic/MusicTheory.jl#27). So I picked out some unicode music symbols that might be useful, named from the [unicode standard](https://www.unicode.org/charts/PDF/U1D100.pdf). I didn't add the test, I don't think it's necessary. Thanks for reviewing. Please reply if any changes are needed. --------- Co-authored-by: Lilith Orion Hafner <[email protected]>
I found that julia was missing some useful music notation unicode completions and sometimes had to copy and paste these unicodes to use the published package.
So I picked out some unicode music symbols that might be useful, named from the unicode standard.
I didn't add the test, I don't think it's necessary.
Thanks for reviewing. Please reply if any changes are needed.