Installations
npm install jsynth-sync
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
6.5.0
NPM Version
5.5.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (96.55%)
CSS (2.31%)
HTML (1.15%)
Developer
NHQ
Download Statistics
Total Downloads
6,306
Last Day
1
Last Week
1
Last Month
15
Last Year
277
GitHub Statistics
2 Stars
28 Commits
1 Forks
3 Watching
1 Branches
1 Contributors
Bundle Size
1.87 kB
Minified
840.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.15.0
Package Id
jsynth-sync@0.15.0
Size
19.02 kB
NPM Version
5.5.1
Node Version
6.5.0
Total Downloads
Cumulative downloads
Total Downloads
6,306
Last day
0%
1
Compared to previous day
Last week
-90.9%
1
Compared to previous week
Last month
50%
15
Compared to previous month
Last year
-28.6%
277
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
jsynth-sync
A syncopation module for jsynth, baudio, and webaudio;
how to use it
see also the example
The constructor requires beatsPerMinute and SampleRate values.
1var sync = require('jsynth-sync'); 2 3var timer = sync(72, 8000) // 72 bpm, samplRate 8000 (8k samples per second) 4var t = timer.on(1, function(time, beatCount, clearFN, swingFN){ 5 // do something every beat 6}) 7var i = timer.on(1/2, function(t, b, clrFN){ 8 // do something every half beat 9}) 10 11function synth(t){ 12 13 timer.tick.apply(timer, arguments) 14 15}; 16
methods
###sync.on(beatValue, fn)
timer will call fn every beatValue. the return of sync.on() is a function which clears fn from being called any more. Your function will be called with the actual clock time of the call, a count for the beatValue, and a function you can call to clear the current call for good.
1var quarter = sync.on(1/4, function(time, beatCount, clear, swing){ 2 // do something every quarter-beat 3 // beatCount is the # of times this beatValue has been called. 4 if(beatCount % 4 == 0) // only do something every 4th quarter beat 5 if(forSomeReason) clear() // clear the timer 6 //new! 7 // the siwng function allows you to have the next beat (or all beats) 8 // changed to a new interval 9 if(true) swing(interval) 10 else if(true) swing(0) // you must set it back manually 11} 12 13setTimeout(function(){ 14 quarter() // clears it 15}, 4000)
###timer.tick() Timer tick does not require any arguments, but will pass them on to your function. Simply call it for every sample.
###timer.clearAll() clear all the timered functions
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2025-01-13
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More