Skip to content

Commit

Permalink
Update module to ES6
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Jan 8, 2020
1 parent 489a50f commit a64390d
Show file tree
Hide file tree
Showing 28 changed files with 3,094 additions and 227 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.DS_Store
*.log
.DS_Store
.nyc_output
coverage
node_modules
package-lock.json
/dist
7 changes: 7 additions & 0 deletions .jsdocrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"templates": {
"default": {
"includeDate": false
}
}
}
5 changes: 2 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"esversion": 6,
"sub": true
}
"esversion": 6
}
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
language: node_js
os:
- linux
- osx
node_js:
- "7"
- "8"
- "9"
- "10"
- "12"
script:
- npm run build
after_success:
- npm run coverage
- npm run coverage
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# CHANGELOG
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2018 Rafael da Silva Rocha.
Copyright (c) 2011 James Robert, http://jiaaro.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
# low-pass-filter
Copyright (c) 2018 Rafael da Silva Rocha.
MIT License.
# low-pass-filter

## About
LPF. This is a audio FX.
A low pass filter.

## Install
```
npm install low-pass-filter
```

## Use

### Browser
Use the **low-pass-filter.js** file in the */dist* folder:
```html
<script src="./dist/low-pass-filter.js"></script>
<script>
lowPassFilter.lowPassFilter(samples, 22050, 44100, 2);
</script>
```

