Skip to content

Commit

Permalink
feat: removed sampler for standalone web-app. might inline the sample…
Browse files Browse the repository at this point in the history
… in later builds
  • Loading branch information
davay42 committed Nov 13, 2024
1 parent 5b4ef7a commit 4254b27
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ watch(midiNote, note => play(note.number, note.velocity))
onKeyDown('Escape', () => { stopAll() })
const layers = ['round', 'fat', 'string', 'noise', 'sampler']
const layers = ['round', 'fat', 'string', 'noise']
const fxs = ['pingpong', 'srvb']
Expand Down Expand Up @@ -55,7 +55,7 @@ const { next, state, go } = useCycleList(layers)
h1.text-xl Chromatone
h2.text-4xl Elements
h2.text-2xl Multilayered polyphonic synthesizer app
h3.text-sm.max-w-55ch Explore unique sounds of 6 voice polyphony, 5 layers of sound generators for each of them and 2 global effects with any MIDI controller, laptop keyboard and flexible onscreen keyboard with choice of scales while analyzing the output on the global oscilloscope and colorized FFT time-frequency bars. Notes and frequencies are set according to Chromatone.
h3.text-sm.max-w-55ch Explore unique sounds of 6 voice polyphony, 4 layers of sound generators for each of them and 2 global effects with any MIDI controller, laptop keyboard and flexible onscreen keyboard with choice of scales while analyzing the output on the global oscilloscope and colorized FFT time-frequency bars. Notes and frequencies are set according to Chromatone.



Expand Down
14 changes: 7 additions & 7 deletions composables/useSynth.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useMidi } from './useMidi';
import { createNoise } from '../elements/noise';
import { createFat } from '../elements/fat';
import { createString } from '../elements/string';
import { createSampler } from '../elements/sampler';
// import { createSampler } from '../elements/sampler';
import { createRound } from '../elements/round';


Expand Down Expand Up @@ -58,11 +58,11 @@ export function useSynth() {
core.on('fft', (e) => FFTs[e.source] = [Array.from(e?.data.real.values()), Array.from(e?.data.imag.values())])
core.on('error', err => console.log(err))

let res = await fetch('/A4.mp3')
let sampleBuffer = await ctx.decodeAudioData(await res.arrayBuffer())
core.updateVirtualFileSystem({
'piano': sampleBuffer.getChannelData(0),
})
// let res = await fetch('/A4.mp3')
// let sampleBuffer = await ctx.decodeAudioData(await res.arrayBuffer())
// core.updateVirtualFileSystem({
// 'piano': sampleBuffer.getChannelData(0),
// })

const signal = el.tanh(el.mul(cv.synth.vol, el.add(...voices.map((_, i) => {
const voiceParams = getVoiceParams(i)
Expand All @@ -71,7 +71,7 @@ export function useSynth() {
createFat(voiceParams, cv.fat, cv.synth.bpm),
createNoise(voiceParams, cv.noise, cv.synth.bpm),
createString(voiceParams, cv.string, cv.synth.bpm),
createSampler(voiceParams, cv.sampler, cv.synth.bpm)
// createSampler(voiceParams, cv.sampler, cv.synth.bpm)
)
}
))))
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions elements/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { params as srvb } from './fx/srvb'
import { params as pingpong } from './fx/pingpong'
import { params as noise } from './noise'
import { params as string } from './string'
import { params as sampler } from './sampler'
import { params as round } from './round'

export const params = {
Expand All @@ -15,7 +14,6 @@ export const params = {
fat,
noise,
string,
sampler,
srvb,
pingpong,
}
Expand Down
Binary file removed public/A4.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "elements-v.0.4.0",
"id": "elements-v.0.4.1",
"name": "Elements Synth",
"short_name": "Elements",
"description": "Web polyphonic multilayered digital synthesizer",
Expand Down
3 changes: 1 addition & 2 deletions public/sw.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const CACHE_NAME = 'elements-cache-v.0.4.0';
const CACHE_NAME = 'elements-cache-v.0.4.1';
const ASSETS_TO_CACHE = [
'/',
'/index.html',
'/logo.svg',
'/A4.mp3'
];

// Install Service Worker
Expand Down

0 comments on commit 4254b27

Please sign in to comment.