Comments (4)
Hi!,
The solution is harder than I thought:
const Tonal = require('tonal');
const notes = ['a', 'b', 'e', 'g'];
const intervals = PcSet.intervals(PcSet.chroma(notes)));
const scale = intervals.map(Tonal.transpose('A4'))
One problem is that PcSet.intervals
doesn't accept the note array directly (but the documentation says it can). I'll keep the issue open while deciding what to do.
I hope it helps.
Suggestions and PR welcomed.
from tonal.
Hey @danigb!
Thank you for the quick response.
Pasting the following code
var tonal = require("tonal")
const notes = ['a', 'b', 'e', 'g'];
const intervals = tonal.PcSet.intervals(tonal.PcSet.chroma(notes));
const scale = intervals.map(tonal.transpose(`${notes[0]}4`)); // same with 'A4'
to RunKit gives me this result:
Array (4 items)
0: "C#5"
1: "E5"
2: "F#5"
3: "G#5"
from tonal.
True! It works with ["a", "c", "e", "g"]
but not with ['a', 'b', 'e', 'g']
. I'll investigate the issue...
from tonal.
This works and it's a better alternative:
var tonal = require("tonal")
const notes = ['a', 'b', 'e', 'g'];
const intervals = notes.map(tonal.interval(notes[0]))
intervals.map(tonal.transpose(`${notes[0]}4`))
EDIT: in fact the function (notes) => notes.map(tonal.interval(notes[0])))
used to be in tonal (was called Distance.harmonics
). Maybe it's time to reintrorduce it?.
Ideas?
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.