@adatechnology/game-weather 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -845,90 +845,59 @@ var GameWeather = (() => {
845
845
  };
846
846
  }
847
847
 
848
- // ../game-audio/dist/index.js
849
- var DISTANCE_CURVES = {
850
- /** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
851
- game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
852
- /** The game's `grito`: `1 / (1 + d² × 0.006)`, silent below 0.02 (jogo L62129–62130). */
853
- game_scream: { model: "inverse_square", k: 6e-3, minGain: 0.02 },
854
- /** The game's `voz`: `1 / (1 + d² × 0.01)`, silent below 0.02 (jogo L62146–62147). */
855
- game_voice: { model: "inverse_square", k: 0.01, minGain: 0.02 },
856
- /** The game's `boom`: `1.4 / (1 + d² × 0.002)`, never silent (jogo L68280). */
857
- game_boom: { model: "inverse_square", k: 2e-3, scale: 1.4 },
858
- /** The art scene's `outAt`: `vol / (1 + d² × 0.008)` (cena L1320). */
859
- art_scene: { model: "inverse_square", k: 8e-3 },
860
- /** The game's animal calls: `max(0, 1 − d / 70) × 0.25`, silent at or below 0.005 (jogo L66627–66628). */
861
- animals: { model: "linear", range: 70, scale: 0.25, minGain: 5e-3 }
848
+ // ../game-contracts/dist/index.js
849
+ var DEFAULT_COST_ALLOCATION_BYTES = 1024 * 1024;
850
+ var DEFERRED_QUEUE_ID = {
851
+ DESTRUCTION_EVENTS: "destruction.events",
852
+ BREACH_PAINT: "floorplan.breach-paint",
853
+ AUDIO_VOICES: "audio.voices",
854
+ VEHICLE_CREASE: "vehicles.crease"
862
855
  };
863
- var mix_profiles_default = [
864
- {
865
- id: "game",
866
- master: 0.5,
867
- noise: { seconds: 1.5, create: "lazy" },
868
- sources: ["jogo:L62077-62081 master 0.5 to the output", "jogo:L62082-62088 noise 1.5 s made by the first sound that needs it"]
869
- },
870
- {
871
- id: "art_scene",
872
- master: 0.85,
873
- compressor: { threshold: -12, ratio: 5 },
874
- reverb: { seconds: 2.2, decay: 3.4, wet: 0.4 },
875
- noise: { seconds: 2, create: "eager" },
876
- sources: [
877
- "cena:L1308 compressor -12 dB, ratio 5",
878
- "cena:L1309 master 0.85",
879
- "cena:L1310 convolver, impulse 2.2 s of (1 - i/len)^3.4",
880
- "cena:L1311 wet 0.4",
881
- "cena:L1312 noise 2 s made with the chain"
882
- ]
883
- }
884
- ];
885
- var MIX_PROFILES = Object.fromEntries(
886
- mix_profiles_default.map((profile) => [profile.id, profile])
887
- );
888
- var game_sfx_default = {
889
- sources: ["jogo:L62089-62107"],
890
- note: "The game's sfx table P: [lowpass cutoff Hz, peak gain, seconds]. Played as a noise burst with the game's distance curve (falloff game_sfx) and a 0.05 s tail. Team names in `team`.",
891
- classes: [
892
- { id: "pistol", team: "pistola", bus: "weapons", cutoff: 1800, gain: 0.9, seconds: 0.18 },
893
- { id: "shotgun", team: "escopeta", bus: "weapons", cutoff: 900, gain: 1.2, seconds: 0.35 },
894
- { id: "rifle", team: "fuzil", bus: "weapons", cutoff: 1400, gain: 1.1, seconds: 0.28 },
895
- { id: "long_rifle", team: "rifle", bus: "weapons", cutoff: 1100, gain: 1.3, seconds: 0.45 },
896
- { id: "impact", team: "impacto", bus: "world", cutoff: 2500, gain: 0.25, seconds: 0.05 },
897
- { id: "flesh", team: "carne", bus: "world", cutoff: 600, gain: 0.35, seconds: 0.08 },
898
- { id: "step", team: "passo", bus: "world", cutoff: 400, gain: 0.08, seconds: 0.05 },
899
- { id: "glass", team: "vidro", bus: "world", cutoff: 5e3, gain: 0.5, seconds: 0.3 },
900
- { id: "wood", team: "madeira", bus: "world", cutoff: 700, gain: 0.5, seconds: 0.2 },
901
- { id: "reload", team: "recarga", bus: "weapons", cutoff: 3e3, gain: 0.15, seconds: 0.06 },
902
- { id: "empty", team: "vazio", bus: "weapons", cutoff: 4e3, gain: 0.12, seconds: 0.03 },
903
- { id: "explosion", team: "explosao", bus: "world", cutoff: 200, gain: 1.6, seconds: 1.4 }
904
- ],
905
- fallback: { id: "unknown", team: "(any other name)", bus: "world", cutoff: 1e3, gain: 0.5, seconds: 0.1 }
856
+ var DEFERRED_PRIORITY = {
857
+ [DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
858
+ [DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present" },
859
+ [DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
860
+ [DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" }
906
861
  };
907
- var GAME_SFX = game_sfx_default;
908
- var GAME_SFX_CLASSES = GAME_SFX.classes;
909
- var GAME_SFX_FALLBACK = GAME_SFX.fallback;
910
- function noiseClassRecipe(row, id = `sfx_${row.id}`) {
911
- return {
912
- id,
913
- bus: row.bus,
914
- order: "burst",
915
- duration: row.seconds,
916
- tail: 0.05,
917
- layers: [
918
- {
919
- source: { kind: "noise", offset: "random" },
920
- filters: { mode: "serial", bank: [{ type: "lowpass", frequency: { set: row.cutoff } }] },
921
- envelope: [
922
- [0, row.gain, "set"],
923
- ["1d", 1e-3, "exp", "fixed"]
924
- ]
925
- }
926
- ],
927
- falloff: DISTANCE_CURVES.game_sfx,
928
- sources: [...GAME_SFX.sources.map((source) => `${source} ${row.team}`)]
929
- };
930
- }
931
- var GAME_SFX_BANK = { id: "game_sfx", sounds: [...GAME_SFX_CLASSES, GAME_SFX_FALLBACK].map((row) => noiseClassRecipe(row)) };
862
+ var SURFACE_IDS = ["concrete", "asphalt", "wood", "tile", "dirt", "grass", "gravel", "sand", "metal", "water", "glass", "carpet"];
863
+ var GAIT_IDS = ["walk", "run"];
864
+ var LANDING_IDS = ["light", "heavy"];
865
+ var BODY_SOUND_IDS = [
866
+ "jump",
867
+ "cloth_rustle",
868
+ "body_fall",
869
+ "fall_damage",
870
+ "player_hurt",
871
+ "player_breath_run",
872
+ "player_death",
873
+ "bite",
874
+ "grab",
875
+ "punch_swing",
876
+ "punch_hit_body",
877
+ "punch_hit_face",
878
+ "punch_hit_object",
879
+ "kick_swing",
880
+ "kick_hit",
881
+ "kick_hit_object",
882
+ "shove_two_hands",
883
+ "knife_swing",
884
+ "knife_stab",
885
+ "knife_slash",
886
+ "knife_hit_object",
887
+ "blunt_swing",
888
+ "blunt_hit",
889
+ "blunt_hit_object",
890
+ "axe_swing",
891
+ "axe_chop",
892
+ "axe_hit_object"
893
+ ];
894
+ var footstepSoundId = (surface, gait) => `footstep_${surface}_${gait}`;
895
+ var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
896
+ var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing2) => `land_${surface}_${landing2}`));
897
+ var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
898
+ var SWING_LEAD_SECONDS = { punch: 0.07, kick: 0.09, shove: 0, blade: 0.05, blunt: 0.1, chop: 0.11 };
899
+
900
+ // ../game-audio/dist/index.js
932
901
  var ATTACK = 2e-3;
933
902
  function lengthOf(d, attack) {
934
903
  if (typeof d === "number") return attack + d;
@@ -966,51 +935,197 @@ var GameWeather = (() => {
966
935
  envelope: envelope(ATTACK)
967
936
  };
968
937
  }
969
- var BENCH_BANK = {
970
- id: "audio_bench",
971
- sounds: [
972
- {
973
- id: "bench_ping",
974
- bus: "ui",
975
- pan: true,
976
- duration: 0.25,
977
- layers: [
978
- {
979
- gain: 0.5,
980
- wet: 0.3,
981
- source: { kind: "osc", wave: "sine", frequency: { from: 880 } },
982
- envelope: [
983
- [0, 1e-4, "set", "fixed"],
984
- [2e-3, 1, "exp"],
985
- ["1d", 1e-4, "exp", "fixed"]
986
- ]
987
- }
938
+ function sceneVoice(o) {
939
+ return {
940
+ duration: lengthOf(o.d, 0),
941
+ gain: o.vol,
942
+ wet: 0.45,
943
+ source: {
944
+ kind: "formant_voice",
945
+ wave: o.wave ?? "sawtooth",
946
+ frequency: { from: o.f0, to: o.f1, curve: "linear", over: "duration" },
947
+ vibrato: { rate: [4, 10], depth: 0.08 },
948
+ formants: [
949
+ { frequency: o.fA, q: 4 },
950
+ { frequency: o.fB, q: 6 }
988
951
  ],
989
- falloff: DISTANCE_CURVES.art_scene,
990
- sources: ["sdk: bench probe, a 880 Hz ping through the art scene output stage"]
952
+ breath: { frequency: o.fB, q: 1.1, gain: o.noise },
953
+ mix: 3.2
991
954
  },
992
- {
993
- id: "bench_hiss",
994
- bus: "ui",
995
- pan: true,
996
- duration: [0.3, 0.9],
997
- layers: [
998
- {
999
- gain: 0.4,
1000
- source: { kind: "noise", offset: "random", offsetScale: 1.5, loop: true },
1001
- filters: { mode: "serial", bank: [{ type: "highpass", frequency: { set: 3e3 }, q: 0.7 }] },
1002
- envelope: [
1003
- [0, 1e-4, "set", "fixed"],
1004
- [2e-3, 1, "exp"],
1005
- ["1d", 1e-4, "exp", "fixed"]
1006
- ]
1007
- }
1008
- ],
1009
- falloff: DISTANCE_CURVES.art_scene,
1010
- sources: ["sdk: bench probe, a highpass hiss of random length"]
1011
- }
1012
- ]
955
+ envelope: [
956
+ [0, 1e-4, "set", "fixed"],
957
+ [0.1, 1, "exp"],
958
+ ["0.6d", 1, "set"],
959
+ ["1d", 1e-4, "exp", "fixed"]
960
+ ]
961
+ };
962
+ }
963
+ var TAKES = [
964
+ { f: 1, t: 1, v: 1 },
965
+ { f: 1.08, t: 0.9, v: 0.92 },
966
+ { f: 0.93, t: 1.12, v: 1.05 },
967
+ { f: 1.03, t: 1.05, v: 0.88 }
968
+ ];
969
+ var FOOTSTEP_FALLOFF = { model: "inverse_square", k: 0.03, cutoffK: 0.03, minGain: 4e-3 };
970
+ var BODY_FALLOFF = { model: "inverse_square", k: 0.012, cutoffK: 0.015, minGain: 4e-3 };
971
+ var SURFACES = {
972
+ concrete: { heel: { f: 95, d: 0.05, vol: 0.55 }, roll: { type: "bandpass", f: 2300, q: 1.1, d: 0.05, vol: 0.38 }, grains: { count: 2, f: 4200, q: 2, spread: 0.04, vol: 0.08 } },
973
+ asphalt: { heel: { f: 90, d: 0.05, vol: 0.5 }, roll: { type: "bandpass", f: 1700, q: 0.9, d: 0.06, vol: 0.36 }, grains: { count: 4, f: 3600, q: 2.5, spread: 0.06, vol: 0.1 } },
974
+ wood: { heel: { f: 130, d: 0.08, vol: 0.55 }, roll: { type: "lowpass", f: 1300, q: 0.8, d: 0.06, vol: 0.3 }, ring: [{ f: 210, d: 0.1, vol: 0.18 }, { f: 470, d: 0.06, vol: 0.06 }] },
975
+ tile: { heel: { f: 110, d: 0.04, vol: 0.45 }, roll: { type: "bandpass", f: 3600, q: 2, d: 0.03, vol: 0.42 }, ring: [{ f: 1900, d: 0.03, vol: 0.05 }] },
976
+ dirt: { heel: { f: 75, d: 0.06, vol: 0.45 }, roll: { type: "lowpass", f: 750, q: 0.7, d: 0.09, vol: 0.4 }, grains: { count: 3, f: 1800, q: 1.5, spread: 0.07, vol: 0.06 } },
977
+ grass: { heel: { f: 70, d: 0.05, vol: 0.32 }, roll: { type: "highpass", f: 2600, q: 0.7, d: 0.13, vol: 0.28 }, grains: { count: 4, f: 5200, q: 1.2, spread: 0.1, vol: 0.07 } },
978
+ gravel: { heel: { f: 80, d: 0.05, vol: 0.4 }, roll: { type: "lowpass", f: 950, q: 0.8, d: 0.1, vol: 0.3 }, grains: { count: 8, f: 2600, q: 3, spread: 0.13, vol: 0.2 } },
979
+ sand: { heel: { f: 65, d: 0.06, vol: 0.3 }, roll: { type: "bandpass", f: 1500, q: 0.6, d: 0.16, vol: 0.3 }, grains: { count: 5, f: 4800, q: 1.5, spread: 0.12, vol: 0.05 } },
980
+ metal: { heel: { f: 120, d: 0.05, vol: 0.5 }, roll: { type: "bandpass", f: 2800, q: 1.5, d: 0.03, vol: 0.25 }, ring: [{ f: 420, d: 0.25, vol: 0.16 }, { f: 1130, d: 0.18, vol: 0.09 }, { f: 2470, d: 0.1, vol: 0.04 }] },
981
+ water: { heel: { f: 70, d: 0.04, vol: 0.25 }, roll: { type: "bandpass", f: 3e3, q: 1.2, d: 0.1, vol: 0.18 }, splash: { f: 1100, f2: 380, d: 0.22, vol: 0.55 }, grains: { count: 4, f: 2400, q: 6, spread: 0.18, vol: 0.12 } },
982
+ glass: { heel: { f: 90, d: 0.04, vol: 0.4 }, roll: { type: "highpass", f: 4500, q: 0.8, d: 0.06, vol: 0.2 }, grains: { count: 9, f: 6200, q: 5, spread: 0.12, vol: 0.22 }, ring: [{ f: 3900, d: 0.04, vol: 0.04 }, { f: 5300, d: 0.03, vol: 0.03 }] },
983
+ carpet: { heel: { f: 70, d: 0.05, vol: 0.32 }, roll: { type: "lowpass", f: 420, q: 0.7, d: 0.07, vol: 0.3 } }
984
+ };
985
+ var GAITS = {
986
+ walk: { vol: 1, bright: 1, toe: 0.075, short: 1 },
987
+ run: { vol: 1.35, bright: 1.25, toe: 0.035, short: 0.75 }
988
+ };
989
+ var grainLayers = (g, take, start, scale) => Array.from(
990
+ { length: g.count },
991
+ (_, i) => sceneNoise({ type: "bandpass", f: [g.f * take.f * 0.85, g.f * take.f * 1.15], q: g.q, d: [8e-3, 0.02], vol: g.vol * scale * take.v, delay: start + (i + 0.5) / g.count * g.spread * take.t })
992
+ );
993
+ var ringLayers = (rings, take, scale, at = 0) => rings.map((r) => sceneTone({ f: r.f * take.f, d: r.d * take.t, vol: r.vol * scale * take.v, delay: at }));
994
+ function footLayers(surface, take, gait, weight = 1) {
995
+ const s = SURFACES[surface];
996
+ const toe = gait.toe * take.t;
997
+ return [
998
+ sceneTone({ f: s.heel.f * take.f * weight ** -0.3, f2: s.heel.f * take.f * 0.6, d: s.heel.d * gait.short * take.t * weight ** 0.5, vol: s.heel.vol * gait.vol * take.v * weight ** 0.5 }),
999
+ sceneNoise({ type: "lowpass", f: 500 * gait.bright, d: 0.02 * take.t, vol: 0.18 * gait.vol * take.v * weight ** 0.5 }),
1000
+ sceneNoise({ type: s.roll.type, f: [s.roll.f * take.f * gait.bright * 0.92, s.roll.f * take.f * gait.bright * 1.08], q: s.roll.q, d: s.roll.d * gait.short * take.t * weight ** 0.3, vol: s.roll.vol * gait.vol * take.v, delay: toe }),
1001
+ ...s.grains ? grainLayers(s.grains, take, toe * 0.5, gait.vol * weight ** 0.5) : [],
1002
+ ...s.ring ? ringLayers(s.ring, take, gait.vol * weight ** 0.5) : [],
1003
+ ...s.splash ? [sceneNoise({ type: "bandpass", f: s.splash.f * take.f, f2: s.splash.f2 * take.f, q: 1.4, d: s.splash.d * take.t * weight ** 0.4, vol: s.splash.vol * gait.vol * take.v * weight ** 0.5 })] : []
1004
+ ];
1005
+ }
1006
+ var quieter = (level, layers) => layers.map((layer) => {
1007
+ const gain = layer.gain ?? 1;
1008
+ if (typeof gain === "number") return { ...layer, gain: gain * level };
1009
+ if (Array.isArray(gain)) return { ...layer, gain: [gain[0] * level, gain[1] * level] };
1010
+ return layer;
1011
+ });
1012
+ var recipe = (id, layers, falloff, bus = "world") => ({ id, bus, pan: true, layers, falloff, sources: ["sdk"] });
1013
+ var takeId = (id, index) => `${id}_${String(index + 1).padStart(2, "0")}`;
1014
+ function takes(id, layersOf, falloff, rate = [0.96, 1.04], bus) {
1015
+ const sounds = TAKES.map((take, index) => recipe(takeId(id, index), layersOf(take, index), falloff, bus));
1016
+ return { sounds, set: { id, variants: sounds.map((sound) => sound.id), rate } };
1017
+ }
1018
+ var footstep = (surface, gait) => takes(footstepSoundId(surface, gait), (take) => footLayers(surface, take, GAITS[gait]), FOOTSTEP_FALLOFF);
1019
+ var LANDINGS = { light: { weight: 1.4, cloth: 0.12 }, heavy: { weight: 2.4, cloth: 0.22 } };
1020
+ var LANDING_LEVEL = 0.65;
1021
+ var landing = (surface, landing2) => takes(
1022
+ `land_${surface}_${landing2}`,
1023
+ (take) => quieter(LANDING_LEVEL, [
1024
+ // both feet, a hair apart, then the knees taking the weight (a low body thump) and the clothes settling
1025
+ ...footLayers(surface, take, GAITS.run, LANDINGS[landing2].weight),
1026
+ ...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((layer) => ({ ...layer, at: (typeof layer.at === "number" ? layer.at : 0) + 0.018 * take.t })),
1027
+ sceneTone({ f: 60 * take.f, f2: 38, d: 0.14 * LANDINGS[landing2].weight * take.t, vol: 0.22 * LANDINGS[landing2].weight ** 0.7 * take.v, delay: 0.02 }),
1028
+ sceneNoise({ type: "bandpass", f: [1800, 2600], q: 0.8, d: 0.18, vol: LANDINGS[landing2].cloth * take.v, delay: 0.04 })
1029
+ ]),
1030
+ FOOTSTEP_FALLOFF
1031
+ );
1032
+ var whoosh = (blow, from, to, d, vol, q = 1.6) => (take) => [
1033
+ // the air: a band sweeping up as the limb speeds up; it peaks `SWING_LEAD_SECONDS` in, the moment before the contact, then dies away
1034
+ sceneNoise({ type: "bandpass", f: from * take.f, f2: to * take.f, q, a: SWING_LEAD_SECONDS[blow], d: d * take.t, vol: vol * take.v }),
1035
+ sceneNoise({ type: "lowpass", f: 600 * take.f, a: SWING_LEAD_SECONDS[blow], d: d * take.t * 0.8, vol: vol * 0.35 * take.v })
1036
+ ];
1037
+ var fleshHit = (o) => (take) => [
1038
+ sceneNoise({ type: "bandpass", f: o.slapF * take.f, q: 1.2, d: 0.03 * take.t, vol: o.slap * take.v }),
1039
+ sceneNoise({ type: "highpass", f: 3500 * take.f, d: 0.012, vol: o.slap * 0.4 * take.v }),
1040
+ sceneTone({ f: o.thudF * take.f, f2: o.thudF * 0.5, d: o.thudD * take.t, vol: o.thud * take.v }),
1041
+ sceneNoise({ type: "lowpass", f: 600 * take.f, d: o.thudD * 1.2 * take.t, vol: o.thud * 0.5 * take.v }),
1042
+ ...o.crack ? [sceneNoise({ type: "highpass", f: 2500, d: 0.015, vol: o.crack * take.v, delay: 6e-3 }), sceneTone({ wave: "square", f: 900 * take.f, f2: 300, d: 0.02, vol: o.crack * 0.15 * take.v, delay: 6e-3 })] : [],
1043
+ ...o.wet ? [sceneNoise({ type: "bandpass", f: 1400 * take.f, f2: 500, q: 2.5, d: 0.12 * take.t, vol: o.wet * take.v, delay: 0.01 })] : []
1044
+ ];
1045
+ var knock = (o) => (take) => [
1046
+ sceneNoise({ type: "bandpass", f: o.clickF * take.f, q: 1.5, d: 0.018, vol: o.click * take.v }),
1047
+ ...o.tones.map(([f, d, vol]) => sceneTone({ f: f * take.f, d: d * take.t, vol: vol * take.v }))
1048
+ ];
1049
+ var voice = (o) => (take) => [
1050
+ sceneVoice({ f0: o.f0 * take.f, f1: o.f1 * take.f, d: o.d * take.t, fA: o.fA * take.f, fB: o.fB * take.f, noise: o.noise, vol: o.vol * take.v })
1051
+ ];
1052
+ var BODY = {
1053
+ jump: (take) => [
1054
+ sceneNoise({ type: "bandpass", f: 900 * take.f, f2: 1700 * take.f, q: 1, a: 0.03, d: 0.12, vol: 0.18 * take.v }),
1055
+ sceneNoise({ type: "bandpass", f: 2200 * take.f, q: 0.8, d: 0.04, vol: 0.12 * take.v }),
1056
+ sceneTone({ f: 85 * take.f, f2: 60, d: 0.04, vol: 0.2 * take.v })
1057
+ ],
1058
+ cloth_rustle: (take) => [
1059
+ { ...sceneNoise({ type: "bandpass", f: 2400 * take.f, q: 0.8, a: 0.06, d: 0.22 * take.t, vol: 0.12 * take.v }), modulators: [{ target: "gain", wave: "triangle", rate: [9, 14], depth: 0.5 }] }
1060
+ ],
1061
+ body_fall: (take) => [
1062
+ sceneTone({ f: 58 * take.f, f2: 35, d: 0.28 * take.t, vol: 0.9 * take.v }),
1063
+ sceneNoise({ type: "lowpass", f: 480 * take.f, d: 0.3 * take.t, vol: 0.55 * take.v }),
1064
+ sceneNoise({ type: "bandpass", f: 1300 * take.f, q: 1, d: 0.05, vol: 0.3 * take.v }),
1065
+ // the limbs a moment later, and the clothes
1066
+ sceneTone({ f: 75 * take.f, f2: 45, d: 0.12, vol: 0.4 * take.v, delay: 0.13 * take.t }),
1067
+ sceneNoise({ type: "bandpass", f: 2200, q: 0.8, d: 0.2, vol: 0.12 * take.v, delay: 0.05 })
1068
+ ],
1069
+ fall_damage: (take) => [
1070
+ ...BODY.body_fall(take),
1071
+ sceneNoise({ type: "highpass", f: 2800, d: 0.02, vol: 0.35 * take.v, delay: 0.01 }),
1072
+ ...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((layer) => ({ ...layer, at: 0.08 }))
1073
+ ],
1074
+ player_hurt: voice({ f0: 150, f1: 105, d: 0.26, fA: 620, fB: 1100, noise: 0.3, vol: 0.35 }),
1075
+ player_breath_run: (take) => [
1076
+ sceneNoise({ type: "bandpass", f: 1200 * take.f, q: 1, a: 0.08, d: 0.22 * take.t, vol: 0.25 * take.v }),
1077
+ sceneNoise({ type: "bandpass", f: 900 * take.f, q: 1, a: 0.06, d: 0.26 * take.t, vol: 0.3 * take.v, delay: 0.3 * take.t })
1078
+ ],
1079
+ player_death: voice({ f0: 135, f1: 68, d: 1, fA: 560, fB: 980, noise: 0.35, vol: 0.4 }),
1080
+ bite: (take) => [
1081
+ sceneNoise({ type: "highpass", f: 2600, d: 0.015, vol: 0.4 * take.v }),
1082
+ sceneNoise({ type: "bandpass", f: 1600 * take.f, f2: 450, q: 2.2, d: 0.16 * take.t, vol: 0.55 * take.v, delay: 0.01 }),
1083
+ sceneNoise({ type: "bandpass", f: 3200 * take.f, f2: 1800, q: 1.2, d: 0.22 * take.t, vol: 0.25 * take.v, delay: 0.09 }),
1084
+ sceneTone({ f: 120 * take.f, f2: 70, d: 0.06, vol: 0.3 * take.v })
1085
+ ],
1086
+ grab: (take) => [
1087
+ sceneNoise({ type: "bandpass", f: 1900 * take.f, q: 0.9, a: 4e-3, d: 0.13 * take.t, vol: 0.32 * take.v }),
1088
+ sceneTone({ f: 95 * take.f, f2: 60, d: 0.07, vol: 0.3 * take.v }),
1089
+ sceneNoise({ type: "lowpass", f: 700, d: 0.08, vol: 0.2 * take.v })
1090
+ ],
1091
+ punch_swing: whoosh("punch", 450, 1500, 0.16, 0.9),
1092
+ punch_hit_body: fleshHit({ slap: 0.55, slapF: 1500, thud: 0.6, thudF: 115, thudD: 0.09 }),
1093
+ punch_hit_face: fleshHit({ slap: 0.75, slapF: 2300, thud: 0.45, thudF: 150, thudD: 0.07, crack: 0.25 }),
1094
+ punch_hit_object: knock({ clickF: 1800, click: 0.3, tones: [[210, 0.04, 0.25]] }),
1095
+ kick_swing: whoosh("kick", 280, 950, 0.22, 1, 1.3),
1096
+ kick_hit: fleshHit({ slap: 0.45, slapF: 1100, thud: 0.85, thudF: 82, thudD: 0.14 }),
1097
+ kick_hit_object: knock({ clickF: 1e3, click: 0.3, tones: [[92, 0.08, 0.5]] }),
1098
+ shove_two_hands: (take) => [
1099
+ sceneNoise({ type: "bandpass", f: 950 * take.f, q: 0.9, a: 0.01, d: 0.13 * take.t, vol: 0.38 * take.v }),
1100
+ sceneTone({ f: 100 * take.f, f2: 60, d: 0.1 * take.t, vol: 0.45 * take.v }),
1101
+ sceneNoise({ type: "bandpass", f: 2300, q: 0.8, d: 0.16, vol: 0.12 * take.v, delay: 0.03 })
1102
+ ],
1103
+ knife_swing: whoosh("blade", 1900, 4600, 0.12, 1.1, 2.2),
1104
+ knife_stab: fleshHit({ slap: 0.2, slapF: 1200, thud: 0.4, thudF: 160, thudD: 0.06, wet: 0.5 }),
1105
+ knife_slash: (take) => [
1106
+ sceneNoise({ type: "highpass", f: 3200 * take.f, f2: 1800, d: 0.13 * take.t, vol: 0.35 * take.v }),
1107
+ sceneNoise({ type: "bandpass", f: 1300 * take.f, f2: 600, q: 2.5, d: 0.12 * take.t, vol: 0.35 * take.v, delay: 0.02 })
1108
+ ],
1109
+ knife_hit_object: knock({ clickF: 3200, click: 0.25, tones: [[2800, 0.08, 0.07], [4150, 0.06, 0.05]] }),
1110
+ blunt_swing: whoosh("blunt", 220, 760, 0.28, 1.1, 1.5),
1111
+ blunt_hit: fleshHit({ slap: 0.35, slapF: 900, thud: 1, thudF: 70, thudD: 0.18, crack: 0.3 }),
1112
+ blunt_hit_object: knock({ clickF: 1400, click: 0.35, tones: [[300, 0.12, 0.25], [760, 0.08, 0.12]] }),
1113
+ axe_swing: whoosh("chop", 190, 620, 0.3, 1.2, 1.4),
1114
+ axe_chop: fleshHit({ slap: 0.3, slapF: 1400, thud: 0.75, thudF: 140, thudD: 0.1, crack: 0.35, wet: 0.45 }),
1115
+ axe_hit_object: knock({ clickF: 2200, click: 0.4, tones: [[1500, 0.15, 0.1], [2300, 0.1, 0.06], [140, 0.1, 0.35]] })
1116
+ };
1117
+ var BODY_BUS = { player_hurt: "voices", player_death: "voices", player_breath_run: "voices", fall_damage: "voices" };
1118
+ var built = [
1119
+ ...SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstep(surface, gait))),
1120
+ ...SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((l) => landing(surface, l))),
1121
+ ...BODY_SOUND_IDS.map((id) => takes(id, BODY[id], BODY_FALLOFF, id.endsWith("_swing") ? [0.94, 1.06] : [0.96, 1.04], BODY_BUS[id]))
1122
+ ];
1123
+ var BODY_FOLEY_BANK = {
1124
+ id: "body_foley",
1125
+ sounds: built.flatMap((entry) => entry.sounds),
1126
+ sets: built.map((entry) => entry.set)
1013
1127
  };
1128
+ var BODY_FOLEY_SET_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
1014
1129
 
1015
1130
  // src/audio/recipes.ts
1016
1131
  var RAIN_LOOP = {