@verticopolis/components 0.0.0-stage → 0.2.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.
- package/ASSETS-LICENSE.md +49 -0
- package/LICENSE +21 -0
- package/README.md +121 -2
- package/lib/audio/Audio.d.ts +110 -0
- package/lib/audio/Audio.js +199 -0
- package/lib/audio/Audio.js.map +1 -0
- package/lib/audio/ToneAudioEngine.d.ts +125 -0
- package/lib/audio/ToneAudioEngine.js +452 -0
- package/lib/audio/ToneAudioEngine.js.map +1 -0
- package/lib/audio/audioAssets.d.ts +25 -0
- package/lib/audio/audioAssets.js +28 -0
- package/lib/audio/audioAssets.js.map +1 -0
- package/lib/audio/awayWatch.d.ts +17 -0
- package/lib/audio/awayWatch.js +33 -0
- package/lib/audio/awayWatch.js.map +1 -0
- package/lib/audio/firstCueLatch.d.ts +18 -0
- package/lib/audio/firstCueLatch.js +34 -0
- package/lib/audio/firstCueLatch.js.map +1 -0
- package/lib/audio/lightEnvelope.d.ts +64 -0
- package/lib/audio/lightEnvelope.js +124 -0
- package/lib/audio/lightEnvelope.js.map +1 -0
- package/lib/audio/lightSynth.d.ts +125 -0
- package/lib/audio/lightSynth.js +203 -0
- package/lib/audio/lightSynth.js.map +1 -0
- package/lib/audio/toneContext.d.ts +30 -0
- package/lib/audio/toneContext.js +79 -0
- package/lib/audio/toneContext.js.map +1 -0
- package/lib/audio/toneCrowd.d.ts +62 -0
- package/lib/audio/toneCrowd.js +429 -0
- package/lib/audio/toneCrowd.js.map +1 -0
- package/lib/audio/toneCrowdData.d.ts +144 -0
- package/lib/audio/toneCrowdData.js +317 -0
- package/lib/audio/toneCrowdData.js.map +1 -0
- package/lib/audio/toneCrowdPrograms.d.ts +71 -0
- package/lib/audio/toneCrowdPrograms.js +273 -0
- package/lib/audio/toneCrowdPrograms.js.map +1 -0
- package/lib/audio/toneCrowdVoices.d.ts +49 -0
- package/lib/audio/toneCrowdVoices.js +212 -0
- package/lib/audio/toneCrowdVoices.js.map +1 -0
- package/lib/audio/toneMusicVoices.d.ts +11 -0
- package/lib/audio/toneMusicVoices.js +31 -0
- package/lib/audio/toneMusicVoices.js.map +1 -0
- package/lib/audio/tonePercussion.d.ts +45 -0
- package/lib/audio/tonePercussion.js +97 -0
- package/lib/audio/tonePercussion.js.map +1 -0
- package/lib/audio/toneRain.d.ts +23 -0
- package/lib/audio/toneRain.js +39 -0
- package/lib/audio/toneRain.js.map +1 -0
- package/lib/audio/toneRecordingMock.d.ts +89 -0
- package/lib/audio/toneRecordingMock.js +145 -0
- package/lib/audio/toneRecordingMock.js.map +1 -0
- package/lib/audio/toneRoomTone.d.ts +11 -0
- package/lib/audio/toneRoomTone.js +27 -0
- package/lib/audio/toneRoomTone.js.map +1 -0
- package/lib/audio/toneScenes.d.ts +57 -0
- package/lib/audio/toneScenes.js +208 -0
- package/lib/audio/toneScenes.js.map +1 -0
- package/lib/audio/toneTracks.d.ts +50 -0
- package/lib/audio/toneTracks.js +356 -0
- package/lib/audio/toneTracks.js.map +1 -0
- package/lib/audio/toneVoices.d.ts +57 -0
- package/lib/audio/toneVoices.js +208 -0
- package/lib/audio/toneVoices.js.map +1 -0
- package/lib/catalog/catalogTypes.d.ts +428 -0
- package/lib/catalog/catalogTypes.js +102 -0
- package/lib/catalog/catalogTypes.js.map +1 -0
- package/lib/catalog/skyBridgeTypes.d.ts +25 -0
- package/lib/catalog/skyBridgeTypes.js +7 -0
- package/lib/catalog/skyBridgeTypes.js.map +1 -0
- package/lib/catalog/starDutyTypes.d.ts +22 -0
- package/lib/catalog/starDutyTypes.js +7 -0
- package/lib/catalog/starDutyTypes.js.map +1 -0
- package/lib/catalog/towerCatalog.d.ts +32 -0
- package/lib/catalog/towerCatalog.js +44 -0
- package/lib/catalog/towerCatalog.js.map +1 -0
- package/lib/engineBinding/binding.d.ts +36 -0
- package/lib/engineBinding/binding.js +90 -0
- package/lib/engineBinding/binding.js.map +1 -0
- package/lib/engineBinding/catalog.d.ts +24 -0
- package/lib/engineBinding/catalog.js +267 -0
- package/lib/engineBinding/catalog.js.map +1 -0
- package/lib/engineBinding/engine.d.ts +866 -0
- package/lib/engineBinding/exportTiers.d.ts +289 -0
- package/lib/engineBinding/exportTiers.js +283 -0
- package/lib/engineBinding/exportTiers.js.map +1 -0
- package/lib/engineBinding/toolingMethods.d.ts +12 -0
- package/lib/engineBinding/toolingMethods.js +20 -0
- package/lib/engineBinding/toolingMethods.js.map +1 -0
- package/lib/events/gameplayCatalog.d.ts +57 -0
- package/lib/events/gameplayCatalog.js +214 -0
- package/lib/events/gameplayCatalog.js.map +1 -0
- package/lib/events/gameplayEventRules.d.ts +4 -0
- package/lib/events/gameplayEventRules.js +32 -0
- package/lib/events/gameplayEventRules.js.map +1 -0
- package/lib/events/gameplayEvents.d.ts +284 -0
- package/lib/presentation/clockText.d.ts +28 -0
- package/lib/presentation/clockText.js +38 -0
- package/lib/presentation/clockText.js.map +1 -0
- package/lib/presentation/facilityPresentation.d.ts +20 -0
- package/lib/presentation/facilityPresentation.js +164 -0
- package/lib/presentation/facilityPresentation.js.map +1 -0
- package/lib/presentation/statsCopy.d.ts +20 -0
- package/lib/presentation/statsCopy.js +37 -0
- package/lib/presentation/statsCopy.js.map +1 -0
- package/lib/presentation/traffic.d.ts +75 -0
- package/lib/presentation/traffic.js +79 -0
- package/lib/presentation/traffic.js.map +1 -0
- package/lib/presentation/viewKinds.d.ts +33 -0
- package/lib/presentation/viewKinds.js +88 -0
- package/lib/presentation/viewKinds.js.map +1 -0
- package/lib/presentation/viewWorld.d.ts +29 -0
- package/lib/presentation/viewWorld.js +31 -0
- package/lib/presentation/viewWorld.js.map +1 -0
- package/lib/render/atlas/archive.d.ts +78 -0
- package/lib/render/atlas/archive.js +427 -0
- package/lib/render/atlas/archive.js.map +1 -0
- package/lib/render/atlas/bake.d.ts +132 -0
- package/lib/render/atlas/bake.js +331 -0
- package/lib/render/atlas/bake.js.map +1 -0
- package/lib/render/atlas/bakeAdditions.d.ts +24 -0
- package/lib/render/atlas/bakeAdditions.js +46 -0
- package/lib/render/atlas/bakeAdditions.js.map +1 -0
- package/lib/render/atlas/browserEntry.d.ts +12 -0
- package/lib/render/atlas/browserEntry.js +222 -0
- package/lib/render/atlas/browserEntry.js.map +1 -0
- package/lib/render/atlas/catalog.d.ts +118 -0
- package/lib/render/atlas/catalog.js +253 -0
- package/lib/render/atlas/catalog.js.map +1 -0
- package/lib/render/atlas/catalogExtras.d.ts +45 -0
- package/lib/render/atlas/catalogExtras.js +217 -0
- package/lib/render/atlas/catalogExtras.js.map +1 -0
- package/lib/render/atlas/compose.d.ts +30 -0
- package/lib/render/atlas/compose.js +125 -0
- package/lib/render/atlas/compose.js.map +1 -0
- package/lib/render/atlas/cycles.d.ts +25 -0
- package/lib/render/atlas/cycles.js +41 -0
- package/lib/render/atlas/cycles.js.map +1 -0
- package/lib/render/atlas/lookup.d.ts +65 -0
- package/lib/render/atlas/lookup.js +83 -0
- package/lib/render/atlas/lookup.js.map +1 -0
- package/lib/render/atlas/pack.d.ts +23 -0
- package/lib/render/atlas/pack.js +50 -0
- package/lib/render/atlas/pack.js.map +1 -0
- package/lib/render/atlas/paint.d.ts +120 -0
- package/lib/render/atlas/paint.js +154 -0
- package/lib/render/atlas/paint.js.map +1 -0
- package/lib/render/atlas/pixels.d.ts +46 -0
- package/lib/render/atlas/pixels.js +158 -0
- package/lib/render/atlas/pixels.js.map +1 -0
- package/lib/render/atlas/png.d.ts +3 -0
- package/lib/render/atlas/png.js +102 -0
- package/lib/render/atlas/png.js.map +1 -0
- package/lib/render/atlas/raster.d.ts +34 -0
- package/lib/render/atlas/raster.js +114 -0
- package/lib/render/atlas/raster.js.map +1 -0
- package/lib/render/atlas/recyclingFill.d.ts +5 -0
- package/lib/render/atlas/recyclingFill.js +65 -0
- package/lib/render/atlas/recyclingFill.js.map +1 -0
- package/lib/render/atlas/samples.d.ts +24 -0
- package/lib/render/atlas/samples.js +75 -0
- package/lib/render/atlas/samples.js.map +1 -0
- package/lib/render/atlas/scenery.d.ts +230 -0
- package/lib/render/atlas/scenery.js +242 -0
- package/lib/render/atlas/scenery.js.map +1 -0
- package/lib/render/atlas/schema.d.ts +189 -0
- package/lib/render/atlas/schema.js +31 -0
- package/lib/render/atlas/schema.js.map +1 -0
- package/lib/render/atlas/shellMarks.d.ts +16 -0
- package/lib/render/atlas/shellMarks.js +72 -0
- package/lib/render/atlas/shellMarks.js.map +1 -0
- package/lib/render/atlas/store.d.ts +75 -0
- package/lib/render/atlas/store.js +127 -0
- package/lib/render/atlas/store.js.map +1 -0
- package/lib/render/atlas/verify.d.ts +43 -0
- package/lib/render/atlas/verify.js +87 -0
- package/lib/render/atlas/verify.js.map +1 -0
- package/lib/render/atlas/verifyExtras.d.ts +19 -0
- package/lib/render/atlas/verifyExtras.js +310 -0
- package/lib/render/atlas/verifyExtras.js.map +1 -0
- package/lib/render/cameraBounds.d.ts +71 -0
- package/lib/render/cameraBounds.js +107 -0
- package/lib/render/cameraBounds.js.map +1 -0
- package/lib/render/carIndicator.d.ts +41 -0
- package/lib/render/carIndicator.js +45 -0
- package/lib/render/carIndicator.js.map +1 -0
- package/lib/render/carMotion.d.ts +33 -0
- package/lib/render/carMotion.js +42 -0
- package/lib/render/carMotion.js.map +1 -0
- package/lib/render/catalogScale.d.ts +40 -0
- package/lib/render/catalogScale.js +33 -0
- package/lib/render/catalogScale.js.map +1 -0
- package/lib/render/climbPath.d.ts +59 -0
- package/lib/render/climbPath.js +115 -0
- package/lib/render/climbPath.js.map +1 -0
- package/lib/render/depthPlanes.d.ts +55 -0
- package/lib/render/depthPlanes.js +58 -0
- package/lib/render/depthPlanes.js.map +1 -0
- package/lib/render/excalibur/TowerEngine.d.ts +348 -0
- package/lib/render/excalibur/TowerEngine.js +415 -0
- package/lib/render/excalibur/TowerEngine.js.map +1 -0
- package/lib/render/excalibur/cabGraphics.d.ts +75 -0
- package/lib/render/excalibur/cabGraphics.js +108 -0
- package/lib/render/excalibur/cabGraphics.js.map +1 -0
- package/lib/render/excalibur/cabParts.d.ts +32 -0
- package/lib/render/excalibur/cabParts.js +79 -0
- package/lib/render/excalibur/cabParts.js.map +1 -0
- package/lib/render/excalibur/cabRiders.d.ts +72 -0
- package/lib/render/excalibur/cabRiders.js +176 -0
- package/lib/render/excalibur/cabRiders.js.map +1 -0
- package/lib/render/excalibur/crowdCull.d.ts +34 -0
- package/lib/render/excalibur/crowdCull.js +72 -0
- package/lib/render/excalibur/crowdCull.js.map +1 -0
- package/lib/render/excalibur/crowdFigure.d.ts +42 -0
- package/lib/render/excalibur/crowdFigure.js +99 -0
- package/lib/render/excalibur/crowdFigure.js.map +1 -0
- package/lib/render/excalibur/crowdLook.d.ts +137 -0
- package/lib/render/excalibur/crowdLook.js +186 -0
- package/lib/render/excalibur/crowdLook.js.map +1 -0
- package/lib/render/excalibur/frameHold.d.ts +23 -0
- package/lib/render/excalibur/frameHold.js +30 -0
- package/lib/render/excalibur/frameHold.js.map +1 -0
- package/lib/render/excalibur/guardPosition.d.ts +17 -0
- package/lib/render/excalibur/guardPosition.js +37 -0
- package/lib/render/excalibur/guardPosition.js.map +1 -0
- package/lib/render/excalibur/keyboardHost.d.ts +15 -0
- package/lib/render/excalibur/keyboardHost.js +22 -0
- package/lib/render/excalibur/keyboardHost.js.map +1 -0
- package/lib/render/excalibur/longPress.d.ts +16 -0
- package/lib/render/excalibur/longPress.js +71 -0
- package/lib/render/excalibur/longPress.js.map +1 -0
- package/lib/render/excalibur/peopleGfx.d.ts +16 -0
- package/lib/render/excalibur/peopleGfx.js +46 -0
- package/lib/render/excalibur/peopleGfx.js.map +1 -0
- package/lib/render/excalibur/peopleWindow.d.ts +35 -0
- package/lib/render/excalibur/peopleWindow.js +38 -0
- package/lib/render/excalibur/peopleWindow.js.map +1 -0
- package/lib/render/excalibur/personFocus.d.ts +36 -0
- package/lib/render/excalibur/personFocus.js +169 -0
- package/lib/render/excalibur/personFocus.js.map +1 -0
- package/lib/render/excalibur/pointerButtonGuard.d.ts +35 -0
- package/lib/render/excalibur/pointerButtonGuard.js +86 -0
- package/lib/render/excalibur/pointerButtonGuard.js.map +1 -0
- package/lib/render/excalibur/pressLifecycle.d.ts +26 -0
- package/lib/render/excalibur/pressLifecycle.js +66 -0
- package/lib/render/excalibur/pressLifecycle.js.map +1 -0
- package/lib/render/excalibur/rainShelter.d.ts +16 -0
- package/lib/render/excalibur/rainShelter.js +94 -0
- package/lib/render/excalibur/rainShelter.js.map +1 -0
- package/lib/render/excalibur/roomSignature.d.ts +30 -0
- package/lib/render/excalibur/roomSignature.js +49 -0
- package/lib/render/excalibur/roomSignature.js.map +1 -0
- package/lib/render/excalibur/sceneBake.d.ts +9 -0
- package/lib/render/excalibur/sceneBake.js +12 -0
- package/lib/render/excalibur/sceneBake.js.map +1 -0
- package/lib/render/excalibur/thiefSpan.d.ts +18 -0
- package/lib/render/excalibur/thiefSpan.js +51 -0
- package/lib/render/excalibur/thiefSpan.js.map +1 -0
- package/lib/render/excalibur/towerBridgeTiles.d.ts +30 -0
- package/lib/render/excalibur/towerBridgeTiles.js +43 -0
- package/lib/render/excalibur/towerBridgeTiles.js.map +1 -0
- package/lib/render/excalibur/towerCrowd.d.ts +73 -0
- package/lib/render/excalibur/towerCrowd.js +464 -0
- package/lib/render/excalibur/towerCrowd.js.map +1 -0
- package/lib/render/excalibur/towerCrowdLayout.d.ts +40 -0
- package/lib/render/excalibur/towerCrowdLayout.js +77 -0
- package/lib/render/excalibur/towerCrowdLayout.js.map +1 -0
- package/lib/render/excalibur/towerFireResponse.d.ts +25 -0
- package/lib/render/excalibur/towerFireResponse.js +89 -0
- package/lib/render/excalibur/towerFireResponse.js.map +1 -0
- package/lib/render/excalibur/towerFrame.d.ts +8 -0
- package/lib/render/excalibur/towerFrame.js +57 -0
- package/lib/render/excalibur/towerFrame.js.map +1 -0
- package/lib/render/excalibur/towerGhostLabel.d.ts +9 -0
- package/lib/render/excalibur/towerGhostLabel.js +37 -0
- package/lib/render/excalibur/towerGhostLabel.js.map +1 -0
- package/lib/render/excalibur/towerHallDoors.d.ts +42 -0
- package/lib/render/excalibur/towerHallDoors.js +129 -0
- package/lib/render/excalibur/towerHallDoors.js.map +1 -0
- package/lib/render/excalibur/towerHaloRings.d.ts +34 -0
- package/lib/render/excalibur/towerHaloRings.js +45 -0
- package/lib/render/excalibur/towerHaloRings.js.map +1 -0
- package/lib/render/excalibur/towerInputCamera.d.ts +90 -0
- package/lib/render/excalibur/towerInputCamera.js +480 -0
- package/lib/render/excalibur/towerInputCamera.js.map +1 -0
- package/lib/render/excalibur/towerMetro.d.ts +31 -0
- package/lib/render/excalibur/towerMetro.js +115 -0
- package/lib/render/excalibur/towerMetro.js.map +1 -0
- package/lib/render/excalibur/towerNoiseReach.d.ts +32 -0
- package/lib/render/excalibur/towerNoiseReach.js +75 -0
- package/lib/render/excalibur/towerNoiseReach.js.map +1 -0
- package/lib/render/excalibur/towerOverlay.d.ts +59 -0
- package/lib/render/excalibur/towerOverlay.js +453 -0
- package/lib/render/excalibur/towerOverlay.js.map +1 -0
- package/lib/render/excalibur/towerReconcile.d.ts +17 -0
- package/lib/render/excalibur/towerReconcile.js +404 -0
- package/lib/render/excalibur/towerReconcile.js.map +1 -0
- package/lib/render/excalibur/towerRegions.d.ts +61 -0
- package/lib/render/excalibur/towerRegions.js +193 -0
- package/lib/render/excalibur/towerRegions.js.map +1 -0
- package/lib/render/excalibur/towerScene.d.ts +66 -0
- package/lib/render/excalibur/towerScene.js +443 -0
- package/lib/render/excalibur/towerScene.js.map +1 -0
- package/lib/render/excalibur/towerScenery.d.ts +12 -0
- package/lib/render/excalibur/towerScenery.js +299 -0
- package/lib/render/excalibur/towerScenery.js.map +1 -0
- package/lib/render/excalibur/towerSceneryDraw.d.ts +86 -0
- package/lib/render/excalibur/towerSceneryDraw.js +288 -0
- package/lib/render/excalibur/towerSceneryDraw.js.map +1 -0
- package/lib/render/excalibur/towerShaftNumbers.d.ts +23 -0
- package/lib/render/excalibur/towerShaftNumbers.js +90 -0
- package/lib/render/excalibur/towerShaftNumbers.js.map +1 -0
- package/lib/render/excalibur/towerStructTiles.d.ts +56 -0
- package/lib/render/excalibur/towerStructTiles.js +238 -0
- package/lib/render/excalibur/towerStructTiles.js.map +1 -0
- package/lib/render/excalibur/towerSyncSchedule.d.ts +84 -0
- package/lib/render/excalibur/towerSyncSchedule.js +137 -0
- package/lib/render/excalibur/towerSyncSchedule.js.map +1 -0
- package/lib/render/excalibur/towerWalkerBuild.d.ts +30 -0
- package/lib/render/excalibur/towerWalkerBuild.js +126 -0
- package/lib/render/excalibur/towerWalkerBuild.js.map +1 -0
- package/lib/render/excalibur/trafficSpotlight.d.ts +29 -0
- package/lib/render/excalibur/trafficSpotlight.js +64 -0
- package/lib/render/excalibur/trafficSpotlight.js.map +1 -0
- package/lib/render/facadeGeometry.d.ts +50 -0
- package/lib/render/facadeGeometry.js +79 -0
- package/lib/render/facadeGeometry.js.map +1 -0
- package/lib/render/groundEntrances.d.ts +44 -0
- package/lib/render/groundEntrances.js +118 -0
- package/lib/render/groundEntrances.js.map +1 -0
- package/lib/render/lateNight.d.ts +14 -0
- package/lib/render/lateNight.js +18 -0
- package/lib/render/lateNight.js.map +1 -0
- package/lib/render/lobbyHalls.d.ts +44 -0
- package/lib/render/lobbyHalls.js +63 -0
- package/lib/render/lobbyHalls.js.map +1 -0
- package/lib/render/metroTrainSchedule.d.ts +20 -0
- package/lib/render/metroTrainSchedule.js +65 -0
- package/lib/render/metroTrainSchedule.js.map +1 -0
- package/lib/render/overviewMap/drawList.d.ts +67 -0
- package/lib/render/overviewMap/drawList.js +103 -0
- package/lib/render/overviewMap/drawList.js.map +1 -0
- package/lib/render/overviewMap/extent.d.ts +70 -0
- package/lib/render/overviewMap/extent.js +155 -0
- package/lib/render/overviewMap/extent.js.map +1 -0
- package/lib/render/overviewMap/floorSpans.d.ts +27 -0
- package/lib/render/overviewMap/floorSpans.js +32 -0
- package/lib/render/overviewMap/floorSpans.js.map +1 -0
- package/lib/render/overviewMap/gaps.d.ts +48 -0
- package/lib/render/overviewMap/gaps.js +148 -0
- package/lib/render/overviewMap/gaps.js.map +1 -0
- package/lib/render/overviewMap/geometry.d.ts +139 -0
- package/lib/render/overviewMap/geometry.js +245 -0
- package/lib/render/overviewMap/geometry.js.map +1 -0
- package/lib/render/overviewMap/heatView.d.ts +91 -0
- package/lib/render/overviewMap/heatView.js +143 -0
- package/lib/render/overviewMap/heatView.js.map +1 -0
- package/lib/render/overviewMap/hotelView.d.ts +82 -0
- package/lib/render/overviewMap/hotelView.js +136 -0
- package/lib/render/overviewMap/hotelView.js.map +1 -0
- package/lib/render/overviewMap/model.d.ts +97 -0
- package/lib/render/overviewMap/model.js +116 -0
- package/lib/render/overviewMap/model.js.map +1 -0
- package/lib/render/overviewMap/paint.d.ts +63 -0
- package/lib/render/overviewMap/paint.js +168 -0
- package/lib/render/overviewMap/paint.js.map +1 -0
- package/lib/render/overviewMap/style.d.ts +46 -0
- package/lib/render/overviewMap/style.js +117 -0
- package/lib/render/overviewMap/style.js.map +1 -0
- package/lib/render/overviewMap/tierView.d.ts +103 -0
- package/lib/render/overviewMap/tierView.js +209 -0
- package/lib/render/overviewMap/tierView.js.map +1 -0
- package/lib/render/overviewMap/viewMark.d.ts +69 -0
- package/lib/render/overviewMap/viewMark.js +103 -0
- package/lib/render/overviewMap/viewMark.js.map +1 -0
- package/lib/render/overviewMap/views.d.ts +24 -0
- package/lib/render/overviewMap/views.js +29 -0
- package/lib/render/overviewMap/views.js.map +1 -0
- package/lib/render/pinchTracker.d.ts +91 -0
- package/lib/render/pinchTracker.js +145 -0
- package/lib/render/pinchTracker.js.map +1 -0
- package/lib/render/pixelSprites/amusements.d.ts +32 -0
- package/lib/render/pixelSprites/amusements.js +243 -0
- package/lib/render/pixelSprites/amusements.js.map +1 -0
- package/lib/render/pixelSprites/artScale.d.ts +97 -0
- package/lib/render/pixelSprites/artScale.js +151 -0
- package/lib/render/pixelSprites/artScale.js.map +1 -0
- package/lib/render/pixelSprites/boutique.d.ts +30 -0
- package/lib/render/pixelSprites/boutique.js +244 -0
- package/lib/render/pixelSprites/boutique.js.map +1 -0
- package/lib/render/pixelSprites/clinic.d.ts +30 -0
- package/lib/render/pixelSprites/clinic.js +184 -0
- package/lib/render/pixelSprites/clinic.js.map +1 -0
- package/lib/render/pixelSprites/common.d.ts +185 -0
- package/lib/render/pixelSprites/common.js +449 -0
- package/lib/render/pixelSprites/common.js.map +1 -0
- package/lib/render/pixelSprites/daycare.d.ts +3 -0
- package/lib/render/pixelSprites/daycare.js +99 -0
- package/lib/render/pixelSprites/daycare.js.map +1 -0
- package/lib/render/pixelSprites/dollhouse.d.ts +45 -0
- package/lib/render/pixelSprites/dollhouse.js +110 -0
- package/lib/render/pixelSprites/dollhouse.js.map +1 -0
- package/lib/render/pixelSprites/fitness.d.ts +30 -0
- package/lib/render/pixelSprites/fitness.js +176 -0
- package/lib/render/pixelSprites/fitness.js.map +1 -0
- package/lib/render/pixelSprites/food.d.ts +27 -0
- package/lib/render/pixelSprites/food.interiors.d.ts +38 -0
- package/lib/render/pixelSprites/food.interiors.js +516 -0
- package/lib/render/pixelSprites/food.interiors.js.map +1 -0
- package/lib/render/pixelSprites/food.js +36 -0
- package/lib/render/pixelSprites/food.js.map +1 -0
- package/lib/render/pixelSprites/food.kit.d.ts +50 -0
- package/lib/render/pixelSprites/food.kit.js +140 -0
- package/lib/render/pixelSprites/food.kit.js.map +1 -0
- package/lib/render/pixelSprites/food.looks.d.ts +45 -0
- package/lib/render/pixelSprites/food.looks.js +56 -0
- package/lib/render/pixelSprites/food.looks.js.map +1 -0
- package/lib/render/pixelSprites/layers.d.ts +49 -0
- package/lib/render/pixelSprites/layers.js +61 -0
- package/lib/render/pixelSprites/layers.js.map +1 -0
- package/lib/render/pixelSprites/nightclub.d.ts +3 -0
- package/lib/render/pixelSprites/nightclub.js +108 -0
- package/lib/render/pixelSprites/nightclub.js.map +1 -0
- package/lib/render/pixelSprites/people.d.ts +168 -0
- package/lib/render/pixelSprites/people.js +431 -0
- package/lib/render/pixelSprites/people.js.map +1 -0
- package/lib/render/pixelSprites/residential.d.ts +5 -0
- package/lib/render/pixelSprites/residential.js +506 -0
- package/lib/render/pixelSprites/residential.js.map +1 -0
- package/lib/render/pixelSprites/residential.looks.d.ts +40 -0
- package/lib/render/pixelSprites/residential.looks.js +43 -0
- package/lib/render/pixelSprites/residential.looks.js.map +1 -0
- package/lib/render/pixelSprites/residential.roaches.d.ts +38 -0
- package/lib/render/pixelSprites/residential.roaches.js +88 -0
- package/lib/render/pixelSprites/residential.roaches.js.map +1 -0
- package/lib/render/pixelSprites/residentialRentalSprites.d.ts +11 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js +19 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js.map +1 -0
- package/lib/render/pixelSprites/shop.d.ts +14 -0
- package/lib/render/pixelSprites/shop.interiors.d.ts +50 -0
- package/lib/render/pixelSprites/shop.interiors.js +382 -0
- package/lib/render/pixelSprites/shop.interiors.js.map +1 -0
- package/lib/render/pixelSprites/shop.js +72 -0
- package/lib/render/pixelSprites/shop.js.map +1 -0
- package/lib/render/pixelSprites/shop.looks.d.ts +17 -0
- package/lib/render/pixelSprites/shop.looks.js +24 -0
- package/lib/render/pixelSprites/shop.looks.js.map +1 -0
- package/lib/render/pixelSprites/skyBar.d.ts +11 -0
- package/lib/render/pixelSprites/skyBar.js +125 -0
- package/lib/render/pixelSprites/skyBar.js.map +1 -0
- package/lib/render/pixelSprites/spa.d.ts +3 -0
- package/lib/render/pixelSprites/spa.js +88 -0
- package/lib/render/pixelSprites/spa.js.map +1 -0
- package/lib/render/pixelSprites.d.ts +33 -0
- package/lib/render/pixelSprites.js +167 -0
- package/lib/render/pixelSprites.js.map +1 -0
- package/lib/render/regionGrid.d.ts +49 -0
- package/lib/render/regionGrid.js +82 -0
- package/lib/render/regionGrid.js.map +1 -0
- package/lib/render/regionPaint.d.ts +15 -0
- package/lib/render/regionPaint.js +33 -0
- package/lib/render/regionPaint.js.map +1 -0
- package/lib/render/renderSim.d.ts +104 -0
- package/lib/render/renderSim.js +2 -0
- package/lib/render/renderSim.js.map +1 -0
- package/lib/render/roomPortrait.d.ts +35 -0
- package/lib/render/roomPortrait.js +142 -0
- package/lib/render/roomPortrait.js.map +1 -0
- package/lib/render/roomShading.d.ts +29 -0
- package/lib/render/roomShading.js +43 -0
- package/lib/render/roomShading.js.map +1 -0
- package/lib/render/scale.d.ts +31 -0
- package/lib/render/scale.js +34 -0
- package/lib/render/scale.js.map +1 -0
- package/lib/render/sceneryLayout.d.ts +234 -0
- package/lib/render/sceneryLayout.js +199 -0
- package/lib/render/sceneryLayout.js.map +1 -0
- package/lib/render/sprites/common.d.ts +41 -0
- package/lib/render/sprites/common.js +46 -0
- package/lib/render/sprites/common.js.map +1 -0
- package/lib/render/sprites/escalator.d.ts +27 -0
- package/lib/render/sprites/escalator.js +156 -0
- package/lib/render/sprites/escalator.js.map +1 -0
- package/lib/render/sprites/events.d.ts +56 -0
- package/lib/render/sprites/events.js +280 -0
- package/lib/render/sprites/events.js.map +1 -0
- package/lib/render/sprites/facilities/garage.d.ts +23 -0
- package/lib/render/sprites/facilities/garage.js +230 -0
- package/lib/render/sprites/facilities/garage.js.map +1 -0
- package/lib/render/sprites/facilities/recycling.d.ts +3 -0
- package/lib/render/sprites/facilities/recycling.js +210 -0
- package/lib/render/sprites/facilities/recycling.js.map +1 -0
- package/lib/render/sprites/facilities/recyclingLook.d.ts +49 -0
- package/lib/render/sprites/facilities/recyclingLook.js +52 -0
- package/lib/render/sprites/facilities/recyclingLook.js.map +1 -0
- package/lib/render/sprites/facilities/service.d.ts +14 -0
- package/lib/render/sprites/facilities/service.js +437 -0
- package/lib/render/sprites/facilities/service.js.map +1 -0
- package/lib/render/sprites/facilities/serviceKit.d.ts +61 -0
- package/lib/render/sprites/facilities/serviceKit.js +113 -0
- package/lib/render/sprites/facilities/serviceKit.js.map +1 -0
- package/lib/render/sprites/facilities/vehicles.d.ts +38 -0
- package/lib/render/sprites/facilities/vehicles.js +276 -0
- package/lib/render/sprites/facilities/vehicles.js.map +1 -0
- package/lib/render/sprites/facilities/venue.d.ts +28 -0
- package/lib/render/sprites/facilities/venue.js +211 -0
- package/lib/render/sprites/facilities/venue.js.map +1 -0
- package/lib/render/sprites/facilities/weddingHall.d.ts +9 -0
- package/lib/render/sprites/facilities/weddingHall.js +410 -0
- package/lib/render/sprites/facilities/weddingHall.js.map +1 -0
- package/lib/render/sprites/facilities.d.ts +22 -0
- package/lib/render/sprites/facilities.js +24 -0
- package/lib/render/sprites/facilities.js.map +1 -0
- package/lib/render/sprites/helicopter.d.ts +11 -0
- package/lib/render/sprites/helicopter.js +60 -0
- package/lib/render/sprites/helicopter.js.map +1 -0
- package/lib/render/sprites/sky.d.ts +67 -0
- package/lib/render/sprites/sky.js +85 -0
- package/lib/render/sprites/sky.js.map +1 -0
- package/lib/render/sprites/spiralStair.d.ts +19 -0
- package/lib/render/sprites/spiralStair.js +111 -0
- package/lib/render/sprites/spiralStair.js.map +1 -0
- package/lib/render/sprites/structure/entrance.d.ts +35 -0
- package/lib/render/sprites/structure/entrance.js +347 -0
- package/lib/render/sprites/structure/entrance.js.map +1 -0
- package/lib/render/sprites/structure/lobby.d.ts +88 -0
- package/lib/render/sprites/structure/lobby.js +350 -0
- package/lib/render/sprites/structure/lobby.js.map +1 -0
- package/lib/render/sprites/structure/revolvingDoor.d.ts +53 -0
- package/lib/render/sprites/structure/revolvingDoor.js +184 -0
- package/lib/render/sprites/structure/revolvingDoor.js.map +1 -0
- package/lib/render/sprites/structure/rooftop.d.ts +93 -0
- package/lib/render/sprites/structure/rooftop.js +302 -0
- package/lib/render/sprites/structure/rooftop.js.map +1 -0
- package/lib/render/sprites/structure/shell.d.ts +19 -0
- package/lib/render/sprites/structure/shell.js +142 -0
- package/lib/render/sprites/structure/shell.js.map +1 -0
- package/lib/render/sprites/structure/skyBridge.d.ts +28 -0
- package/lib/render/sprites/structure/skyBridge.js +259 -0
- package/lib/render/sprites/structure/skyBridge.js.map +1 -0
- package/lib/render/sprites/structure/tallLobby.d.ts +8 -0
- package/lib/render/sprites/structure/tallLobby.js +166 -0
- package/lib/render/sprites/structure/tallLobby.js.map +1 -0
- package/lib/render/sprites/structure/tallLobbyPieces.d.ts +18 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js +82 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js.map +1 -0
- package/lib/render/sprites/structure.d.ts +15 -0
- package/lib/render/sprites/structure.js +16 -0
- package/lib/render/sprites/structure.js.map +1 -0
- package/lib/render/sprites/transport.d.ts +30 -0
- package/lib/render/sprites/transport.js +376 -0
- package/lib/render/sprites/transport.js.map +1 -0
- package/lib/render/sprites.d.ts +16 -0
- package/lib/render/sprites.js +108 -0
- package/lib/render/sprites.js.map +1 -0
- package/lib/render/venueFlights.d.ts +61 -0
- package/lib/render/venueFlights.js +50 -0
- package/lib/render/venueFlights.js.map +1 -0
- package/lib/shared/engineTypes.d.ts +256 -0
- package/lib/shared/engineTypes.js +8 -0
- package/lib/shared/engineTypes.js.map +1 -0
- package/lib/shared/floorRuns.d.ts +22 -0
- package/lib/shared/floorRuns.js +39 -0
- package/lib/shared/floorRuns.js.map +1 -0
- package/lib/shared/inputEvents.d.ts +18 -0
- package/lib/shared/inputEvents.js +23 -0
- package/lib/shared/inputEvents.js.map +1 -0
- package/lib/shared/serializedGame.d.ts +142 -0
- package/lib/shared/serializedGame.js +2 -0
- package/lib/shared/serializedGame.js.map +1 -0
- package/lib/shared/types.d.ts +298 -0
- package/lib/shared/types.js +47 -0
- package/lib/shared/types.js.map +1 -0
- package/lib/shared/unitState.d.ts +36 -0
- package/lib/shared/unitState.js +42 -0
- package/lib/shared/unitState.js.map +1 -0
- package/lib/shared/vacateReasonText.d.ts +20 -0
- package/lib/shared/vacateReasonText.js +23 -0
- package/lib/shared/vacateReasonText.js.map +1 -0
- package/lib/shared/viewZoom.d.ts +14 -0
- package/lib/shared/viewZoom.js +17 -0
- package/lib/shared/viewZoom.js.map +1 -0
- package/lib/shared/wellFormed.d.ts +14 -0
- package/lib/shared/wellFormed.js +19 -0
- package/lib/shared/wellFormed.js.map +1 -0
- package/lib/simport/cards.d.ts +26 -0
- package/lib/simport/cards.js +138 -0
- package/lib/simport/cards.js.map +1 -0
- package/lib/simport/clockView.d.ts +24 -0
- package/lib/simport/clockView.js +43 -0
- package/lib/simport/clockView.js.map +1 -0
- package/lib/simport/commands.d.ts +215 -0
- package/lib/simport/commands.js +2 -0
- package/lib/simport/commands.js.map +1 -0
- package/lib/simport/emergencyReads.d.ts +19 -0
- package/lib/simport/emergencyReads.js +47 -0
- package/lib/simport/emergencyReads.js.map +1 -0
- package/lib/simport/enginePort.d.ts +433 -0
- package/lib/simport/enginePort.js +11 -0
- package/lib/simport/enginePort.js.map +1 -0
- package/lib/simport/fixtures/catalog.classic.json +2137 -0
- package/lib/simport/fixtures/catalog.modern.json +2515 -0
- package/lib/simport/fixtures/viewLayout.json +927 -0
- package/lib/simport/headerClock.d.ts +31 -0
- package/lib/simport/headerClock.js +29 -0
- package/lib/simport/headerClock.js.map +1 -0
- package/lib/simport/panels.d.ts +243 -0
- package/lib/simport/panels.js +2 -0
- package/lib/simport/panels.js.map +1 -0
- package/lib/simport/personCards.d.ts +63 -0
- package/lib/simport/personCards.js +55 -0
- package/lib/simport/personCards.js.map +1 -0
- package/lib/simport/portCodes.d.ts +41 -0
- package/lib/simport/portCodes.js +49 -0
- package/lib/simport/portCodes.js.map +1 -0
- package/lib/simport/portEvents.d.ts +39 -0
- package/lib/simport/portEvents.js +43 -0
- package/lib/simport/portEvents.js.map +1 -0
- package/lib/simport/portRenderSim.d.ts +70 -0
- package/lib/simport/portRenderSim.js +129 -0
- package/lib/simport/portRenderSim.js.map +1 -0
- package/lib/simport/queries.d.ts +64 -0
- package/lib/simport/queries.js +30 -0
- package/lib/simport/queries.js.map +1 -0
- package/lib/simport/recyclingPort.d.ts +13 -0
- package/lib/simport/recyclingPort.js +2 -0
- package/lib/simport/recyclingPort.js.map +1 -0
- package/lib/simport/request.d.ts +44 -0
- package/lib/simport/request.js +214 -0
- package/lib/simport/request.js.map +1 -0
- package/lib/simport/roomTiers.d.ts +102 -0
- package/lib/simport/roomTiers.js +122 -0
- package/lib/simport/roomTiers.js.map +1 -0
- package/lib/simport/scheduleSlots.d.ts +19 -0
- package/lib/simport/scheduleSlots.js +87 -0
- package/lib/simport/scheduleSlots.js.map +1 -0
- package/lib/simport/skyBridgePort.d.ts +20 -0
- package/lib/simport/skyBridgePort.js +2 -0
- package/lib/simport/skyBridgePort.js.map +1 -0
- package/lib/simport/skyBridgeView.d.ts +15 -0
- package/lib/simport/skyBridgeView.js +42 -0
- package/lib/simport/skyBridgeView.js.map +1 -0
- package/lib/simport/statsSheet.d.ts +15 -0
- package/lib/simport/statsSheet.js +101 -0
- package/lib/simport/statsSheet.js.map +1 -0
- package/lib/simport/tdtRecords.d.ts +9 -0
- package/lib/simport/tdtRecords.js +112 -0
- package/lib/simport/tdtRecords.js.map +1 -0
- package/lib/simport/tdtReportFacts.d.ts +110 -0
- package/lib/simport/tdtReportFacts.js +8 -0
- package/lib/simport/tdtReportFacts.js.map +1 -0
- package/lib/simport/trafficPort.d.ts +22 -0
- package/lib/simport/trafficPort.js +2 -0
- package/lib/simport/trafficPort.js.map +1 -0
- package/lib/simport/view.d.ts +275 -0
- package/lib/simport/view.js +2 -0
- package/lib/simport/view.js.map +1 -0
- package/lib/simport/viewReader.d.ts +89 -0
- package/lib/simport/viewReader.js +426 -0
- package/lib/simport/viewReader.js.map +1 -0
- package/lib/styles/game/appearance.css +108 -0
- package/lib/styles/game/base.css +68 -0
- package/lib/styles/game/components.css +69 -0
- package/lib/styles/game/desk-title.css +183 -0
- package/lib/styles/game/desk.css +487 -0
- package/lib/styles/game/dialogs.css +360 -0
- package/lib/styles/game/editor-sidebar.css +116 -0
- package/lib/styles/game/elevator-schedule.css +217 -0
- package/lib/styles/game/file-dialog.css +470 -0
- package/lib/styles/game/help.css +141 -0
- package/lib/styles/game/launch-fireworks.css +17 -0
- package/lib/styles/game/media-landscape.css +333 -0
- package/lib/styles/game/media-phone.css +303 -0
- package/lib/styles/game/media-tablet-touch.css +177 -0
- package/lib/styles/game/menubar.css +158 -0
- package/lib/styles/game/new-tower.css +219 -0
- package/lib/styles/game/onboarding.css +32 -0
- package/lib/styles/game/screen-saver.css +85 -0
- package/lib/styles/game/splash.css +413 -0
- package/lib/styles/game/stats-saves.css +106 -0
- package/lib/styles/game/tools-stage.css +340 -0
- package/lib/styles/game/topbar.css +191 -0
- package/lib/styles/menu-bar.css +108 -0
- package/lib/styles/not-found.css +335 -0
- package/lib/styles/overview-map-views.css +88 -0
- package/lib/styles/overview-map.css +195 -0
- package/lib/styles/retro-components.css +179 -0
- package/lib/styles/retro-page.css +254 -0
- package/lib/styles/retro-tokens.css +122 -0
- package/lib/styles/schemes/high-contrast.css +173 -0
- package/lib/styles/schemes/skyline.css +134 -0
- package/lib/styles.css +66 -0
- package/lib/ui/desk/deskGeometry.d.ts +59 -0
- package/lib/ui/desk/deskGeometry.js +106 -0
- package/lib/ui/desk/deskGeometry.js.map +1 -0
- package/lib/ui/desk/deskWindow.d.ts +90 -0
- package/lib/ui/desk/deskWindow.js +253 -0
- package/lib/ui/desk/deskWindow.js.map +1 -0
- package/lib/ui/desk/deskWindowMenu.d.ts +55 -0
- package/lib/ui/desk/deskWindowMenu.js +143 -0
- package/lib/ui/desk/deskWindowMenu.js.map +1 -0
- package/lib/ui/escape.d.ts +1 -0
- package/lib/ui/escape.js +14 -0
- package/lib/ui/escape.js.map +1 -0
- package/lib/ui/format.d.ts +14 -0
- package/lib/ui/format.js +36 -0
- package/lib/ui/format.js.map +1 -0
- package/lib/ui/iconPaths.generated.d.ts +4 -0
- package/lib/ui/iconPaths.generated.js +68 -0
- package/lib/ui/iconPaths.generated.js.map +1 -0
- package/lib/ui/icons.d.ts +83 -0
- package/lib/ui/icons.js +156 -0
- package/lib/ui/icons.js.map +1 -0
- package/lib/ui/menuBar.d.ts +94 -0
- package/lib/ui/menuBar.js +361 -0
- package/lib/ui/menuBar.js.map +1 -0
- package/lib/ui/modalPrecedence.d.ts +108 -0
- package/lib/ui/modalPrecedence.js +165 -0
- package/lib/ui/modalPrecedence.js.map +1 -0
- package/lib/ui/movableWindow.d.ts +124 -0
- package/lib/ui/movableWindow.js +247 -0
- package/lib/ui/movableWindow.js.map +1 -0
- package/lib/ui/overviewMapInput.d.ts +109 -0
- package/lib/ui/overviewMapInput.js +135 -0
- package/lib/ui/overviewMapInput.js.map +1 -0
- package/lib/ui/uiModal.d.ts +38 -0
- package/lib/ui/uiModal.js +70 -0
- package/lib/ui/uiModal.js.map +1 -0
- package/lib/wasmhost/buildSection.d.ts +54 -0
- package/lib/wasmhost/buildSection.js +143 -0
- package/lib/wasmhost/buildSection.js.map +1 -0
- package/lib/wasmhost/catalogCheck.d.ts +11 -0
- package/lib/wasmhost/catalogCheck.js +43 -0
- package/lib/wasmhost/catalogCheck.js.map +1 -0
- package/lib/wasmhost/engineAssets.d.ts +57 -0
- package/lib/wasmhost/engineAssets.js +63 -0
- package/lib/wasmhost/engineAssets.js.map +1 -0
- package/lib/wasmhost/engineBoot.d.ts +165 -0
- package/lib/wasmhost/engineBoot.js +254 -0
- package/lib/wasmhost/engineBoot.js.map +1 -0
- package/lib/wasmhost/engineChoice.d.ts +6 -0
- package/lib/wasmhost/engineChoice.js +2 -0
- package/lib/wasmhost/engineChoice.js.map +1 -0
- package/lib/wasmhost/engineDiagnostics.d.ts +66 -0
- package/lib/wasmhost/engineDiagnostics.js +189 -0
- package/lib/wasmhost/engineDiagnostics.js.map +1 -0
- package/lib/wasmhost/engineDiagnosticsLive.d.ts +15 -0
- package/lib/wasmhost/engineDiagnosticsLive.js +31 -0
- package/lib/wasmhost/engineDiagnosticsLive.js.map +1 -0
- package/lib/wasmhost/engineIdentity.d.ts +30 -0
- package/lib/wasmhost/engineIdentity.js +59 -0
- package/lib/wasmhost/engineIdentity.js.map +1 -0
- package/lib/wasmhost/engineLabel.d.ts +40 -0
- package/lib/wasmhost/engineLabel.js +50 -0
- package/lib/wasmhost/engineLabel.js.map +1 -0
- package/lib/wasmhost/engineLoad.d.ts +48 -0
- package/lib/wasmhost/engineLoad.js +53 -0
- package/lib/wasmhost/engineLoad.js.map +1 -0
- package/lib/wasmhost/enginePackageCheck.d.ts +77 -0
- package/lib/wasmhost/enginePackageCheck.js +274 -0
- package/lib/wasmhost/enginePackageCheck.js.map +1 -0
- package/lib/wasmhost/enginePackageNames.d.ts +25 -0
- package/lib/wasmhost/enginePackageNames.js +28 -0
- package/lib/wasmhost/enginePackageNames.js.map +1 -0
- package/lib/wasmhost/enginePackageRecord.d.ts +78 -0
- package/lib/wasmhost/enginePackageRecord.js +108 -0
- package/lib/wasmhost/enginePackageRecord.js.map +1 -0
- package/lib/wasmhost/engineRepair.d.ts +55 -0
- package/lib/wasmhost/engineRepair.js +183 -0
- package/lib/wasmhost/engineRepair.js.map +1 -0
- package/lib/wasmhost/frameView.d.ts +87 -0
- package/lib/wasmhost/frameView.js +133 -0
- package/lib/wasmhost/frameView.js.map +1 -0
- package/lib/wasmhost/hostFault.d.ts +40 -0
- package/lib/wasmhost/hostFault.js +94 -0
- package/lib/wasmhost/hostFault.js.map +1 -0
- package/lib/wasmhost/loadEngineModule.d.ts +79 -0
- package/lib/wasmhost/loadEngineModule.js +66 -0
- package/lib/wasmhost/loadEngineModule.js.map +1 -0
- package/lib/wasmhost/packageHash.d.ts +48 -0
- package/lib/wasmhost/packageHash.js +436 -0
- package/lib/wasmhost/packageHash.js.map +1 -0
- package/lib/wasmhost/rustEngine.d.ts +49 -0
- package/lib/wasmhost/rustEngine.js +63 -0
- package/lib/wasmhost/rustEngine.js.map +1 -0
- package/lib/wasmhost/slotPopulation.d.ts +19 -0
- package/lib/wasmhost/slotPopulation.js +69 -0
- package/lib/wasmhost/slotPopulation.js.map +1 -0
- package/lib/wasmhost/telemetry.d.ts +31 -0
- package/lib/wasmhost/telemetry.js +13 -0
- package/lib/wasmhost/telemetry.js.map +1 -0
- package/package.json +80 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as Tone from "tone";
|
|
2
|
+
/**
|
|
3
|
+
* The composed venue programs of the crowd layer: the party hall's
|
|
4
|
+
* through-the-wall remix of the game's own hook, the cinema's plucked score
|
|
5
|
+
* with riser-booms, and the metro's train arrival/departure event. Each owns
|
|
6
|
+
* its voices and its steep muffle filter, exposes start/stop/dispose, and
|
|
7
|
+
* never throws into the caller (a program glitch mutes that program, nothing
|
|
8
|
+
* else). {@link CrowdLayer} decides when each runs.
|
|
9
|
+
*/
|
|
10
|
+
interface Program {
|
|
11
|
+
start(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
15
|
+
/** The party next door: kick, backbeat thud, bouncing bass, stabs, and the
|
|
16
|
+
* splash hook, all behind a steep 1150 Hz wall filter. */
|
|
17
|
+
export declare class PartyBand implements Program {
|
|
18
|
+
private wall;
|
|
19
|
+
private gain;
|
|
20
|
+
private kick;
|
|
21
|
+
private thud;
|
|
22
|
+
private bass;
|
|
23
|
+
private stabs;
|
|
24
|
+
private hook;
|
|
25
|
+
private part;
|
|
26
|
+
constructor(dest: Tone.InputNode);
|
|
27
|
+
/** One 4-bar loop of band events, seconds-based so the global Transport
|
|
28
|
+
* tempo (owned by the music) never bends the party. */
|
|
29
|
+
private buildEvents;
|
|
30
|
+
start(): void;
|
|
31
|
+
stop(): void;
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
34
|
+
/** The film through the door: sparse plucked arpeggio, and every so often a
|
|
35
|
+
* riser building into a boom with audible mid partials. */
|
|
36
|
+
export declare class CinemaProgram implements Program {
|
|
37
|
+
private gain;
|
|
38
|
+
private muffle;
|
|
39
|
+
private plucks;
|
|
40
|
+
private riser;
|
|
41
|
+
private boom;
|
|
42
|
+
private part;
|
|
43
|
+
private dramaTimer;
|
|
44
|
+
private tick;
|
|
45
|
+
constructor(dest: Tone.InputNode);
|
|
46
|
+
start(): void;
|
|
47
|
+
/** Every 8-14 s: riser sweeping up, then the boom. */
|
|
48
|
+
private scheduleDrama;
|
|
49
|
+
stop(): void;
|
|
50
|
+
dispose(): void;
|
|
51
|
+
}
|
|
52
|
+
/** The train: a scripted arrival/idle/departure event that repeats while the
|
|
53
|
+
* platform stays in view, over whatever the layer's platform murmur does. */
|
|
54
|
+
export declare class MetroProgram implements Program {
|
|
55
|
+
private gain;
|
|
56
|
+
private thumps;
|
|
57
|
+
private brake;
|
|
58
|
+
private rumble;
|
|
59
|
+
private rumbleFilter;
|
|
60
|
+
private rumbleGain;
|
|
61
|
+
private timers;
|
|
62
|
+
private tick;
|
|
63
|
+
constructor(dest: Tone.InputNode);
|
|
64
|
+
start(): void;
|
|
65
|
+
private scheduleTrain;
|
|
66
|
+
/** Play the whole scripted event via short timers off the event start. */
|
|
67
|
+
private runEvent;
|
|
68
|
+
stop(): void;
|
|
69
|
+
dispose(): void;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import * as Tone from 'tone';
|
|
2
|
+
import { midiToFreq } from './toneScenes.js';
|
|
3
|
+
import { LightMembraneSynth, LightMonoSynth, LightPolySynth } from './lightSynth.js';
|
|
4
|
+
import { PARTY_BPM, PARTY_BASS_ROOTS, partyHookEvents, CINEMA_RISER, CINEMA_PLUCKS, pseudo, CINEMA_BOOM_HZ, TRAIN_INTERVAL_S, trainEvent } from './toneCrowdData.js';
|
|
5
|
+
|
|
6
|
+
/** Shared guard: run `fn`, swallowing any Tone error. */
|
|
7
|
+
function safe(fn) {
|
|
8
|
+
try {
|
|
9
|
+
fn();
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
/* program glitch: skip */
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** The party next door: kick, backbeat thud, bouncing bass, stabs, and the
|
|
16
|
+
* splash hook, all behind a steep 1150 Hz wall filter. */
|
|
17
|
+
class PartyBand {
|
|
18
|
+
constructor(dest) {
|
|
19
|
+
this.part = null;
|
|
20
|
+
this.gain = new Tone.Gain(0);
|
|
21
|
+
this.wall = new Tone.Filter({ type: "lowpass", frequency: 1150, rolloff: -48 }).connect(this.gain);
|
|
22
|
+
this.gain.connect(dest);
|
|
23
|
+
this.kick = new LightMembraneSynth({ octaves: 4, pitchDecay: 0.04 }).connect(this.wall);
|
|
24
|
+
this.kick.volume.value = -6;
|
|
25
|
+
this.thud = new LightMonoSynth({
|
|
26
|
+
oscillator: { type: "sine" },
|
|
27
|
+
envelope: { attack: 0.002, decay: 0.06, sustain: 0, release: 0.05 },
|
|
28
|
+
}).connect(this.wall);
|
|
29
|
+
this.thud.volume.value = -14;
|
|
30
|
+
this.bass = new LightMonoSynth({
|
|
31
|
+
oscillator: { type: "triangle" },
|
|
32
|
+
envelope: { attack: 0.006, decay: 0.1, sustain: 0.2, release: 0.08 },
|
|
33
|
+
}).connect(this.wall);
|
|
34
|
+
this.bass.volume.value = -10;
|
|
35
|
+
this.stabs = new LightPolySynth({
|
|
36
|
+
oscillator: { type: "sine" },
|
|
37
|
+
envelope: { attack: 0.004, decay: 0.08, sustain: 0, release: 0.07 },
|
|
38
|
+
}).connect(this.wall);
|
|
39
|
+
this.stabs.volume.value = -18;
|
|
40
|
+
this.hook = new LightPolySynth({
|
|
41
|
+
oscillator: { type: "triangle" },
|
|
42
|
+
envelope: { attack: 0.01, decay: 0.25, sustain: 0.1, release: 0.2 },
|
|
43
|
+
}).connect(this.wall);
|
|
44
|
+
this.hook.volume.value = -10;
|
|
45
|
+
}
|
|
46
|
+
/** One 4-bar loop of band events, seconds-based so the global Transport
|
|
47
|
+
* tempo (owned by the music) never bends the party. */
|
|
48
|
+
buildEvents() {
|
|
49
|
+
const beat = 60 / PARTY_BPM;
|
|
50
|
+
const events = [];
|
|
51
|
+
for (let n = 0; n < 16; n++) {
|
|
52
|
+
const t = n * beat;
|
|
53
|
+
const bar = Math.floor(n / 4);
|
|
54
|
+
events.push({ t, voice: "kick", midi: 33, dur: 0.25 });
|
|
55
|
+
if (n % 2 === 1)
|
|
56
|
+
events.push({ t, voice: "thud", midi: 55, dur: 0.12 });
|
|
57
|
+
const root = PARTY_BASS_ROOTS[bar];
|
|
58
|
+
events.push({ t: t + beat * 0.5, voice: "bass", midi: root + (n % 2 ? 12 : 0), dur: beat * 0.45 });
|
|
59
|
+
if (n % 2 === 0) {
|
|
60
|
+
// A two-note chord stab (root and fifth above), not a lone note.
|
|
61
|
+
events.push({ t: t + beat * 0.5, voice: "stab", midi: root + 26, dur: beat * 0.4 });
|
|
62
|
+
events.push({ t: t + beat * 0.5, voice: "stab", midi: root + 33, dur: beat * 0.4 });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
for (const h of partyHookEvents())
|
|
66
|
+
events.push({ t: h.t, voice: "hook", midi: h.midi, dur: h.dur });
|
|
67
|
+
return events;
|
|
68
|
+
}
|
|
69
|
+
start() {
|
|
70
|
+
safe(() => {
|
|
71
|
+
this.stop();
|
|
72
|
+
const beat = 60 / PARTY_BPM;
|
|
73
|
+
const part = new Tone.Part((time, ev) => {
|
|
74
|
+
safe(() => {
|
|
75
|
+
if (ev.voice === "kick")
|
|
76
|
+
this.kick.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.9);
|
|
77
|
+
else if (ev.voice === "thud")
|
|
78
|
+
this.thud.triggerAttackRelease(210, ev.dur, time, 0.6);
|
|
79
|
+
else if (ev.voice === "bass")
|
|
80
|
+
this.bass.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.7);
|
|
81
|
+
else if (ev.voice === "stab")
|
|
82
|
+
this.stabs.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.35);
|
|
83
|
+
else
|
|
84
|
+
this.hook.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.5);
|
|
85
|
+
});
|
|
86
|
+
}, this.buildEvents().map((e) => [e.t, e]));
|
|
87
|
+
part.loop = true;
|
|
88
|
+
part.loopEnd = 16 * beat;
|
|
89
|
+
part.start(0);
|
|
90
|
+
this.part = part;
|
|
91
|
+
this.gain.gain.rampTo(0.6, 1.2);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
stop() {
|
|
95
|
+
safe(() => this.gain.gain.rampTo(0, 0.8));
|
|
96
|
+
safe(() => this.part?.stop());
|
|
97
|
+
safe(() => this.part?.dispose());
|
|
98
|
+
this.part = null;
|
|
99
|
+
}
|
|
100
|
+
dispose() {
|
|
101
|
+
this.stop();
|
|
102
|
+
for (const n of [this.kick, this.thud, this.bass, this.stabs, this.hook, this.wall, this.gain]) {
|
|
103
|
+
safe(() => n.dispose());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** The film through the door: sparse plucked arpeggio, and every so often a
|
|
108
|
+
* riser building into a boom with audible mid partials. */
|
|
109
|
+
class CinemaProgram {
|
|
110
|
+
constructor(dest) {
|
|
111
|
+
this.part = null;
|
|
112
|
+
this.dramaTimer = null;
|
|
113
|
+
this.tick = 1;
|
|
114
|
+
this.gain = new Tone.Gain(0);
|
|
115
|
+
this.muffle = new Tone.Filter({ type: "lowpass", frequency: 1000, rolloff: -48 }).connect(this.gain);
|
|
116
|
+
this.gain.connect(dest);
|
|
117
|
+
this.plucks = new LightPolySynth({
|
|
118
|
+
oscillator: { type: "triangle" },
|
|
119
|
+
envelope: { attack: 0.02, decay: 0.7, sustain: 0, release: 0.6 },
|
|
120
|
+
}).connect(this.muffle);
|
|
121
|
+
this.plucks.volume.value = -10;
|
|
122
|
+
this.riser = new LightMonoSynth({
|
|
123
|
+
oscillator: { type: "sine" },
|
|
124
|
+
envelope: { attack: CINEMA_RISER.durS, decay: 0.05, sustain: 0, release: 0.05 },
|
|
125
|
+
}).connect(this.muffle);
|
|
126
|
+
this.riser.volume.value = -16;
|
|
127
|
+
this.boom = new LightPolySynth({
|
|
128
|
+
oscillator: { type: "sine" },
|
|
129
|
+
envelope: { attack: 0.01, decay: 0.5, sustain: 0, release: 0.4 },
|
|
130
|
+
}).connect(this.muffle);
|
|
131
|
+
this.boom.volume.value = -8;
|
|
132
|
+
}
|
|
133
|
+
start() {
|
|
134
|
+
safe(() => {
|
|
135
|
+
this.stop();
|
|
136
|
+
const part = new Tone.Part((time, ev) => safe(() => this.plucks.triggerAttackRelease(midiToFreq(ev.midi), 1.4, time, 0.5)), CINEMA_PLUCKS.map(([midi, at]) => [at, { t: at, midi }]));
|
|
137
|
+
part.loop = true;
|
|
138
|
+
part.loopEnd = 16;
|
|
139
|
+
part.start(0);
|
|
140
|
+
this.part = part;
|
|
141
|
+
this.gain.gain.rampTo(0.55, 1.2);
|
|
142
|
+
this.scheduleDrama();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/** Every 8-14 s: riser sweeping up, then the boom. */
|
|
146
|
+
scheduleDrama() {
|
|
147
|
+
const wait = (8 + 6 * pseudo(this.tick++ * 40503)) * 1000;
|
|
148
|
+
this.dramaTimer = setTimeout(() => {
|
|
149
|
+
safe(() => {
|
|
150
|
+
const now = Tone.now();
|
|
151
|
+
// The sweep goes on the note just triggered (a light voice's glide
|
|
152
|
+
// control steers its current note), so it follows the trigger.
|
|
153
|
+
this.riser.triggerAttackRelease(CINEMA_RISER.fromHz, CINEMA_RISER.durS, now, 0.5);
|
|
154
|
+
this.riser.frequency.linearRampToValueAtTime(CINEMA_RISER.toHz, now + CINEMA_RISER.durS);
|
|
155
|
+
const boomAt = now + CINEMA_RISER.durS + 0.05;
|
|
156
|
+
for (const hz of CINEMA_BOOM_HZ)
|
|
157
|
+
this.boom.triggerAttackRelease(hz, 1.2, boomAt, hz < 100 ? 0.8 : 0.4);
|
|
158
|
+
});
|
|
159
|
+
this.scheduleDrama();
|
|
160
|
+
}, wait);
|
|
161
|
+
}
|
|
162
|
+
stop() {
|
|
163
|
+
if (this.dramaTimer !== null)
|
|
164
|
+
clearTimeout(this.dramaTimer);
|
|
165
|
+
this.dramaTimer = null;
|
|
166
|
+
safe(() => this.gain.gain.rampTo(0, 0.8));
|
|
167
|
+
safe(() => this.part?.stop());
|
|
168
|
+
safe(() => this.part?.dispose());
|
|
169
|
+
this.part = null;
|
|
170
|
+
}
|
|
171
|
+
dispose() {
|
|
172
|
+
this.stop();
|
|
173
|
+
for (const n of [this.plucks, this.riser, this.boom, this.muffle, this.gain]) {
|
|
174
|
+
safe(() => n.dispose());
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/** The train: a scripted arrival/idle/departure event that repeats while the
|
|
179
|
+
* platform stays in view, over whatever the layer's platform murmur does. */
|
|
180
|
+
class MetroProgram {
|
|
181
|
+
constructor(dest) {
|
|
182
|
+
this.timers = new Set();
|
|
183
|
+
this.tick = 1;
|
|
184
|
+
this.gain = new Tone.Gain(0);
|
|
185
|
+
this.gain.connect(dest);
|
|
186
|
+
this.thumps = new LightPolySynth({
|
|
187
|
+
oscillator: { type: "sine" },
|
|
188
|
+
envelope: { attack: 0.006, decay: 0.06, sustain: 0, release: 0.05 },
|
|
189
|
+
}).connect(this.gain);
|
|
190
|
+
this.thumps.volume.value = -8;
|
|
191
|
+
this.brake = new LightMonoSynth({
|
|
192
|
+
oscillator: { type: "sine" },
|
|
193
|
+
envelope: { attack: 0.3, decay: 0.5, sustain: 0, release: 0.3 },
|
|
194
|
+
}).connect(this.gain);
|
|
195
|
+
this.brake.volume.value = -18;
|
|
196
|
+
// The rumble is the one broadband source here, and it obeys the noise
|
|
197
|
+
// rule: steep lowpass at 140 Hz, seated low, swelled by its own gain.
|
|
198
|
+
this.rumbleGain = new Tone.Gain(0).connect(this.gain);
|
|
199
|
+
this.rumbleFilter = new Tone.Filter({ type: "lowpass", frequency: 140, rolloff: -48 }).connect(this.rumbleGain);
|
|
200
|
+
this.rumble = new Tone.Noise("brown").connect(this.rumbleFilter);
|
|
201
|
+
this.rumble.volume.value = -6;
|
|
202
|
+
}
|
|
203
|
+
start() {
|
|
204
|
+
safe(() => {
|
|
205
|
+
this.stop();
|
|
206
|
+
this.gain.gain.rampTo(0.6, 1);
|
|
207
|
+
this.rumble.start();
|
|
208
|
+
this.scheduleTrain(4 + 6 * pseudo(this.tick++ * 22695477));
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
scheduleTrain(delayS) {
|
|
212
|
+
const timer = setTimeout(() => {
|
|
213
|
+
this.timers.delete(timer);
|
|
214
|
+
this.runEvent();
|
|
215
|
+
this.scheduleTrain(TRAIN_INTERVAL_S * (0.8 + 0.4 * pseudo(this.tick++ * 19349663)));
|
|
216
|
+
}, delayS * 1000);
|
|
217
|
+
this.timers.add(timer);
|
|
218
|
+
}
|
|
219
|
+
/** Play the whole scripted event via short timers off the event start. */
|
|
220
|
+
runEvent() {
|
|
221
|
+
let doorNum = 0;
|
|
222
|
+
for (const step of trainEvent()) {
|
|
223
|
+
const timer = setTimeout(() => {
|
|
224
|
+
this.timers.delete(timer);
|
|
225
|
+
safe(() => {
|
|
226
|
+
const now = Tone.now();
|
|
227
|
+
if (step.kind === "daDum") {
|
|
228
|
+
this.thumps.triggerAttackRelease(58, 0.16, now, step.gain);
|
|
229
|
+
this.thumps.triggerAttackRelease(64, 0.14, now + 0.11, step.gain * 0.8);
|
|
230
|
+
this.thumps.triggerAttackRelease(130, 0.07, now + 0.005, step.gain * 0.35);
|
|
231
|
+
}
|
|
232
|
+
else if (step.kind === "rumbleIn") {
|
|
233
|
+
this.rumbleGain.gain.rampTo(0.5, 4.5);
|
|
234
|
+
}
|
|
235
|
+
else if (step.kind === "rumbleOut") {
|
|
236
|
+
this.rumbleGain.gain.rampTo(0.4, 1.5);
|
|
237
|
+
const fade = setTimeout(() => {
|
|
238
|
+
this.timers.delete(fade);
|
|
239
|
+
safe(() => this.rumbleGain.gain.rampTo(0, 3.2));
|
|
240
|
+
}, 1800);
|
|
241
|
+
this.timers.add(fade);
|
|
242
|
+
}
|
|
243
|
+
else if (step.kind === "brake") {
|
|
244
|
+
this.brake.triggerAttackRelease(180, 1, now, step.gain);
|
|
245
|
+
this.brake.frequency.linearRampToValueAtTime(120, now + 1);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
// The two door thunks land at 95 then 88 Hz, per the spec.
|
|
249
|
+
this.thumps.triggerAttackRelease(doorNum++ % 2 === 0 ? 95 : 88, 0.3, now, step.gain);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}, step.at * 1000);
|
|
253
|
+
this.timers.add(timer);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
stop() {
|
|
257
|
+
for (const t of this.timers)
|
|
258
|
+
clearTimeout(t);
|
|
259
|
+
this.timers.clear();
|
|
260
|
+
safe(() => this.gain.gain.rampTo(0, 0.8));
|
|
261
|
+
safe(() => this.rumbleGain.gain.rampTo(0, 0.4));
|
|
262
|
+
safe(() => this.rumble.stop());
|
|
263
|
+
}
|
|
264
|
+
dispose() {
|
|
265
|
+
this.stop();
|
|
266
|
+
for (const n of [this.thumps, this.brake, this.rumble, this.rumbleFilter, this.rumbleGain, this.gain]) {
|
|
267
|
+
safe(() => n.dispose());
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export { CinemaProgram, MetroProgram, PartyBand };
|
|
273
|
+
//# sourceMappingURL=toneCrowdPrograms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toneCrowdPrograms.js","sources":["../../src/audio/toneCrowdPrograms.ts"],"sourcesContent":["import * as Tone from \"tone\";\nimport { midiToFreq } from \"./toneScenes\";\nimport { LightMembraneSynth, LightMonoSynth, LightPolySynth } from \"./lightSynth\";\nimport {\n PARTY_BPM,\n PARTY_BASS_ROOTS,\n partyHookEvents,\n CINEMA_PLUCKS,\n CINEMA_RISER,\n CINEMA_BOOM_HZ,\n trainEvent,\n TRAIN_INTERVAL_S,\n pseudo,\n} from \"./toneCrowdData\";\n\n/**\n * The composed venue programs of the crowd layer: the party hall's\n * through-the-wall remix of the game's own hook, the cinema's plucked score\n * with riser-booms, and the metro's train arrival/departure event. Each owns\n * its voices and its steep muffle filter, exposes start/stop/dispose, and\n * never throws into the caller (a program glitch mutes that program, nothing\n * else). {@link CrowdLayer} decides when each runs.\n */\n\ninterface Program {\n start(): void;\n stop(): void;\n dispose(): void;\n}\n\n/** Shared guard: run `fn`, swallowing any Tone error. */\nfunction safe(fn: () => void): void {\n try {\n fn();\n } catch {\n /* program glitch: skip */\n }\n}\n\n/** The party next door: kick, backbeat thud, bouncing bass, stabs, and the\n * splash hook, all behind a steep 1150 Hz wall filter. */\nexport class PartyBand implements Program {\n private wall: Tone.Filter;\n private gain: Tone.Gain;\n private kick: LightMembraneSynth;\n private thud: LightMonoSynth;\n private bass: LightMonoSynth;\n private stabs: LightPolySynth;\n private hook: LightPolySynth;\n private part: Tone.Part | null = null;\n\n constructor(dest: Tone.InputNode) {\n this.gain = new Tone.Gain(0);\n this.wall = new Tone.Filter({ type: \"lowpass\", frequency: 1150, rolloff: -48 }).connect(\n this.gain,\n );\n this.gain.connect(dest);\n this.kick = new LightMembraneSynth({ octaves: 4, pitchDecay: 0.04 }).connect(this.wall);\n this.kick.volume.value = -6;\n this.thud = new LightMonoSynth({\n oscillator: { type: \"sine\" },\n envelope: { attack: 0.002, decay: 0.06, sustain: 0, release: 0.05 },\n }).connect(this.wall);\n this.thud.volume.value = -14;\n this.bass = new LightMonoSynth({\n oscillator: { type: \"triangle\" },\n envelope: { attack: 0.006, decay: 0.1, sustain: 0.2, release: 0.08 },\n }).connect(this.wall);\n this.bass.volume.value = -10;\n this.stabs = new LightPolySynth({\n oscillator: { type: \"sine\" },\n envelope: { attack: 0.004, decay: 0.08, sustain: 0, release: 0.07 },\n }).connect(this.wall);\n this.stabs.volume.value = -18;\n this.hook = new LightPolySynth({\n oscillator: { type: \"triangle\" },\n envelope: { attack: 0.01, decay: 0.25, sustain: 0.1, release: 0.2 },\n }).connect(this.wall);\n this.hook.volume.value = -10;\n }\n\n /** One 4-bar loop of band events, seconds-based so the global Transport\n * tempo (owned by the music) never bends the party. */\n private buildEvents(): Array<{ t: number; voice: string; midi: number; dur: number }> {\n const beat = 60 / PARTY_BPM;\n const events: Array<{ t: number; voice: string; midi: number; dur: number }> = [];\n for (let n = 0; n < 16; n++) {\n const t = n * beat;\n const bar = Math.floor(n / 4);\n events.push({ t, voice: \"kick\", midi: 33, dur: 0.25 });\n if (n % 2 === 1) events.push({ t, voice: \"thud\", midi: 55, dur: 0.12 });\n const root = PARTY_BASS_ROOTS[bar];\n events.push({ t: t + beat * 0.5, voice: \"bass\", midi: root + (n % 2 ? 12 : 0), dur: beat * 0.45 });\n if (n % 2 === 0) {\n // A two-note chord stab (root and fifth above), not a lone note.\n events.push({ t: t + beat * 0.5, voice: \"stab\", midi: root + 26, dur: beat * 0.4 });\n events.push({ t: t + beat * 0.5, voice: \"stab\", midi: root + 33, dur: beat * 0.4 });\n }\n }\n for (const h of partyHookEvents()) events.push({ t: h.t, voice: \"hook\", midi: h.midi, dur: h.dur });\n return events;\n }\n\n start(): void {\n safe(() => {\n this.stop();\n const beat = 60 / PARTY_BPM;\n const part = new Tone.Part((time, ev) => {\n safe(() => {\n if (ev.voice === \"kick\") this.kick.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.9);\n else if (ev.voice === \"thud\") this.thud.triggerAttackRelease(210, ev.dur, time, 0.6);\n else if (ev.voice === \"bass\") this.bass.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.7);\n else if (ev.voice === \"stab\") this.stabs.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.35);\n else this.hook.triggerAttackRelease(midiToFreq(ev.midi), ev.dur, time, 0.5);\n });\n }, this.buildEvents().map((e) => [e.t, e] as [number, typeof e]));\n part.loop = true;\n part.loopEnd = 16 * beat;\n part.start(0);\n this.part = part;\n this.gain.gain.rampTo(0.6, 1.2);\n });\n }\n\n stop(): void {\n safe(() => this.gain.gain.rampTo(0, 0.8));\n safe(() => this.part?.stop());\n safe(() => this.part?.dispose());\n this.part = null;\n }\n\n dispose(): void {\n this.stop();\n for (const n of [this.kick, this.thud, this.bass, this.stabs, this.hook, this.wall, this.gain]) {\n safe(() => n.dispose());\n }\n }\n}\n\n/** The film through the door: sparse plucked arpeggio, and every so often a\n * riser building into a boom with audible mid partials. */\nexport class CinemaProgram implements Program {\n private gain: Tone.Gain;\n private muffle: Tone.Filter;\n private plucks: LightPolySynth;\n private riser: LightMonoSynth;\n private boom: LightPolySynth;\n private part: Tone.Part | null = null;\n private dramaTimer: ReturnType<typeof setTimeout> | null = null;\n private tick = 1;\n\n constructor(dest: Tone.InputNode) {\n this.gain = new Tone.Gain(0);\n this.muffle = new Tone.Filter({ type: \"lowpass\", frequency: 1000, rolloff: -48 }).connect(\n this.gain,\n );\n this.gain.connect(dest);\n this.plucks = new LightPolySynth({\n oscillator: { type: \"triangle\" },\n envelope: { attack: 0.02, decay: 0.7, sustain: 0, release: 0.6 },\n }).connect(this.muffle);\n this.plucks.volume.value = -10;\n this.riser = new LightMonoSynth({\n oscillator: { type: \"sine\" },\n envelope: { attack: CINEMA_RISER.durS, decay: 0.05, sustain: 0, release: 0.05 },\n }).connect(this.muffle);\n this.riser.volume.value = -16;\n this.boom = new LightPolySynth({\n oscillator: { type: \"sine\" },\n envelope: { attack: 0.01, decay: 0.5, sustain: 0, release: 0.4 },\n }).connect(this.muffle);\n this.boom.volume.value = -8;\n }\n\n start(): void {\n safe(() => {\n this.stop();\n const part = new Tone.Part(\n (time, ev) => safe(() => this.plucks.triggerAttackRelease(midiToFreq(ev.midi), 1.4, time, 0.5)),\n CINEMA_PLUCKS.map(([midi, at]) => [at, { t: at, midi }] as [number, { t: number; midi: number }]),\n );\n part.loop = true;\n part.loopEnd = 16;\n part.start(0);\n this.part = part;\n this.gain.gain.rampTo(0.55, 1.2);\n this.scheduleDrama();\n });\n }\n\n /** Every 8-14 s: riser sweeping up, then the boom. */\n private scheduleDrama(): void {\n const wait = (8 + 6 * pseudo(this.tick++ * 40503)) * 1000;\n this.dramaTimer = setTimeout(() => {\n safe(() => {\n const now = Tone.now();\n // The sweep goes on the note just triggered (a light voice's glide\n // control steers its current note), so it follows the trigger.\n this.riser.triggerAttackRelease(CINEMA_RISER.fromHz, CINEMA_RISER.durS, now, 0.5);\n this.riser.frequency.linearRampToValueAtTime(CINEMA_RISER.toHz, now + CINEMA_RISER.durS);\n const boomAt = now + CINEMA_RISER.durS + 0.05;\n for (const hz of CINEMA_BOOM_HZ) this.boom.triggerAttackRelease(hz, 1.2, boomAt, hz < 100 ? 0.8 : 0.4);\n });\n this.scheduleDrama();\n }, wait);\n }\n\n stop(): void {\n if (this.dramaTimer !== null) clearTimeout(this.dramaTimer);\n this.dramaTimer = null;\n safe(() => this.gain.gain.rampTo(0, 0.8));\n safe(() => this.part?.stop());\n safe(() => this.part?.dispose());\n this.part = null;\n }\n\n dispose(): void {\n this.stop();\n for (const n of [this.plucks, this.riser, this.boom, this.muffle, this.gain]) {\n safe(() => n.dispose());\n }\n }\n}\n\n/** The train: a scripted arrival/idle/departure event that repeats while the\n * platform stays in view, over whatever the layer's platform murmur does. */\nexport class MetroProgram implements Program {\n private gain: Tone.Gain;\n private thumps: LightPolySynth;\n private brake: LightMonoSynth;\n private rumble: Tone.Noise;\n private rumbleFilter: Tone.Filter;\n private rumbleGain: Tone.Gain;\n private timers = new Set<ReturnType<typeof setTimeout>>();\n private tick = 1;\n\n constructor(dest: Tone.InputNode) {\n this.gain = new Tone.Gain(0);\n this.gain.connect(dest);\n this.thumps = new LightPolySynth({\n oscillator: { type: \"sine\" },\n envelope: { attack: 0.006, decay: 0.06, sustain: 0, release: 0.05 },\n }).connect(this.gain);\n this.thumps.volume.value = -8;\n this.brake = new LightMonoSynth({\n oscillator: { type: \"sine\" },\n envelope: { attack: 0.3, decay: 0.5, sustain: 0, release: 0.3 },\n }).connect(this.gain);\n this.brake.volume.value = -18;\n // The rumble is the one broadband source here, and it obeys the noise\n // rule: steep lowpass at 140 Hz, seated low, swelled by its own gain.\n this.rumbleGain = new Tone.Gain(0).connect(this.gain);\n this.rumbleFilter = new Tone.Filter({ type: \"lowpass\", frequency: 140, rolloff: -48 }).connect(\n this.rumbleGain,\n );\n this.rumble = new Tone.Noise(\"brown\").connect(this.rumbleFilter);\n this.rumble.volume.value = -6;\n }\n\n start(): void {\n safe(() => {\n this.stop();\n this.gain.gain.rampTo(0.6, 1);\n this.rumble.start();\n this.scheduleTrain(4 + 6 * pseudo(this.tick++ * 22695477));\n });\n }\n\n private scheduleTrain(delayS: number): void {\n const timer = setTimeout(() => {\n this.timers.delete(timer);\n this.runEvent();\n this.scheduleTrain(TRAIN_INTERVAL_S * (0.8 + 0.4 * pseudo(this.tick++ * 19349663)));\n }, delayS * 1000);\n this.timers.add(timer);\n }\n\n /** Play the whole scripted event via short timers off the event start. */\n private runEvent(): void {\n let doorNum = 0;\n for (const step of trainEvent()) {\n const timer = setTimeout(() => {\n this.timers.delete(timer);\n safe(() => {\n const now = Tone.now();\n if (step.kind === \"daDum\") {\n this.thumps.triggerAttackRelease(58, 0.16, now, step.gain);\n this.thumps.triggerAttackRelease(64, 0.14, now + 0.11, step.gain * 0.8);\n this.thumps.triggerAttackRelease(130, 0.07, now + 0.005, step.gain * 0.35);\n } else if (step.kind === \"rumbleIn\") {\n this.rumbleGain.gain.rampTo(0.5, 4.5);\n } else if (step.kind === \"rumbleOut\") {\n this.rumbleGain.gain.rampTo(0.4, 1.5);\n const fade = setTimeout(() => {\n this.timers.delete(fade);\n safe(() => this.rumbleGain.gain.rampTo(0, 3.2));\n }, 1800);\n this.timers.add(fade);\n } else if (step.kind === \"brake\") {\n this.brake.triggerAttackRelease(180, 1, now, step.gain);\n this.brake.frequency.linearRampToValueAtTime(120, now + 1);\n } else {\n // The two door thunks land at 95 then 88 Hz, per the spec.\n this.thumps.triggerAttackRelease(doorNum++ % 2 === 0 ? 95 : 88, 0.3, now, step.gain);\n }\n });\n }, step.at * 1000);\n this.timers.add(timer);\n }\n }\n\n stop(): void {\n for (const t of this.timers) clearTimeout(t);\n this.timers.clear();\n safe(() => this.gain.gain.rampTo(0, 0.8));\n safe(() => this.rumbleGain.gain.rampTo(0, 0.4));\n safe(() => this.rumble.stop());\n }\n\n dispose(): void {\n this.stop();\n for (const n of [this.thumps, this.brake, this.rumble, this.rumbleFilter, this.rumbleGain, this.gain]) {\n safe(() => n.dispose());\n }\n }\n}\n"],"names":[],"mappings":";;;;;AA8BA;AACA,SAAS,IAAI,CAAC,EAAc,EAAA;AAC1B,IAAA,IAAI;AACF,QAAA,EAAE,EAAE;IACN;AAAE,IAAA,MAAM;;IAER;AACF;AAEA;AAC2D;MAC9C,SAAS,CAAA;AAUpB,IAAA,WAAA,CAAY,IAAoB,EAAA;QAFxB,IAAA,CAAA,IAAI,GAAqB,IAAI;QAGnC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CACrF,IAAI,CAAC,IAAI,CACV;AACD,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QACvF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;AAC3B,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC;AAC7B,YAAA,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;AAC5B,YAAA,QAAQ,EAAE,EAAE,MAA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AAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzC,QAAA,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAChC;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,IAAI,EAAE;AACX,QAAA,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACrG,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;QACzB;IACF;AACD;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as Tone from "tone";
|
|
2
|
+
/**
|
|
3
|
+
* The voice half of the crowd layer: the two seed recordings (talk and
|
|
4
|
+
* laughs, the owner's own voice, see ASSETS-LICENSE.md) and the play-one-now
|
|
5
|
+
* primitives built on them. A "talker" phrase is a calm segment of the talk
|
|
6
|
+
* seed played through a down-only pitch shift with trapezoid fades; a laugh
|
|
7
|
+
* is one of the two seed regions; a whoop is a calm chunk with its playback
|
|
8
|
+
* rate bent upward. {@link CrowdLayer} owns all scheduling and pre-wires the
|
|
9
|
+
* gain nodes it hands in; this module only emits one sound into them.
|
|
10
|
+
*
|
|
11
|
+
* Loading is lazy and failure is silent: until (or unless) the seeds decode,
|
|
12
|
+
* every voiced method is a quiet no-op and the tone-built ambience carries
|
|
13
|
+
* the scene alone.
|
|
14
|
+
*/
|
|
15
|
+
export declare class CrowdVoices {
|
|
16
|
+
private talk;
|
|
17
|
+
private laughs;
|
|
18
|
+
private talkMask;
|
|
19
|
+
private talkRate;
|
|
20
|
+
private talkLen;
|
|
21
|
+
/** Live sources, tracked so dispose can cut tails. */
|
|
22
|
+
private live;
|
|
23
|
+
/** Backstop reap timers, one per live source (see {@link track}). */
|
|
24
|
+
private reapTimers;
|
|
25
|
+
private disposed;
|
|
26
|
+
/** Begin fetching both seeds. Safe to call once, any time after the audio
|
|
27
|
+
* context exists; a failed fetch or decode leaves the layer tone-only. */
|
|
28
|
+
load(baseUrl: string): void;
|
|
29
|
+
/** True once the talk seed is decoded and masked (voiced murmur can play). */
|
|
30
|
+
get ready(): boolean;
|
|
31
|
+
/** Play one talker phrase into `gainNode`. `tick` seeds all randomness. Returns
|
|
32
|
+
* the phrase's wall-clock seconds, or null when not ready or no calm
|
|
33
|
+
* segment fits (callers just wait a beat and try again). */
|
|
34
|
+
phrase(gainNode: Tone.Gain, semi: number, tick: number): number | null;
|
|
35
|
+
/** Play one of the two seed laughs, muffled by the destination chain. */
|
|
36
|
+
laugh(gainNode: Tone.Gain, tick: number): void;
|
|
37
|
+
/** A whoop: a calm talk chunk whose playback rate accelerates upward. */
|
|
38
|
+
whoop(gainNode: Tone.Gain, tick: number): void;
|
|
39
|
+
/** Create, connect, fire, and track one buffer source. */
|
|
40
|
+
private emit;
|
|
41
|
+
/** Track a started source so it's reaped when done. `onended` is the primary
|
|
42
|
+
* signal, but Tone does not guarantee it fires (a suspended context, a
|
|
43
|
+
* duration past the buffer end), so a timer sized to the source's expected
|
|
44
|
+
* lifetime is a guaranteed backstop: without it a source that never fires
|
|
45
|
+
* onended would sit in `live` until layer teardown. Whichever fires first
|
|
46
|
+
* reaps once (dispose is idempotent) and cancels the other. */
|
|
47
|
+
private track;
|
|
48
|
+
dispose(): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as Tone from 'tone';
|
|
2
|
+
import { computeCalmMask, PHRASE_MIN_S, PHRASE_VAR_S, pseudo, segmentIsCalm, PHRASE_RAMP_S, LAUGH_REGIONS, whoopRate } from './toneCrowdData.js';
|
|
3
|
+
import { VOICE_TALK_SEED, VOICE_LAUGHS_SEED } from './audioAssets.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The voice half of the crowd layer: the two seed recordings (talk and
|
|
7
|
+
* laughs, the owner's own voice, see ASSETS-LICENSE.md) and the play-one-now
|
|
8
|
+
* primitives built on them. A "talker" phrase is a calm segment of the talk
|
|
9
|
+
* seed played through a down-only pitch shift with trapezoid fades; a laugh
|
|
10
|
+
* is one of the two seed regions; a whoop is a calm chunk with its playback
|
|
11
|
+
* rate bent upward. {@link CrowdLayer} owns all scheduling and pre-wires the
|
|
12
|
+
* gain nodes it hands in; this module only emits one sound into them.
|
|
13
|
+
*
|
|
14
|
+
* Loading is lazy and failure is silent: until (or unless) the seeds decode,
|
|
15
|
+
* every voiced method is a quiet no-op and the tone-built ambience carries
|
|
16
|
+
* the scene alone.
|
|
17
|
+
*/
|
|
18
|
+
class CrowdVoices {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.talk = null;
|
|
21
|
+
this.laughs = null;
|
|
22
|
+
this.talkMask = null;
|
|
23
|
+
this.talkRate = 44100;
|
|
24
|
+
this.talkLen = 0;
|
|
25
|
+
/** Live sources, tracked so dispose can cut tails. */
|
|
26
|
+
this.live = new Set();
|
|
27
|
+
/** Backstop reap timers, one per live source (see {@link track}). */
|
|
28
|
+
this.reapTimers = new Set();
|
|
29
|
+
this.disposed = false;
|
|
30
|
+
}
|
|
31
|
+
/** Begin fetching both seeds. Safe to call once, any time after the audio
|
|
32
|
+
* context exists; a failed fetch or decode leaves the layer tone-only. */
|
|
33
|
+
load(baseUrl) {
|
|
34
|
+
try {
|
|
35
|
+
this.talk = new Tone.ToneAudioBuffer(`${baseUrl}${VOICE_TALK_SEED}`, () => {
|
|
36
|
+
try {
|
|
37
|
+
const buf = this.talk?.get();
|
|
38
|
+
if (!buf || this.disposed)
|
|
39
|
+
return;
|
|
40
|
+
this.talkRate = buf.sampleRate;
|
|
41
|
+
this.talkLen = buf.duration;
|
|
42
|
+
this.talkMask = computeCalmMask(buf.getChannelData(0), buf.sampleRate);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
this.talkMask = null; // undecodable seed: stay tone-only
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
this.laughs = new Tone.ToneAudioBuffer(`${baseUrl}${VOICE_LAUGHS_SEED}`, () => { });
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
this.talk = this.laughs = null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** True once the talk seed is decoded and masked (voiced murmur can play). */
|
|
55
|
+
get ready() {
|
|
56
|
+
return this.talkMask !== null && this.talk !== null && this.talk.loaded;
|
|
57
|
+
}
|
|
58
|
+
/** Play one talker phrase into `gainNode`. `tick` seeds all randomness. Returns
|
|
59
|
+
* the phrase's wall-clock seconds, or null when not ready or no calm
|
|
60
|
+
* segment fits (callers just wait a beat and try again). */
|
|
61
|
+
phrase(gainNode, semi, tick) {
|
|
62
|
+
if (!this.ready || !this.talk || !this.talkMask)
|
|
63
|
+
return null;
|
|
64
|
+
const wallLen = PHRASE_MIN_S + PHRASE_VAR_S * pseudo(tick * 40503 + 7);
|
|
65
|
+
const rate = Math.pow(2, semi / 12);
|
|
66
|
+
const srcLen = wallLen * rate;
|
|
67
|
+
let start = -1;
|
|
68
|
+
for (let attempt = 0; attempt < 25; attempt++) {
|
|
69
|
+
const s = pseudo(tick * 2654435761 + attempt * 97) * Math.max(0.01, this.talkLen - srcLen - 0.1);
|
|
70
|
+
if (segmentIsCalm(this.talkMask, this.talkRate, s, srcLen)) {
|
|
71
|
+
start = s;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (start < 0)
|
|
76
|
+
return null;
|
|
77
|
+
// The `duration` arg is wall-clock in Tone's wrapper (unlike the native
|
|
78
|
+
// BufferSource, whose duration is buffer-time). ToneBufferSource.start does
|
|
79
|
+
// not forward duration to the native node; it schedules `stop(time +
|
|
80
|
+
// duration)`, so the phrase plays for wallLen real seconds regardless of
|
|
81
|
+
// playbackRate, consuming srcLen = wallLen * rate seconds of source.
|
|
82
|
+
this.emit(this.talk, gainNode, { rate, offset: start, wallDur: wallLen, fade: PHRASE_RAMP_S });
|
|
83
|
+
return wallLen;
|
|
84
|
+
}
|
|
85
|
+
/** Play one of the two seed laughs, muffled by the destination chain. */
|
|
86
|
+
laugh(gainNode, tick) {
|
|
87
|
+
if (!this.laughs || !this.laughs.loaded)
|
|
88
|
+
return;
|
|
89
|
+
const [a, b] = LAUGH_REGIONS[Math.floor(pseudo(tick * 19349663) * LAUGH_REGIONS.length)];
|
|
90
|
+
this.emit(this.laughs, gainNode, { rate: 1, offset: a, wallDur: b - a, fade: 0.03 });
|
|
91
|
+
}
|
|
92
|
+
/** A whoop: a calm talk chunk whose playback rate accelerates upward. */
|
|
93
|
+
whoop(gainNode, tick) {
|
|
94
|
+
if (!this.ready || !this.talk || !this.talkMask)
|
|
95
|
+
return;
|
|
96
|
+
const wallLen = 0.4 + 0.15 * pseudo(tick * 22695477 + 3);
|
|
97
|
+
let start = -1;
|
|
98
|
+
for (let attempt = 0; attempt < 25; attempt++) {
|
|
99
|
+
const s = pseudo(tick * 2246822519 + attempt * 131) * Math.max(0.01, this.talkLen - 1.5);
|
|
100
|
+
if (segmentIsCalm(this.talkMask, this.talkRate, s, 0.8)) {
|
|
101
|
+
start = s;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (start < 0)
|
|
106
|
+
return;
|
|
107
|
+
try {
|
|
108
|
+
const src = new Tone.ToneBufferSource({
|
|
109
|
+
url: this.talk,
|
|
110
|
+
fadeIn: 0.02,
|
|
111
|
+
fadeOut: 0.05,
|
|
112
|
+
playbackRate: whoopRate(0),
|
|
113
|
+
});
|
|
114
|
+
src.connect(gainNode);
|
|
115
|
+
const now = Tone.now();
|
|
116
|
+
// Two-segment linear ramp approximates the approved accelerating bend.
|
|
117
|
+
src.playbackRate.setValueAtTime(whoopRate(0), now);
|
|
118
|
+
src.playbackRate.linearRampToValueAtTime(whoopRate(0.5), now + wallLen * 0.5);
|
|
119
|
+
src.playbackRate.linearRampToValueAtTime(whoopRate(1), now + wallLen);
|
|
120
|
+
// No duration arg here: the whoop's length is governed by the explicit
|
|
121
|
+
// stop below (a scheduled stop from a duration arg would just be the one
|
|
122
|
+
// this stop() cancels and replaces). Stop past the fadeOut so the tail
|
|
123
|
+
// never clicks.
|
|
124
|
+
src.start(now, start);
|
|
125
|
+
src.stop(now + wallLen + 0.06);
|
|
126
|
+
this.track(src, wallLen + 0.1);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
/* voice glitch: skip this whoop */
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** Create, connect, fire, and track one buffer source. */
|
|
133
|
+
emit(buffer, gainNode, opts) {
|
|
134
|
+
let src = null;
|
|
135
|
+
try {
|
|
136
|
+
src = new Tone.ToneBufferSource({
|
|
137
|
+
url: buffer,
|
|
138
|
+
playbackRate: opts.rate,
|
|
139
|
+
fadeIn: opts.fade,
|
|
140
|
+
fadeOut: opts.fade,
|
|
141
|
+
});
|
|
142
|
+
src.connect(gainNode);
|
|
143
|
+
src.start(Tone.now(), opts.offset, opts.wallDur);
|
|
144
|
+
this.track(src, opts.wallDur); // only a started source can reach onended
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// A source that failed to connect or start never fires onended: reap it
|
|
148
|
+
// here rather than stranding it in the live set.
|
|
149
|
+
try {
|
|
150
|
+
src?.dispose();
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
/* already gone */
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Track a started source so it's reaped when done. `onended` is the primary
|
|
158
|
+
* signal, but Tone does not guarantee it fires (a suspended context, a
|
|
159
|
+
* duration past the buffer end), so a timer sized to the source's expected
|
|
160
|
+
* lifetime is a guaranteed backstop: without it a source that never fires
|
|
161
|
+
* onended would sit in `live` until layer teardown. Whichever fires first
|
|
162
|
+
* reaps once (dispose is idempotent) and cancels the other. */
|
|
163
|
+
track(src, lifetimeS) {
|
|
164
|
+
this.live.add(src);
|
|
165
|
+
let timer = null;
|
|
166
|
+
const reap = () => {
|
|
167
|
+
if (timer !== null) {
|
|
168
|
+
clearTimeout(timer);
|
|
169
|
+
this.reapTimers.delete(timer);
|
|
170
|
+
timer = null;
|
|
171
|
+
}
|
|
172
|
+
this.live.delete(src);
|
|
173
|
+
try {
|
|
174
|
+
src.dispose();
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
/* already gone */
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
src.onended = reap;
|
|
181
|
+
timer = setTimeout(reap, (Math.max(0, lifetimeS) + 0.3) * 1000);
|
|
182
|
+
this.reapTimers.add(timer);
|
|
183
|
+
}
|
|
184
|
+
dispose() {
|
|
185
|
+
this.disposed = true;
|
|
186
|
+
for (const t of this.reapTimers)
|
|
187
|
+
clearTimeout(t);
|
|
188
|
+
this.reapTimers.clear();
|
|
189
|
+
for (const src of this.live) {
|
|
190
|
+
try {
|
|
191
|
+
src.stop();
|
|
192
|
+
src.dispose();
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
/* already gone */
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
this.live.clear();
|
|
199
|
+
try {
|
|
200
|
+
this.talk?.dispose();
|
|
201
|
+
this.laughs?.dispose();
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
/* already gone */
|
|
205
|
+
}
|
|
206
|
+
this.talk = this.laughs = null;
|
|
207
|
+
this.talkMask = null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { CrowdVoices };
|
|
212
|
+
//# sourceMappingURL=toneCrowdVoices.js.map
|