AIME is an interactive web application for creating, exploring, and manipulating musical sequences using AI-powered melody generation. Built with Vue 3 and Google's Magenta.js, AIME provides an intuitive grid-based interface where you can draw melodies, generate variations, and create musical interpolations.
The application is optimized for desktop and tablet devices (iPad), offering touch-friendly controls and responsive design for creative music exploration on multiple platforms.
https://snrau.github.io/AIME/#/
chrome://flags
Disable EdgeToEdgeEverywhere
- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to:
http://localhost:5174/
To access the application on an iPad or other mobile device on your local network:
- Start the development server with the host option:
npm run dev -- --host-
Find your computer's local IP address:
- macOS/Linux: Open Terminal and run:
ifconfig | grep "inet " | grep -v 127.0.0.1
- Windows: Open Command Prompt and run:
ipconfig
- Look for your local IP address (usually starts with
192.168.x.xor10.x.x.x)
- macOS/Linux: Open Terminal and run:
-
On your iPad, open Safari and navigate to:
http://YOUR_IP_ADDRESS:5174/
Replace YOUR_IP_ADDRESS with the IP address you found in step 2 (e.g., http://192.168.1.100:5174/)
Note: Make sure your iPad and computer are connected to the same Wi-Fi network.
VSCode + Volar (and disable Vetur).
├── public/ # Static assets
│ └── midi/ # MIDI files for melody generation
├── src/
│ ├── assets/ # CSS and SVG assets
│ ├── components/ # Vue components
│ │ ├── BufferComponent.vue # Buffer management component
│ │ ├── CircleOfFifths.vue # Musical key selection interface
│ │ ├── DrawComponent.vue # Piano roll editor
│ │ ├── HeaderComponent.vue # Application header
│ │ ├── HelpComponent.vue # User guide and documentation
│ │ ├── HomeComponent.vue # Home view component
│ │ ├── MelodyComponent.vue # Melody playback and display
│ │ ├── PopupModal.vue # Modal dialog component
│ │ ├── RoomComponent.vue # Main grid workspace
│ │ ├── RoomSelection.vue # Saved rooms selector
│ │ ├── SequencePreview.vue # Sequence preview component
│ │ └── SquareComponent.vue # Individual grid square
│ ├── composables/ # Reusable composition functions
│ │ ├── useFirstSquareLogic.js # First square creation logic
│ │ ├── useFormations.js # Grid formation patterns
│ │ ├── useGrid.js # Grid management utilities
│ │ └── usePullSquare.js # Square dragging and interpolation
│ ├── constants/ # Application constants
│ │ └── colors.js # Color definitions
│ ├── router/ # Vue Router configuration
│ ├── services/ # External services
│ │ └── magentaService.js # Magenta.js AI music generation
│ ├── stores/ # Pinia state management
│ │ ├── counter.js # Counter state (example)
│ │ ├── gridHistory.js # Grid history and undo/redo
│ │ ├── mode.js # Application mode (create/remove)
│ │ ├── popupStore.js # Popup state management
│ │ ├── roomStore.js # Room save/load state
│ │ └── tonicKey.js # Musical key and tonic state
│ ├── utils/ # Utility functions
│ │ ├── gridUtils.js # Grid manipulation helpers
│ │ └── tonicColorUtils.js # Tonal color calculations
│ └── views/ # View components
│ └── HomeView.vue # Main application view
This application is built with Vue 3 and Vite, using the Composition API for reactive state management. The architecture follows a component-based design with clear separation of concerns:
- Vue 3: JavaScript framework with Composition API
- Vite: Frontend build tool for fast development
- Pinia: Official state management library for Vue 3
- Magenta.js: Google's machine learning library for music generation
- Font Awesome: Icon library for UI elements
- Composables: Reusable logic extracted into composition functions (e.g.,
useGrid,usePullSquare) - State Management: Centralized state using Pinia stores for grid history, room data, and application modes
- Service Layer: Separation of AI music generation logic into dedicated services
- Reactive Grid System: Dynamic grid management with interpolation and melody generation capabilities
- MIDI Integration: Support for both Web MIDI API and fallback audio playback
- Create Your First Sequence: Click on the square in the middle of the grid to open the piano roll editor
- Draw Notes: Click and drag on the piano roll to create notes at different pitches and durations
- Save: Click the save button to add your sequence to the grid
- Auto-Generation: Three additional squares with similar melodies will be automatically generated using AI
The piano roll editor provides a comprehensive interface for creating and editing musical sequences:
- Piano Roll Grid: Click and drag to draw notes across different pitches (C4 to F6) and time steps
- Piano Keys: Click on the left-side piano keys to preview individual notes
- Playback: Play your sequence to hear how it sounds
- Random Generation: Click the dice button to generate a random note sequence as a creative starting point
- Controls: Save your work, reset the grid, or close the editor
- Smart Note Grouping: Continuous notes are automatically grouped when drawing across multiple steps
- Drag to Interpolate: Pull a square to a new position. If another square is nearby, the system will create a musical interpolation between the two melodies
- Simple Moving: If no interpolation partner is found, the square simply moves to the new position
- Valid Positions: Green highlighting indicates where a square can be placed
- Ensure Create Mode is active (default setting, toggle located above buffer 2)
- Click on any empty grid position
- Add a note sequence using the piano roll editor
- The square becomes available for melody interpolation and sequencing
- Toggle the slider above buffer 2 to Remove Mode
- Click on any square to remove it from the grid
- Note: Dragging squares for moving/copying still works in Remove Mode
Create complex melodic sequences by connecting multiple squares:
- Activate Drawing Mode: Toggle the drawing mode switch (next to create mode, above the copy slider)
- Draw Your Path: Click and drag to draw a line across the squares in your grid
- Automatic Sequencing: All squares the line passes through are added to the melody in the order crossed
- Play: Use the play button in the melody container to listen to your created sequence
- Save Room: Click the save button in the top-left corner of the header to save your current workspace
- Load Rooms: Access previously saved rooms through the rooms window (button next to save in the header)
- Persistent Storage: All rooms are saved locally in your browser
The application uses an intelligent color system to visualize musical tonality:
- Color Coding: Squares are colored based on whether their average pitch is bright or dark relative to the selected tonic
- Change Tonic: Use the Circle of Fifths in the header (next to room selection) to select different tonic tones
- Visual Harmony: Colors help identify harmonic relationships between different melody squares
- Similar Melody Generation: Magenta.js AI automatically generates variations of your melodies
- Melody Interpolation: Smoothly transition between two different melodies using machine learning
- Creative Assistance: Random generation and AI suggestions help overcome creative blocks