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

tomusic-ai

v1767493.965.194

Published

Professional integration for https://tomusic.ai/

Readme

tomusic-ai

A JavaScript library to programmatically interact with the tomusic.ai platform, enabling music generation and manipulation directly from your code. This package provides a simple and efficient way to integrate AI-powered music tools into your applications.

Installation

Install the package using npm: bash npm install tomusic-ai

Usage Examples

Here are a few examples demonstrating how to use the tomusic-ai package in your JavaScript applications:

1. Generate a Melody: javascript const tomusic = require('tomusic-ai');

async function generateMelody() { try { const melody = await tomusic.generateMelody({ style: 'Classical', tempo: 120, key: 'C Major', duration: 30 // seconds });

console.log('Generated Melody:', melody);
// You can then save or play the generated melody (e.g., as MIDI).

} catch (error) { console.error('Error generating melody:', error); } }

generateMelody();

2. Harmonize an Existing Melody: javascript const tomusic = require('tomusic-ai');

async function harmonizeMelody(melodyData) { // melodyData should be a suitable format (e.g., MIDI data) try { const harmony = await tomusic.harmonizeMelody(melodyData, { style: 'Jazz', voiceCount: 4 });

console.log('Harmonized Melody:', harmony);
// Process the harmonized melody as needed.

} catch (error) { console.error('Error harmonizing melody:', error); } }

// Example Usage (replace with actual melody data): const myMelody = { /* ... your melody data ... */ }; harmonizeMelody(myMelody);

3. Generate Music Based on Textual Description: javascript const tomusic = require('tomusic-ai');

async function generateFromText(description) { try { const music = await tomusic.generateFromText(description, { duration: 60, // seconds instrument: 'Piano' });

console.log('Generated Music from Text:', music);
// Save or stream the generated music.

} catch (error) { console.error('Error generating music from text:', error); } }

generateFromText('A happy piano piece for a sunny day.');

4. Change the Tempo of a Song: javascript const tomusic = require('tomusic-ai');

async function changeTempo(songData, newTempo) { try { const modifiedSong = await tomusic.changeTempo(songData, newTempo);

console.log('Tempo changed:', modifiedSong);
// Play or save the modified song.

} catch (error) { console.error('Error changing tempo:', error); } }

// Example Usage (replace with actual song data and new tempo): const mySong = { /* ... your song data ... */ }; const desiredTempo = 140; changeTempo(mySong, desiredTempo);

5. Generate Background Music for a Video: javascript const tomusic = require('tomusic-ai');

async function generateBackgroundMusic(videoDescription) { try { const backgroundMusic = await tomusic.generateBackgroundMusic(videoDescription, { duration: 120, // seconds style: 'Ambient', });

console.log('Generated background music:', backgroundMusic);
// Integrate the generated music with your video.

} catch (error) { console.error('Error generating background music:', error); } }

generateBackgroundMusic('A nature documentary about rainforests.');

API Summary

  • generateMelody(options): Generates a melody based on the provided options (style, tempo, key, duration). Returns a promise that resolves with the melody data.
  • harmonizeMelody(melodyData, options): Harmonizes an existing melody. Requires melody data and options such as style and voice count. Returns a promise resolving with the harmonized melody data.
  • generateFromText(description, options): Generates music based on a textual description. Options include duration and instrument. Returns a promise resolving with the generated music data.
  • changeTempo(songData, newTempo): Changes the tempo of a song. Requires song data and the desired new tempo. Returns a promise resolving with the modified song data.
  • generateBackgroundMusic(videoDescription, options): Generates background music suitable for a video based on its description. Options include duration and style. Returns a promise resolving with the generated music data.

License

MIT

This package is part of the tomusic-ai ecosystem. For advanced features and enterprise-grade tools, visit: https://tomusic.ai/