Trying out different sound waves

This commit is contained in:
zenoamaro committed 2019-06-30 15:02:08 +02:00
1 parent 2912061094
commit 58ee03f8a8
4 files changed
+16 -11

No files matched your search

+5 -5
View File
@@ -27,7 +27,7 @@ export const EXPLOSION_TYPES = {
blast: {
create(spec, x, y) {
const {r} = spec;
const osc = createOsc();
const osc = createOsc('sawtooth');
osc.start();
return {type:'blast', x, y, r, cr:0, osc};
},
@@ -36,7 +36,7 @@ export const EXPLOSION_TYPES = {
},
draw(explosion, foreground) {
const {x, y, cr, osc} = explosion;
const f = cycle(explosion.cr, 6) % 2 === 0 ? 220 : 440;
const f = cycle(explosion.cr, 6) % 2 === 0 ? 110 : 220;
osc.frequency.setValueAtTime(f, audio.currentTime);
drawExplosion(foreground, x, y, cr);
},
@@ -62,7 +62,7 @@ export const EXPLOSION_TYPES = {
dirt: {
create(spec, x, y) {
const {r} = spec;
const osc = createOsc();
const osc = createOsc('sawtooth');
osc.start();
return {type:'dirt', x, y, r, cr:0, osc};
},
@@ -89,7 +89,7 @@ export const EXPLOSION_TYPES = {
digBomb: {
create(spec, x, y) {
const {r} = spec;
const osc = createOsc();
const osc = createOsc('sawtooth');
osc.start();
return {type:'digBomb', x, y, r, cr:0, osc};
},
@@ -117,7 +117,7 @@ export const EXPLOSION_TYPES = {
create(spec, x, y) {
const {r} = spec;
const pattern = [];
const osc = createOsc();
const osc = createOsc('sawtooth');
osc.start();
return {type:'dirtCone', x, y, r, cr:0, osc, pattern};
},