Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
laughinginloud committed Dec 27, 2023
1 parent 1fb62e0 commit 9b9931e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions index.8cefc94f.js → index.896a3200.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.896a3200.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion index.8cefc94f.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en-gb"><head><meta charset="utf-8"><title>Loop Station</title><link rel="stylesheet" href="index.684f848a.css"><script type="module" src="index.8cefc94f.js"></script></head><body> <div id="loop_station"> <div id="global_controls"> <div id="knobBG"><div id="knob"></div></div> <div class="console_control" id="global_sp">⏵/⏸</div> <div class="console_control" id="clear_last">CLEAR LAST</div> <div class="console_control" id="global_clear">CLEAR</div> <textarea id="control_panel" name="control_panel" rows="3" cols="50">l00p 5t4t10n</textarea> <div class="menu_scroll" id="previous"></div> <div class="menu_scroll" id="next"></div> <div class="menu_scroll" id="select"></div> <div id="knobSM"><div id="eff_parameters"></div></div> <div class="effect" id="effA">A</div> <div class="effect" id="effB">B</div> <div class="effect" id="effC">C</div> <div class="module" id="mod_1"> <div class="dispari edit" id="ed1">EDIT</div> <div class="clear_module odd" id="clear1">CLEAR</div> <div class="sp_button" id="sp1">⏵/⏸</div> <div class="volume" id="vol1"> <input type="range" id="points1" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec1">⏵/⏺︎</div> <div class="odd rewind" id="rewind1">⏪︎</div> </div> <div class="module" id="mod_2"> <div class="edit" id="ed2">EDIT</div> <div class="clear_module" id="clear2">CLEAR</div> <div class="even sp_button" id="sp2">⏵/⏸</div> <div class="volume" id="vol2"> <input type="range" id="points2" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec2">⏵/⏺︎</div> <div class="rewind" id="rewind2">⏪︎</div> </div> <div class="module" id="mod_3"> <div class="dispari edit" id="ed3">EDIT</div> <div class="clear_module odd" id="clear3">CLEAR</div> <div class="sp_button" id="sp3">⏵/⏸</div> <div class="volume" id="vol3"> <input type="range" id="points3" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec3">⏵/⏺︎</div> <div class="odd rewind" id="rewind3">⏪︎</div> </div> <div class="module" id="mod_4"> <div class="edit" id="ed4">EDIT</div> <div class="clear_module" id="clear4">CLEAR</div> <div class="even sp_button" id="sp4">⏵/⏸</div> <div class="volume" id="vol4"> <input type="range" id="points4" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec4">⏵/⏺︎</div> <div class="rewind" id="rewind4">⏪︎</div> </div> <div class="module" id="mod_5"> <div class="dispari edit" id="ed5">EDIT</div> <div class="clear_module odd" id="clear5">CLEAR</div> <div class="sp_button" id="sp5">⏵/⏸</div> <div class="volume" id="vol5"> <input type="range" id="points5" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec5">⏵/⏺︎</div> <div class="odd rewind" id="rewind5">⏪︎</div> </div> </div> </div> </body></html>
<!DOCTYPE html><html lang="en-gb"><head><meta charset="utf-8"><title>Loop Station</title><link rel="stylesheet" href="/index.684f848a.css"><script type="module" src="/index.896a3200.js"></script></head><body> <div id="loop_station"> <div id="global_controls"> <div id="knobBG"><div id="knob"></div></div> <div class="console_control" id="global_sp">⏵/⏸</div> <div class="console_control" id="clear_last">CLEAR LAST</div> <div class="console_control" id="global_clear">CLEAR</div> <textarea id="control_panel" name="control_panel" rows="3" cols="50">l00p 5t4t10n</textarea> <div class="menu_scroll" id="previous"></div> <div class="menu_scroll" id="next"></div> <div class="menu_scroll" id="select"></div> <div id="knobSM"><div id="eff_parameters"></div></div> <div class="effect" id="effA">A</div> <div class="effect" id="effB">B</div> <div class="effect" id="effC">C</div> <div class="module" id="mod_1"> <div class="dispari edit" id="ed1">EDIT</div> <div class="clear_module odd" id="clear1">CLEAR</div> <div class="sp_button" id="sp1">⏵/⏸</div> <div class="volume" id="vol1"> <input type="range" id="points1" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec1">⏵/⏺︎</div> <div class="odd rewind" id="rewind1">⏪︎</div> </div> <div class="module" id="mod_2"> <div class="edit" id="ed2">EDIT</div> <div class="clear_module" id="clear2">CLEAR</div> <div class="even sp_button" id="sp2">⏵/⏸</div> <div class="volume" id="vol2"> <input type="range" id="points2" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec2">⏵/⏺︎</div> <div class="rewind" id="rewind2">⏪︎</div> </div> <div class="module" id="mod_3"> <div class="dispari edit" id="ed3">EDIT</div> <div class="clear_module odd" id="clear3">CLEAR</div> <div class="sp_button" id="sp3">⏵/⏸</div> <div class="volume" id="vol3"> <input type="range" id="points3" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec3">⏵/⏺︎</div> <div class="odd rewind" id="rewind3">⏪︎</div> </div> <div class="module" id="mod_4"> <div class="edit" id="ed4">EDIT</div> <div class="clear_module" id="clear4">CLEAR</div> <div class="even sp_button" id="sp4">⏵/⏸</div> <div class="volume" id="vol4"> <input type="range" id="points4" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec4">⏵/⏺︎</div> <div class="rewind" id="rewind4">⏪︎</div> </div> <div class="module" id="mod_5"> <div class="dispari edit" id="ed5">EDIT</div> <div class="clear_module odd" id="clear5">CLEAR</div> <div class="sp_button" id="sp5">⏵/⏸</div> <div class="volume" id="vol5"> <input type="range" id="points5" name="points" min="0" max="100" value="80"> </div> <div class="rec_button" id="rec5">⏵/⏺︎</div> <div class="odd rewind" id="rewind5">⏪︎</div> </div> </div> </div> </body></html>
11 changes: 8 additions & 3 deletions loopStation/js/Controller/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Player {

index;

compressor;

constructor(audioContext, model, channel, index) {
this.audioContext = audioContext;
this.model = model;
Expand Down Expand Up @@ -57,6 +59,8 @@ class Player {
this.pauseTime = 0;

this.index = index;

this.compressor = new DynamicsCompressorNode(audioContext);
}

play = () => {
Expand Down Expand Up @@ -125,7 +129,8 @@ class Player {
window.navigator.mediaDevices
.getUserMedia({ audio: true })
.then(stream => {
this.rec = new MediaRecorder(stream, { mimeType: "audio/webm;codec=vorbis" }); // TODO: MIME type?
this.rec = new MediaRecorder(stream);
//this.rec = new MediaRecorder(stream, { mimeType: "audio/mpeg-3", audioBitrateMode: "constant", audioBitsPerSecond: 320 * 1024 });
this.rec.start();

this.flags.rec = true;
Expand All @@ -138,15 +143,15 @@ class Player {
this.rewind();

if (this.model.firstRecord[this.index]) {
const arrayBuffer = await this.chunks[0].arrayBuffer();
const arrayBuffer = await new Blob(this.chunks, { type: "audio/mpeg-3" }).arrayBuffer();
this.audioBuffer.cur = await this.audioContext.decodeAudioData(arrayBuffer);
this.model.firstRecord[this.index] = false;
}

else {
this.audioBuffer.old = this.audioBuffer.cur;
let prevRecordings = this.audioBuffer.cur;
const arrayBuffer = await this.chunks[0].arrayBuffer();
const arrayBuffer = await new Blob(this.chunks, { type: "audio/mpeg-3" }).arrayBuffer();
this.audioBuffer.cur = await this.audioContext.decodeAudioData(arrayBuffer);
this.audioBuffer.cur = this.overdub([prevRecordings, this.audioBuffer.cur]);
}
Expand Down

0 comments on commit 9b9931e

Please sign in to comment.