Comments (8)
@danigb maybe adding a scaleType chroma (based on the intervals) in addition to a scale chroma (based on the actual pitch classes) would be a solution.
from tonal.
Hello!
Yes, there are an inconsistency between how chrome is used. Basically the "chroma" for scales are always "interval based", and that means that ALWAYS the first interval will be 1P and therefor the leftmost number of the chroma will be 1.
I know this is confusing. That's a consequence of using string for chroma instead of more specific data structure. I'll try to find a solution or mitigation.
from tonal.
Ah! now I understand!
I thought that the normalised representation could be based on the intervals (or each scale shifted to C as root note). But I guess it depends on the use case to see what makes more sense. Anyway, thank you for the explanation!
PS: I think it's a really cool idea to use a bitmask as datastructure for scale notes.
from tonal.
Hey, I just came across this too and am wrapping my head around it. Am I understanding correctly?
- scales and chords: "chroma" is rotated so that the leftmost bit is in root position. It represents the scale/chord shape relative to the root.
- pcSet: "chroma" bits correspond to pitch classes themselves, so the leftmost bit is always C.
- both cases: "normalized" is the maximized representation of the associated bitset.
In my projects I've been referring to the bitset left-aligned to the root as the "shape". Maybe it'd make sense to have four properties:
chroma
normalizedChroma
shape
normalizedShape
This way scale and chord info objects could carry info about both.
from tonal.
Hi @micahscopes, the chroma for scales (and I guess chords as well) are based on intervals, not on the chroma/pitch-class.
An interval set for any scale always starts on 1P, therefore they don't have to be rotated to have a "1" at the first position.
So for example the C-Pentatonic:
intervals: ["1P", "2M", "3M", "5P", "6M"],
chroma: "101010010100"
from tonal.
@ohmycode I think we are getting at the same thing? I don't mean that under the hood there is a literal rotation of the chroma somewhere in the code (maybe there is, maybe not)... just that starting with the pitchclass-chroma of a given scale and rotating so that the tonic is at the left-most bit would give the same result as building off of the intervals directly.
from tonal.
@micahscopes yeah, you're right, that should result in the same pattern. And that is my initial point:
that means, all 12 scales of the same scale type will all have the same chroma, which makes me wonder what normalized
could be used for, apart of generating a setNum
integer.
from tonal.
makes me wonder what normalized could be used for
@ohmycode Basically is a way to detect modes (aka: rotations). For example, major and dorian shares the same "shape" but rotated: they have the same normalized chroma.
scaleChroma (or pitch class chroma) vs scaleTypeChroma (or intervals chroma) maybe are good starting point... 🤔
@micahscopes If I understand correctly, chroma
and shape
are the same as pitch class chroma and interval chroma, right? The normalized chroma is a different thing: is an arbitrary way to select only one chroma from all posible rotations.
from tonal.
Related Issues (20)
- tonaljs/key melodic minor chord HOT 3
- How to transpose note along scale based on interval (across octaves)? HOT 1
- Scale.detect() is producing incorrect results when using a tonic outside the list of provided notes HOT 1
- Chord.get cannot parse `G6add9` HOT 8
- `Scale.scaleNotes` returns an array instead of a pcset. HOT 2
- Cannot import into React Native Expo app HOT 1
- Can create localization? HOT 2
- Importing Mode from mode module call back error in browser environment HOT 1
- Natural notes (sign) HOT 2
- Missing import "Named" when using with Angular HOT 2
- Chord.get throws exception on some strings
- Exact versions HOT 6
- Broken link in README. `pitch-notation-abc` is now `abc-notation`
- Chord to leadsheet notation
- Chord detection inconsistency HOT 2
- Edge case with Interval, possibly note octave designation HOT 1
- Scale.get suggestions HOT 1
- note.height id note defined in various README files
- @tonaljs/note Note.distance does not exist
- [Feature request] Unicode symbol list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tonal.