Skip to content

Commit

Permalink
new audio styles
Browse files Browse the repository at this point in the history
  • Loading branch information
deleolajide committed Sep 3, 2024
1 parent d468b93 commit d5912c0
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 18 deletions.
Binary file added docs/assets/chords/disco-funk_120_8000.chord
Binary file not shown.
Binary file added docs/assets/chords/hip-hop_68_14118.chord
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 14 additions & 11 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,25 @@
<tr>
<td><h2 id="statusMsg"></h2></td>
<td>
<a class="play">On</a><a class="style_type">Normal</a>
<a class="gamepad_mode">Color Tabs</a><a class="load_file">Load</a>
<a style="display: none;" class="chorda_bluetooth">BT OFF</a>
<a style="display: none;" class="delete_style">Delete Style</a>
<a class="pedal_board">Pedal Board</a>
<a class="save_reg">Save</a>
<a class="reset_app">Refresh</a>
<span style="font-size: 14px;margin-left:10px" id="sequencer">Tempo:<span id="showTempo">100</span></span>
<div id="sequencer2" style="margin:10px">BPM
<div><center>
<a class="play">On</a><a class="style_type">Normal</a>
<a class="gamepad_mode">Color Tabs</a><a class="load_file">Load</a>
<a style="display: none;" class="chorda_bluetooth">BT OFF</a>
<a style="display: none;" class="delete_style">Delete Style</a>
<a class="pedal_board">Pedal Board</a>
<a class="save_reg">Save</a>
<a class="reset_app">Refresh</a>
</center><div>
<div id="sequencer2" style="margin:10px">
<span style="font-size: 14px;margin-left:2px" id="sequencer">Tempo:<span id="showTempo">100</span></span>
<input id="tempo" type="range" min="30.0" max="160.0" step="1" value="100" style="height: 20px; width: 150px">
<input style="margin-left: 10px;margin-right: 10px;" id="microphone" type="checkbox">Mic
<input style="margin-left: 10px;margin-right: 10px;" id="autoFill" type="checkbox" checked>Auto Fill
<input style="margin-left: 10px;margin-right: 10px;" id="introEnd" type="checkbox" checked>Intro/Outro
<input checked style="margin-left: 10px;margin-right: 10px;" id="reverb" type="checkbox">Pedals
<input checked style="margin-left: 10px;margin-right: 10px;" id="program-change" type="checkbox">Program Change
<input id="volume" type="range" min="0.0" max="100.0" step="1" value="25" style="height: 20px; width: 150px;margin-left: 20px;margin-right: 10px;"><span id="showVol">VOL</span>
<input checked style="margin-left: 10px;margin-right: 10px;" id="program-change" type="checkbox">P.Change
<input id="volume" type="range" min="0.0" max="100.0" step="1" value="25" style="height: 20px; width: 150px;margin-left: 20px;margin-right: 10px;">
<span id="showVol">VOL</span>
</div>
</td>
</tr>
Expand Down
25 changes: 18 additions & 7 deletions docs/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,16 @@ async function doLiberLiveSetup(device) {

handler.addEventListener('characteristicvaluechanged', (evt) => {
const {buffer} = evt.target.value;
const eventData = new Uint8Array(buffer);
const eventData = new Uint8Array(buffer);

if (eventData.length != 14 || (eventData.length == 14 && eventData[9] != 49 && eventData[9] != 50 && eventData[10] != 49 && eventData[10] != 50)) {
for (let i in eventData) console.debug("Event", eventData.length, i + ":" + eventData[i]);
for (let i in eventData) console.debug("Event", eventData.length, i + ":" + eventData[i]);
}

if (eventData[7]) {
tempo = eventData[7];
volDiv.innerHTML = "Vol: " + (guitarVolume * 100);
tempoDiv.innerHTML = tempo;
}

/*let html = "<table><tr>";
Expand All @@ -501,8 +507,6 @@ async function doLiberLiveSetup(device) {
html += "</tr></table>"
ui.innerHTML = html;*/

volDiv.innerHTML = "Vol: " + (guitarVolume * 100) + " (" + eventData[6] + ")";
tempoDiv.innerHTML = tempo + "&nbsp;(" + eventData[7] + ")";
const oldKey = keyChange;

if (eventData[1] == 0) keyChange = 0; // C
Expand Down Expand Up @@ -2956,9 +2960,16 @@ async function setupUI(config,err) {
}
else {

if (arranger != "sff") { // use gmgsx.sf2 as dummy midiSynth
loadMidiSynth();
if (arranger != "webaudio") playButton.innerText = "Play";
if (arranger != "sff") {

if (config.sf2Name) {
arrSynth = {name: config.sf2Name};
getArrSynth(arrSynth.name); // load sf2 file
} else {
// use gmgsx.sf2 as dummy midiSynth
loadMidiSynth();
if (arranger != "webaudio") playButton.innerText = "Play";
}
}

window.tempConfig = config; // store config for later access
Expand Down
4 changes: 4 additions & 0 deletions docs/js/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ var chord_loops = [
"assets/chords/da-funk_110_8727.chord",
"assets/chords/dance_118_32520.chord",
"assets/chords/dirty-guitar_90_10667.chord",
"assets/chords/disco-funk_120_8000.chord",
"assets/chords/dream_85_22588.chord",
"assets/chords/electric-chill_85_11294.chord",
"assets/chords/electro-jazz_90_10667.chord",
Expand All @@ -165,6 +166,7 @@ var chord_loops = [
"assets/chords/fusion-pop_100_9600.chord",
"assets/chords/gogo_180_21333_10667.chord",
"assets/chords/gospel-funk_90_21333.chord",
"assets/chords/hip-hop_68_14118.chord",
"assets/chords/kraft_100_4800.chord",
"assets/chords/jazz-funk_110_17455.chord",
"assets/chords/lafunk_116_4138.chord",
Expand Down Expand Up @@ -230,6 +232,7 @@ var drum_loops = [
"assets/drums/cosmic-pop_105_2286_9143_2286_2286_4571.drum",
"assets/drums/dance_100_2400_9600_2400_2400_4800.drum",
"assets/drums/dance_118_2034_8136_2034_2034_6102.drum",
"assets/drums/disco-funk_120_2000_16000_2000_2000_4000.drum",
"assets/drums/dream_85_5647_5647_2824_2824_11294.drum",
"assets/drums/folk_85_2824_11294_2824_2823_5647.drum",
"assets/drums/folk1_114_2105_8421_2105_2105_4211.drum",
Expand All @@ -242,6 +245,7 @@ var drum_loops = [
"assets/drums/funky-pop_110_2182_8727_2182_2182_4364.drum",
"assets/drums/fusion-pop_100_2400_19200_2400_2400_9600.drum",
"assets/drums/gogo_180_2667_21333_1333_2667_5333.drum",
"assets/drums/hip-hop_68_3530_14118_3530_3530_7060.drum",
"assets/drums/hip-hop_90_2667_10667_2667_2667_5333.drum",
"assets/drums/kompa1_103_2330_18641_2330_2286_4660.drum",
"assets/drums/kompa2_103_2316_18641_2330_2330_4660.drum",
Expand Down

0 comments on commit d5912c0

Please sign in to comment.