Skip to content

Commit

Permalink
Merge pull request #39 from MTG/dev
Browse files Browse the repository at this point in the history
Minor fixes to the web examples
  • Loading branch information
albincorreya authored Oct 12, 2020
2 parents 6e1b390 + d622b47 commit cb5c0f2
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 101 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added support for new algorithms for pitch extraction (Melodia), EBUR loudness and downmixing stereo signals etc. (see [#6](https://github.com/MTG/essentia.js/issues/6) and [#30](https://github.com/MTG/essentia.js/issues/30)).
- Added example of how to write efficient custom C++ features exractor and their corresponding Essentia WASM JS bindings for performance demanding applications (see [here](https://github.com/MTG/essentia.js/pull/38/commits/517065cab819f9d9bef8bae8c8ee1e33d627f67e)).
- Added both normal and minified builds of essentia.js seperately.


### Changes
Expand Down
6 changes: 3 additions & 3 deletions examples/offline/hpcp-chroma/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<body style="background-color: #000000!important;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/essentia.js@0.0.9/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/essentia.js@0.0.9/dist/essentia.js-extractor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/essentia.js@0.0.9/dist/essentia.js-plot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/essentia.js@0.1.0/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/essentia.js@0.1.0/dist/essentia.js-extractor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/essentia.js@0.1.0/dist/essentia.js-plot.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="script.js" defer></script>
<div>
Expand Down
6 changes: 3 additions & 3 deletions examples/offline/melspectrogram/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<body style="background-color: #000000!important;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="../../../dist/essentia-wasm.web.js"></script>
<script src="../../../dist/essentia.js-extractor.js"></script>
<script src="../../../dist/essentia.js-plot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/essentia.js-extractor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-plot.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="script.js" defer></script>
<div>
Expand Down
6 changes: 3 additions & 3 deletions examples/offline/pitchmelodia/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<body style="background-color: #000000!important;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="../../../dist/essentia-wasm.web.js"></script>
<script src="../../../dist/essentia.js-core.js"></script>
<script src="../../../dist/essentia.js-plot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-core.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-plot.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="script.js" defer></script>
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import Module from 'https://unpkg.com/[email protected]/dist/essentia-module.js';
import { EssentiaModule } from "https://cdn.jsdelivr.net/npm/essentia.js@0.0.9/dist/essentia-wasm.module.js";
import { EssentiaModule } from "https://cdn.jsdelivr.net/npm/essentia.js@0.1.0/dist/essentia-wasm.module.js";
// import Essentia JS API interface
import Essentia from "https://cdn.jsdelivr.net/npm/essentia.js@0.0.9/dist/essentia.js-core.es.js";
import Essentia from "https://cdn.jsdelivr.net/npm/essentia.js@0.1.0/dist/essentia.js-core.es.js";
// Tools for sending audio interleaved audio frames between threads, wait-free from the ringbuf.js package
// import { RingBuffer, AudioReader, ParameterReader } from "https://unpkg.com/browse/[email protected]/dist/index.es.js";

Expand Down
14 changes: 8 additions & 6 deletions examples/realtime/hpcp-chroma/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
<body style="background-color: #000000!important;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-extractor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-plot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-extractor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-plot.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<div class="ui main_wrapper landing-image">
Expand Down Expand Up @@ -196,7 +197,8 @@ <h2 class="ui header white-text" style="color: azure;">
// settings specific to an algorithm
essentiaExtractor.profile.HPCP.nonLinear = true;
// compute hpcp for overlapping frames of audio
let hpcpGram = essentiaExtractor.hpcpgram(audioBuffer);
let hpcp = essentiaExtractor.hpcpExtractor(audioBuffer);
let hpcpGram = [hpcp];
// here we call the plotting function to display realtime feature extraction results
plotChroma.create(
hpcpGram,
Expand Down Expand Up @@ -225,9 +227,9 @@ <h2 class="ui header white-text" style="color: azure;">
);

// loads the WASM backend and runs the feature extraction
EssentiaModule().then(function(essentiaModule) {
EssentiaWASM().then(function(essentiaWasmModule) {
if (!isEssentiaInstance) {
essentiaExtractor = new EssentiaExtractor(essentiaModule);
essentiaExtractor = new EssentiaExtractor(essentiaWasmModule);
isEssentiaInstance = true;
}
// start microphone stream using getUserMedia
Expand Down
6 changes: 3 additions & 3 deletions examples/realtime/melspectrogram/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<body style="background-color: #000000!important;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="../../../dist/essentia-wasm.web.js"></script>
<script src="../../../dist/essentia.js-extractor.js"></script>
<script src="../../../dist/essentia.js-plot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-extractor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-plot.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<div class="ui main_wrapper landing-image">
Expand Down
6 changes: 3 additions & 3 deletions examples/realtime/pitchmelodia/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<body style="background-color: #000000!important;"">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="../../../dist/essentia-wasm.web.js"></script>
<script src="../../../dist/essentia.js-core.js"></script>
<script src="../../../dist/essentia.js-plot.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia-wasm.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-core.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/essentia.js-plot.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

<div class="ui main_wrapper landing-image">
Expand Down
33 changes: 0 additions & 33 deletions src/cpp/custom/essentia-custom-extractor.module.js

This file was deleted.

40 changes: 0 additions & 40 deletions src/cpp/custom/essentia-custom-extractor.web.js

This file was deleted.

Binary file removed src/cpp/custom/essentia-custom-extractor.web.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/python/js_wrapper.cog
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* @fileOverview Essentia high-level core interface
* @author <a href="mailto:[email protected]">Albin Correya</a>
* @version 0.0.9
* @version 0.1.0
*/

/**
Expand Down
4 changes: 0 additions & 4 deletions src/typescript/plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,9 @@ class PlotHeatmap extends EssentiaPlot {
type: 'heatmap',
transpose: true,
};

this.Plotly.newPlot(this.divId, [data], this.plotLayout);
this.isPlotting = true;
this.startTimeIndex = timeAxis[timeAxis.length-1];

console.log(this.startTimeIndex);

} else {
// realtime mode
let heatmapFeature;
Expand Down

0 comments on commit cb5c0f2

Please sign in to comment.