![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A javascript api for generating frequencies for use with the web audio API
This package aims to:
What it doesn't do:
This module has no dependencies. Please note that dependencies for the demo were mistakenly listed in pre-1.0.1 versions.
It is recommended you install via Yarn or NPM
using
yarn add freqi
or
npm install freqi
Freqi is configured to work with ESM, AMD and CJS applications.
If you're using Webpack or some other CJS module loader
import (ES6), like so
import freqi from 'freqi'
or for CommonJS loaders (such as Browserify) use
var freqi = require('freqi');
Freqi provides a pure function, getFreqs
, which accepts a config object and returns an array of frequencies. There is one mandatory property: intervals
, though it is recommended that startFreq
be set too.
intervals
is the set of notes you want to generate frequencies from. These intervals can be any integer, positive or negative e.g. [-5, 0, 7]
where 0
is the start frequency.
startFreq
can be a frequency in Hz, such as 440
(for the note A) or a relative frequency such 1
which is useful for playing back audio files, such as MP3s or OGGs, where 1
is the original playback rate. 440
is the default value.
NEW | Tuning Systems
Freqi now supports just intonation tuning systems. By default it will use equal temperament, but to use a Just tuning system set the mode
to one of the following:
pythagorean
- tempered pythagorean
truePythag
- all notes are calculated using fifths (3/2), which introduces the pyhthagorean comma
fiveLimit
diatonic
- this system has only 7 notes per octave
diatonicIndian
twentyTwoShrutis
- as the name suggests, there are 22 notes per octave
gioseffoZarlino
- there are 16 notes per octave
Once in one of these modes, other config params, such as numNotes
, will have no effect as they are fixed scale systems.
Technically speaking, most of the just tuning systems are actually tempered in that the upper and lower octaves are acheived by increasing or decreasing their frequencies by a power of 2. The object containing the ratios for each system is exported as justTuningSystems
should you need to view it. If you want to list all the tuning system keys, use the method getModes
.
There is also a mode for the harmonic series hSeries
, though in its raw state it's not particularly useful for making music, but may be of interest to music theorists.
Optional Params
You can pass in a custom number of semitones. The default is 12
, a western chromatic scale, but you could pass in 19 for a non-western scale - this can produce very interesting results!
If you are using Freqi to generate multiple sequences of notes you can offset the root note using the rootNote
property. A value of 2
for example will pitch the provided intervals up by two semitones.
Also, you can offset the intervals themselves to produce inversions or rootless voicings. {intervals: [0, 3, 5, 7, 10], intervalStartIndex: 2}
will create a set of frequencies from the 2nd index in the intervals array, so it's equivalent to {intervals: [5, 7, 10]
. If you always want arrays of the same length use the numNotes
property. If that is set Freqi will automatically produce the desired number of notes. Use this in conjunction with amountToAdd
if you want it to extend the intervals by a certain number of semitones e.g. {intervals: [0, 3, 5, 7, 10], intervalStartIndex: 2, amountToAdd: 12, numNotes: 5}
will yield
Following on from the above, by using numNotes
, a larger or smaller number of notes can be set than is provided by the intervals
property e.g. {intervals : [0, 3, 5], numNotes: 5}
. In this case Freqi will add the missing array items and extend them to the next octave. You can have Freqi add any value to these missing items - setting amountToAdd
to 0
will effectively add the same numbers again.
justInt
, pythagorean
, truePythag
, diatonic
, fiveLimit
, diatonicIndian
, twentyTwoShrutis
View the online demo on GitHub here
Or download/clone it and run npm install
which will install any dependencies, npm run build
to create the demo bundle and npm run start
which will start a new server at localhost:8080.
Then, be sure to navigate to the demo folder in order to see the page i.e. localhost:8080/demo
1.5.2 TypeScript definitions added
1.5.2 Native EcmaScript module support added
1.4.0 Bug fix for True Pythagorean
1.3.0 Support for true pythagorean scale added.
1.2.0 Support for Gioseffo Zarlino's 16 note scale added.
1.1.0 As described above, 1.1.0 supports mutliple tuning systems. The source has been refactored to TypeScript and test coverage has been improved.
1.0.0 included one breaking change whereby inversionStartNote
was changed to intervalStartIndex
to better express its purpose. If you're not explicitly using this property in your app you should be able to safely upgrade to the latest version.
The library is written in TypeScript. Rollup has been used as the bundler to ensure backwards compatibility - there's an issue with how TS publishes UMD modules.
Mocha is used as the testing framework.
Browserify is used to build the demo.
FAQs
A library that generates musical frequencies for use with the Web Audio API
The npm package freqi receives a total of 9 weekly downloads. As such, freqi popularity was classified as not popular.
We found that freqi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.