Skip to content

AI driven drum patterns 🥈 Runner up for "Most fun/Best easter egg" in Supabase's Launch Week 7 Hackathon

License

Notifications You must be signed in to change notification settings

danryland/groove-ai

Repository files navigation

Groove AI

PLAY: Use Groove AI for yourself

WATCH: Watch a demo

Groove AI - AI Generated Drum Patterns

Hey, I'm Dan Ryland (@RealDanRyland) and I'm a drummer.

As a musician, I'm super interested in the developments around AI generated music and text-to-music AI models.

I've never submitted anything to a hackathon, so as this is my first ever, open source hackathon entry, I decided to make an AI generated drum pattern app.

These drum patterns are named and generated (title, two-line rap, pattern and BPM for a randomly selected genre) by Open AI's GPT 3.5 Turbo.

I then store these generated patterns in Supabase. Every time you load the site, it will randomly select one groove from the database. You can modify this pattern by toggling each beat. You can also generate a new drum pattern.

NEW - You can now download your drum patterns as MIDI. Import this MIDI file into your music software.

Enjoy!

Supabase features

I'm using the following Supabase featues:

  • Database
    • Postgress function
    • Fetch
    • Insert
  • Edge function

Add Postgres function

CREATE OR REPLACE FUNCTION get_random_groove()
RETURNS TABLE (
  id BIGINT,
  created_at TIMESTAMPTZ,
  title TEXT,
  description TEXT,
  genre TEXT,
  beat_high JSONB,
  beat_mid JSONB,
  beat_low JSONB,
  bpm SMALLINT
) AS $$
BEGIN
  RETURN QUERY
  SELECT *
  FROM grooves
  ORDER BY random()
  LIMIT 1;
END;
$$ LANGUAGE plpgsql;

It's build using Quasar framework. To run locally you'll need these variables:

Environment variables

For Quasar:

SUPABASE_URL
SUPABASE_KEY
SUPABASE_FUNCTION

For Supabase edge function:

OPENAI_API_KEY

Install the dependencies

yarn
# or
npm install

Start the app in development mode (hot-code reloading, error reporting, etc.)

quasar dev

Hosting

Hosted on Netlify.

Build command:

quasar build

Publish directory:

dist/spa

Icons

Favicon

icongenie generate -i src/assets/img/logo-groove-ai.png --quality 12 --skip-trim

About

AI driven drum patterns 🥈 Runner up for "Most fun/Best easter egg" in Supabase's Launch Week 7 Hackathon

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published