npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@motif-studio/sample-lab

v1.2.0

Published

Trim, slice, kit, and instrument helpers for Motif

Readme

@motif-studio/sample-lab

用于 Motif 音频样本工作流程的裁剪、分割、音色包和乐器辅助工具。

包含内容

  • 音频资源裁剪和循环点管理
  • 基于均匀和起始点的分割
  • 音色包构建和音符槽管理
  • 音频乐器创建和音高工具
  • 音频文件导入辅助功能(文件名 → 资源推断)

主要导出

裁剪 (trim.ts)

  • resolveTrimRegion(asset) — 有效的裁剪边界
  • resolveLoopRegion(asset) — 有效的循环边界
  • applyTrim(asset, startMs, endMs) — 设置裁剪点
  • applyLoopPoints(asset, loopStartMs, loopEndMs) — 设置循环点

分割 (slice.ts)

  • sliceEvenly(assetId, startMs, endMs, count) — 分割成相等的部分
  • sliceAtOnsets(assetId, onsets, totalEndMs) — 在特定时间点分割
  • sliceDurationMs(slice) — 分割时长

音色包 (kit.ts)

  • createKit(id, name) — 创建空的音色包
  • addKitSlot(kit, slot) / removeKitSlot(kit, pitch) / updateKitSlot(kit, pitch, update)
  • kitFromSlices(id, name, slices, basePitch) — 自动将分割片段映射到 MIDI 音高
  • kitAssetIds(kit) / findDuplicateSlotPitches(kit)

乐器 (instrument.ts)

  • createSampleInstrument(id, name, assetId, rootNote, pitchMin, pitchMax)
  • pitchToPlaybackRate(rootNote, targetNote) — 音高调整比例
  • isInRange(instrument, note) / rangeSpan(instrument)

导入 (import.ts)

  • inferSourceType(name) — 从文件名推断类型
  • sourceTypeToKind(sourceType) — 映射源类型到资源类型
  • filenameToId(filename) — 从文件名生成 ID
  • buildImportedAsset(filename, durationMs, src) — 从文件创建资源

不包含的内容

  • 音频文件解码或播放(请参见 @motif-studio/audio-engine
  • 音频资源持久化或文件 I/O
  • UI 组件

依赖项

  • @motif-studio/schema — 资源、分割片段、音色包和乐器的类型定义