One entry point for "humanize this file", so a game never names the class that does the
work. The tier decides the engine; everything else about the request is the same for
both shipped tiers, which is why the request extends the options rather than wrapping
them.
The engines load on demand through dynamic import. That is a size decision, not a
style one: GrooveHumanizer, the extractor and the converter are all reachable from a
game that only ever wanted the lite tier, and none of them should be in the bundle
merely for living in the same module. The magenta tier is the case where loading would
never succeed at all: it needs @magenta/music and a PerformanceRNN checkpoint, and a
file:// build can fetch neither, so asking for it fails by name instead of hanging on
a request that cannot resolve.
//the convenience path: the tier follows from the request constlite = awaithumanizeMidi(file, { intensity:0.5, seed:1 });
//or hold the engine, when several files go through the same one constengine = awaitHumanizerFactory.create('lite'); constagain = awaitengine.process(lite, { intensity:0.5, seed:2 });
One entry point for "humanize this file", so a game never names the class that does the work. The tier decides the engine; everything else about the request is the same for both shipped tiers, which is why the request extends the options rather than wrapping them.
The engines load on demand through dynamic import. That is a size decision, not a style one:
GrooveHumanizer, the extractor and the converter are all reachable from a game that only ever wanted the lite tier, and none of them should be in the bundle merely for living in the same module. The magenta tier is the case where loading would never succeed at all: it needs@magenta/musicand a PerformanceRNN checkpoint, and afile://build can fetch neither, so asking for it fails by name instead of hanging on a request that cannot resolve.Example