Giter Club home page Giter Club logo

Comments (7)

danigb avatar danigb commented on July 16, 2024

Hi @wildcat510

Thanks for reporting! 👍

But, as far as I know, this is the expected output. For example, "D2" transposed by a "7M" is "C#3"... The same can be applied to "E2" transposed by a "6M" or a "7M". In fact, "E2 major" is exactly the scale you obtained.

Am I missing something?

Regards,
Dani

from tonal.

heyaphra avatar heyaphra commented on July 16, 2024

A major 7th above D2 is C#2 in the same register— otherwise, we would be missing an entire note from the first octave of the scale. C major is correct because a major 7th above C2 is B2 in the same octave. If I'm transposing a C scale (or any scale) in octave register 2 to another key, the whole scale should stay in the same octave register unless I'm using the wrong method for transposing keys. All scales should be played linearly, steps 1 through 7, not steps 1-6 and then 7 an octave higher, or 1-5 with 6 and 7 and octave higher as this leaves the scale registers disjointed and incomplete. After all, in common practice scales are played 1-2-3-4-5-6-7 in the same octave. If you want supporting audio to demonstrate I can provide.

So just like myscale.map(Tonal.transpose('C2')); produces ["C2", "D2", "E2", "F2", "G2", "A2", "B2"], a uniform linear scale played from scale degree 1 to 7, I would expect the same of other keys.

Unless I'm missing something. Is this the right way to go about transposing scales as an entire unit to a different key?

from tonal.

mrjacobbloom avatar mrjacobbloom commented on July 16, 2024

The cutoff for register number is always C no matter what key you're in. C# above D2 is higher than the C that follows D2 so it's in the 3rd register. C#2 is the note below D2

from tonal.

heyaphra avatar heyaphra commented on July 16, 2024

So is there any way I can have scales in keys other than C laid out in a register theoretically consistent with the same way a musician would notate and play it? What is the reason for the cutoff at C if it produces scales inconsistent with common practice?

from tonal.

danigb avatar danigb commented on July 16, 2024

Hi!

Yes, I think @mrjacobbloom is right here. In western music theory we use always C as the cutoff registry.

Another way to think about it is using interval sizes. For example, 7M is 11 semitones up. That's exactly the distance from D2 to C#3 (and the distance from D2 to C#2 is 1 semitone down).

I don't understand very well your explanation, @wildcat510 but It would help to have some external references or resources.

Anyway, you can always use pitch classes (note names without octave number) to avoid this problem:

["1P", "2M", "3M", "4P", "5P", "6M", "7M"].map(Tonal.transpose("D")) // => ["D", "E", "F#", "G", "A", "B", "C#"]

And you can use Tonal.Note.props to coerce to an octave: scale.map(note => Tonal.Note.props({ oct: 2 }, note)) or, if you are sure they are all pitch classes, a simple string concatenation: scale.map(note => note + "2")

Hope it helps
Regards
Dani

from tonal.

heyaphra avatar heyaphra commented on July 16, 2024

Looks like I misunderstood the transpose function's application. Concatenating pitch classes works.
Thanks guys!
-Nate

from tonal.

danigb avatar danigb commented on July 16, 2024

Great! I'm going to close this issue, but feel free to reopen if something is not clear.

from tonal.

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.