Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@chordbook/tuner
Advanced tools
A web-based library for pitch detection of stringed instruments. It uses the Web Audio API to capture audio from the microphone, and uses the pitchy to detect the predominant pitch.
npm install @chordbook/tuner
import { createTuner } from '@chordbook/tuner'
const tuner = createTuner({
// The callback to call when a note is detected.
onNote: note => {
console.log('Note:', note)
},
// Here are some other settings you can fiddle with and their default values.
// (let us know if you find values that work better).
// The frequency of middle A. Defaults to 440Hz.
a4: 440,
// The minimum clarity threshold. Anything below this will be ignored
clarityThreshold: 0.95,
// The minimum volume threshold. -100 means 1/100th the volume of the loudest sound.
minVolumeDecibels: -100,
// The minimum and maximum frequencies to detect. To reduce noise, everything else is
// filtered out using a lowpass and highpass filter.
minFrequency: 73.42, // D2, drop D
maxFrequency: 1084.0, // C6, highest note on the guitar in front of me
// The size of buffer to use for frequency analysis, which maps to the `fftSize`:
// https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize
bufferSize: 2048,
// https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant
smoothingTimeConstant: 0.9,
})
// Request access to the microphone and begin pitch detection
tuner.start()
// Stop listening
tuner.stop()
When a pitch is clearly detected, the onNote
callback is called with an object containing the following properties:
{
// The frequency of the detected note
"frequency": 612.2498364209699,
// The node name (e.g. "A", "C#")
"name": "D♯",
// The note number (0-89)
"value": 75,
// The number of cents the detected frequency is off from the nearest note
"cents": -29,
// The octave of the detected note
"octave": 5,
// The clarity of the detected note (0-1)
"clarity": 0.9656978357299373
}
Contributions are welcome!
git clone https://github.com/chordbook/tuner.git
npm install
npm run dev
This project is licensed under the GPLv3.0 license.
FAQs
The tuner used by ChordBook.app
The npm package @chordbook/tuner receives a total of 90 weekly downloads. As such, @chordbook/tuner popularity was classified as not popular.
We found that @chordbook/tuner demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.