Git Product home page Git Product logo

loopgan's Introduction

LoopGAN — StyleGAN2 + MelGAN Audio Loop Generation

This repository is heavily dependent on the official repository of the following paper: Hung, Tun-Min, Bo-Yu Chen, Yen-Tung Yeh, and Yi-Hsuan Yang. 2021. “A Benchmarking Initiative for Audio-Domain Music Generation Using the Freesound Loop Dataset.” [arxiv]

Environment

Tested in Python 3.8.

$ pip install -r requirements.txt 

Pre-trained Models

  • We provide a pre-trained StyleGAN2 model trained on spectrograms of various drum beats of electronic dance music.
$ gdown -O drumbeats1_230000.pt 1B3ZWTJFuZbPPH4uIIz-pCcBTLu9-w4nw

Run the notebook

  • run jupyter notebook and open ./generate_audio.ipynb
$ jupyter notebook
  • In this notebook, the StyleGAN model generates a batch of loops (batch size: 4) with a random input vector Z. Before being fed to the model, gaussian noise is added to the vector so that each loop is slightly different from each other. Then, you can mix them smoothly on the provided Max patch (see below).
  • If you play two loops from a batch in stereo, you'll get interesting stereo effects, depending on the noise you added to the Z.
  • The script saves a batch of 4 loops as a single 4-channel audio file for easy handling.
  • Also, when you run the script, four Z vectors are selected randomly as "Z presets". You can "morph" on the Max patch between these four presets.

Max Patch

  • We provide a Max/MSP patch to interact with the notebook.
  • "Mix" section lets you mix loops within a batch.

Disclaimer

  • You can run the jupyter notebook on the CPU, but it will be painfully slow to use it for any live performances.
  • For the actual live performance, I used two buffers for each channel and cross-faded between these two buffers every time a new batch of loops is generated to realize smooth transitions between batches.

Training

loopgan's People

Contributors

naotokui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.