Code Monkey home page Code Monkey logo

Comments (3)

pedrozath avatar pedrozath commented on August 23, 2024

Hey thanks! ๐Ÿ™๐Ÿป

So I wonโ€™t say I was totally unaware about the fact thereโ€™s a convention for when to use sharps or flats. But the logic of whether to use one or the other still escapes from my knowledge.

But we definitely have to fix that. Iโ€™m positive there must be a way choose which note to show regardless if they are the same pitch. Even if we hardcode at some point.

Could you share me some knowledge on whether do we use sharps or flats? How does that work?

from coltrane.

turboladen avatar turboladen commented on August 23, 2024

How does that work?

Generally, it's based off the key/scale you're talking about--some keys are always denoted in flats, others in sharps. I forget the exact rule, but I think the general rule of thumb is that you use the whichever (flats vs sharps) that would result in the reader having to read the least amount of those marks. Further, when writing something that uses flats to denote its key, on a staff you always notate the flats in the following order: B, E, A, D, G, C, F; when writing in a key that uses sharps, you always notate them in order: F, C, G, D, A, E, B.

For example, F# major and Gb major get you playing the same notes, but some may prefer one of the other when notating or playing.

So maybe in code you could make some association to a key (ex C major) to an object that captures the flats/sharps associated with it, then if you see sharps, you can display accordingly? I have to run now, but maybe I peek at the code later.

from coltrane.

pedrozath avatar pedrozath commented on August 23, 2024

Solved by 687200b

from coltrane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.