Or load it from the [jsDelivr](https://cdn.jsdelivr.net/npm/low-pass-filter) CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/low-pass-filter"></script>
```

Or load it from [unpkg](https://unpkg.com/low-pass-filter):
```html
<script src="https://unpkg.com/low-pass-filter"></script>
```

### Node
```javascript
const lowPassFilter = require('low-pass-filter').lowPassFilter;
lowPassFilter(samples, 22050, 44100, 2);
```

## API
```javascript

/**
* Apply LPF to an array of samples.
* @param {!Array<number>} samples The samples.
* @param {!number} cutoff The cutoff frequency.
* @param {!number} sampleRate The sample rate.
* @param {!number} numChannels The number of channels.
* Low pass filter.
* @param {!Array<number>|TypedArray} samples The samples.
* @param {number} cutoff The cutoff frequency.
* @param {number} sampleRate The sample rate.
* @param {number} numChannels The number of channels.
*/
function lowPassFilter(samples, cutoff, sampleRate, numChannels) {}
```
Expand All @@ -28,7 +52,8 @@ https://github.com/jiaaro/pydub/blob/master/pydub/effects.py#L187
http://stackoverflow.com/questions/13882038/implementing-simple-high-and-low-pass-filters-in-c

## LICENSE
Copyright (c) 2018 Rafael da Silva Rocha.
Copyright (c) 2018 Rafael da Silva Rocha.
Copyright (c) 2011 James Robert, http://jiaaro.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
environment:
matrix:
- nodejs_version: "7"
- nodejs_version: "8"
- nodejs_version: "9"
- nodejs_version: "10"
- nodejs_version: "12"

install:
- ps: Install-Product node $env:nodejs_version
Expand All @@ -18,4 +20,4 @@ build: off
version: "{build}"

matrix:
fast_finish: true
fast_finish: true
6 changes: 0 additions & 6 deletions compile.js

This file was deleted.

2 changes: 0 additions & 2 deletions dist/low-pass-filter-min.js

This file was deleted.

178 changes: 164 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="utf-8">
<title>Home - Documentation</title>



<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

Expand All @@ -21,8 +25,9 @@

<label for="nav-trigger" class="overlay"></label>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#lowPassFilter">lowPassFilter</a></li></ul>
<nav >

<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-low-pass-filter.html">low-pass-filter</a><ul class='methods'><li data-type='method'><a href="module-low-pass-filter.html#.lowPassFilter">lowPassFilter</a></li></ul></li></ul>
</nav>

<div id="main">
Expand All @@ -35,6 +40,11 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm



<section class="package">
<h3> </h3>
</section>





Expand All @@ -45,19 +55,48 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm




<section class="readme">
<article><h1>low-pass-filter</h1><p>Copyright (c) 2018 Rafael da Silva Rocha.<br>MIT License.</p>
<h2>About</h2><p>LPF. This is a audio FX.</p>
<h2>Install</h2><pre class="prettyprint source"><code>npm install low-pass-filter</code></pre><h2>Use</h2><pre class="prettyprint source lang-javascript"><code>
<article><h1>low-pass-filter</h1>
<p>A low pass filter.</p>
<h2>Install</h2>
<pre class="prettyprint source"><code>npm install low-pass-filter
</code></pre>
<h2>Use</h2>
<h3>Browser</h3>
<p>Use the <strong>low-pass-filter.js</strong> file in the <em>/dist</em> folder:</p>
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;./dist/low-pass-filter.js&quot;>&lt;/script>
&lt;script>
lowPassFilter.lowPassFilter(samples, 22050, 44100, 2);
&lt;/script>
</code></pre>
<p>Or load it from the <a href="https://cdn.jsdelivr.net/npm/low-pass-filter">jsDelivr</a> CDN:</p>
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/low-pass-filter&quot;>&lt;/script>
</code></pre>
<p>Or load it from <a href="https://unpkg.com/low-pass-filter">unpkg</a>:</p>
<pre class="prettyprint source lang-html"><code>&lt;script src=&quot;https://unpkg.com/low-pass-filter&quot;>&lt;/script>
</code></pre>
<h3>Node</h3>
<pre class="prettyprint source lang-javascript"><code>const lowPassFilter = require('low-pass-filter').lowPassFilter;
lowPassFilter(samples, 22050, 44100, 2);
</code></pre>
<h2>API</h2>
<pre class="prettyprint source lang-javascript"><code>
/**
* Apply LPF to an array of samples.
* @param {!Array&lt;number>} samples The samples.
* @param {!number} cutoff The cutoff frequency.
* @param {!number} sampleRate The sample rate.
* @param {!number} numChannels The number of channels.
* Low pass filter.
* @param {!Array&lt;number>|TypedArray} samples The samples.
* @param {number} cutoff The cutoff frequency.
* @param {number} sampleRate The sample rate.
* @param {number} numChannels The number of channels.
*/
function lowPassFilter(samples, cutoff, sampleRate, numChannels) {}</code></pre><h3>References</h3><p>https://github.com/jiaaro/pydub/blob/master/pydub/effects.py#L187<br>http://stackoverflow.com/questions/13882038/implementing-simple-high-and-low-pass-filters-in-c</p>
<h2>LICENSE</h2><p>Copyright (c) 2018 Rafael da Silva Rocha.</p>
function lowPassFilter(samples, cutoff, sampleRate, numChannels) {}
</code></pre>
<h3>References</h3>
<p>https://github.com/jiaaro/pydub/blob/master/pydub/effects.py#L187<br>
http://stackoverflow.com/questions/13882038/implementing-simple-high-and-low-pass-filters-in-c</p>
<h2>LICENSE</h2>
<p>Copyright (c) 2018 Rafael da Silva Rocha.<br>
Copyright (c) 2011 James Robert, http://jiaaro.com</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
&quot;Software&quot;), to deal in the Software without restriction, including
Expand All @@ -81,15 +120,126 @@ <h2>LICENSE</h2><p>Copyright (c) 2018 Rafael da Silva Rocha.</p>






<section>

<header>

<h2>
index.js
</h2>


</header>

<article>

<div class="container-overview">



<dl class="details">


<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line26">line 26</a>
</li></ul></dd>





























<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="https://github.com/rochars/low-pass-filter">https://github.com/rochars/low-pass-filter</a></li>
</ul>
</dd>



</dl>





<div class="description">The low-pass-filter module.</div>




</div>





















</article>

</section>






</div>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun May 06 2018 16:35:12 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>



</body>
</html>
Loading

0 comments on commit a64390d

Please sign in to comment.