Skip to content

Commit a5d917f

Browse files
Add Windows support + docs, closes #22, closes #25 (#23)
* feat: Add Windows Support, closes #22 * ci: GitHub Actions Runner * Update scripts/models.ps1 Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Update scripts/build/debug.sh Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * ci: Create `release.ps1` * ci: Exclude `cl` build on Ubuntu * ci: Remove hardcoded `cl` location * docs: Fix documentation, closes #25 * ci: Build release `llama.cpp` in `release.sh` * fix: Enable WebView 2 * Add `WebView2` NuGet Package * ci: Create run scripts for local testing * fix: Force package installation by script --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent ad8b792 commit a5d917f

21 files changed

+287
-234
lines changed

.github/workflows/cmake.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,37 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-latest, macos-latest]
16+
os: [ubuntu-latest, macos-latest, windows-latest]
1717
build_type: [Release]
18-
c_compiler: [gcc, clang]
18+
c_compiler: [clang, cl]
1919
include:
20-
- os: ubuntu-latest
21-
c_compiler: gcc
22-
cpp_compiler: g++
2320
- os: ubuntu-latest
2421
c_compiler: clang
2522
cpp_compiler: clang++
2623
- os: macos-latest
2724
c_compiler: clang
2825
cpp_compiler: clang++
26+
- os: windows-latest
27+
c_compiler: cl
28+
cpp_compiler: cl
2929
exclude:
30+
- os: ubuntu-latest
31+
c_compiler: cl
3032
- os: macos-latest
31-
c_compiler: gcc
33+
c_compiler: cl
34+
- os: windows-latest
35+
c_compiler: clang
3236

3337
steps:
3438
- uses: actions/checkout@v4
3539
with:
3640
submodules: 'true'
3741

38-
- name: Build (Linux/macOS)
42+
- name: Build on Windows
43+
if: runner.os == 'Windows'
44+
run: .\scripts\build\release.ps1
45+
shell: pwsh
46+
47+
- name: Build on Linux/macOS
48+
if: runner.os != 'Windows'
3949
run: ./scripts/build/release.sh

.gitmodules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[submodule "JUCE"]
2-
path = JUCE
3-
url = git@github.com:juce-framework/JUCE.git
41
[submodule "llama.cpp"]
52
path = llama.cpp
6-
url = git@github.com:ggerganov/llama.cpp.git
3+
url = https://github.com/ggerganov/llama.cpp.git
4+
[submodule "JUCE"]
5+
path = JUCE
6+
url = https://github.com/juce-framework/JUCE.git

CMakeLists.txt

Lines changed: 99 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ juce_add_plugin(musegpt
1010
PLUGIN_CODE Muse
1111
FORMATS AAX AU AUv3 VST3 Standalone
1212
PRODUCT_NAME "musegpt"
13-
COPY_PLUGIN_AFTER_BUILD TRUE)
13+
COPY_PLUGIN_AFTER_BUILD TRUE
14+
NEEDS_WEBVIEW2 TRUE)
1415
juce_generate_juce_header(musegpt)
1516

1617
target_sources(musegpt
@@ -24,6 +25,7 @@ target_compile_definitions(musegpt
2425
JUCE_LOGGING=1 # Enable logging
2526
JUCE_STRICT_REFCOUNTEDPOINTER=1
2627
JUCE_WEB_BROWSER=1
28+
JUCE_USE_WIN_WEBVIEW2_WITH_STATIC_LINKING=1
2729
JUCE_USE_CURL=0
2830
JUCE_VST3_CAN_REPLACE_VST2=0)
2931

@@ -68,58 +70,99 @@ PRIVATE
6870
$<$<CONFIG:Release>:-O3>
6971
)
7072

71-
# Add llama-server as a binary resource
72-
add_custom_command(
73-
OUTPUT ${CMAKE_BINARY_DIR}/llama-server
74-
COMMAND ${CMAKE_COMMAND} -E copy
75-
${CMAKE_SOURCE_DIR}/build/llama.cpp/bin/llama-server
76-
${CMAKE_BINARY_DIR}/llama-server
77-
DEPENDS ${CMAKE_SOURCE_DIR}/build/llama.cpp/bin/llama-server
78-
)
79-
add_custom_target(copy_llama_server ALL DEPENDS ${CMAKE_BINARY_DIR}/llama-server)
80-
81-
# Ensure the executable is copied into the bundle
82-
set_source_files_properties(${CMAKE_BINARY_DIR}/llama-server PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
83-
target_sources(musegpt PRIVATE ${CMAKE_BINARY_DIR}/llama-server)
84-
85-
# Copy llama-server to VST plugin format's output directory
86-
add_custom_command(TARGET musegpt POST_BUILD
87-
COMMAND ${CMAKE_COMMAND} -E copy
88-
${CMAKE_BINARY_DIR}/llama-server
89-
$<TARGET_FILE_DIR:musegpt>/VST3/musegpt.vst3/Contents/Resources/llama-server
90-
)
91-
92-
# Copy llama-server to Standalone plugin format's output directory
93-
add_custom_command(TARGET musegpt POST_BUILD
94-
COMMAND ${CMAKE_COMMAND} -E copy
95-
${CMAKE_BINARY_DIR}/llama-server
96-
$<TARGET_FILE_DIR:musegpt>/Standalone/musegpt.app/Contents/Resources/llama-server
97-
)
98-
99-
# Copy model weights to VST plugin format's output directory
100-
add_custom_command(TARGET musegpt POST_BUILD
101-
COMMAND ${CMAKE_COMMAND} -E copy
102-
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
103-
$<TARGET_FILE_DIR:musegpt>/VST3/musegpt.vst3/Contents/Resources/gemma-2b-it.fp16.gguf
104-
)
105-
106-
# Copy model weights to Standalone plugin format's output directory
107-
add_custom_command(TARGET musegpt POST_BUILD
108-
COMMAND ${CMAKE_COMMAND} -E copy
109-
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
110-
$<TARGET_FILE_DIR:musegpt>/Standalone/musegpt.app/Contents/Resources/gemma-2b-it.fp16.gguf
111-
)
112-
113-
# Copy model weights to AAX plugin format's output directory
114-
add_custom_command(TARGET musegpt POST_BUILD
115-
COMMAND ${CMAKE_COMMAND} -E copy
116-
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
117-
$<TARGET_FILE_DIR:musegpt>/AAX/musegpt.aaxplugin/Contents/Resources/gemma-2b-it.fp16.gguf
118-
)
119-
120-
# Copy model weights to AU plugin format's output directory
121-
add_custom_command(TARGET musegpt POST_BUILD
122-
COMMAND ${CMAKE_COMMAND} -E copy
123-
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
124-
$<TARGET_FILE_DIR:musegpt>/AU/musegp.component/Contents/Resources/gemma-2b-it.fp16.gguf
125-
)
73+
# Add llama-server as a binary resource and copy files
74+
if(WIN32)
75+
# Windows-specific commands
76+
add_custom_command(
77+
OUTPUT ${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe
78+
COMMAND ${CMAKE_COMMAND} -E copy
79+
${CMAKE_SOURCE_DIR}/build/llama.cpp/bin/$<CONFIG>/llama-server.exe
80+
${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe
81+
DEPENDS ${CMAKE_SOURCE_DIR}/build/llama.cpp/bin/$<CONFIG>/llama-server.exe
82+
)
83+
add_custom_target(copy_llama_server ALL DEPENDS ${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe)
84+
set_source_files_properties(${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
85+
target_sources(musegpt PRIVATE ${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe)
86+
87+
# Copy llama-server to VST plugin format's output directory
88+
add_custom_command(TARGET musegpt POST_BUILD
89+
COMMAND ${CMAKE_COMMAND} -E copy
90+
${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe
91+
$<TARGET_FILE_DIR:musegpt>/VST3/musegpt.vst3/Contents/Resources/llama-server.exe
92+
)
93+
94+
# Copy llama-server to Standalone plugin format's output directory
95+
add_custom_command(TARGET musegpt POST_BUILD
96+
COMMAND ${CMAKE_COMMAND} -E copy
97+
${CMAKE_BINARY_DIR}/$<CONFIG>/llama-server.exe
98+
$<TARGET_FILE_DIR:musegpt>/musegpt.exe/llama-server.exe
99+
)
100+
101+
# Copy model weights to VST plugin format's output directory
102+
add_custom_command(TARGET musegpt POST_BUILD
103+
COMMAND ${CMAKE_COMMAND} -E copy
104+
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
105+
$<TARGET_FILE_DIR:musegpt>/VST3/musegpt.vst3/Contents/Resources/gemma-2b-it.fp16.gguf
106+
)
107+
108+
# Copy model weights to Standalone plugin format's output directory
109+
add_custom_command(TARGET musegpt POST_BUILD
110+
COMMAND ${CMAKE_COMMAND} -E copy
111+
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
112+
$<TARGET_FILE_DIR:musegpt>/musegpt.exe/gemma-2b-it.fp16.gguf
113+
)
114+
else()
115+
# Non-Windows commands
116+
add_custom_command(
117+
OUTPUT ${CMAKE_BINARY_DIR}/llama-server
118+
COMMAND ${CMAKE_COMMAND} -E copy
119+
${CMAKE_SOURCE_DIR}/build/llama.cpp/bin/llama-server
120+
${CMAKE_BINARY_DIR}/llama-server
121+
DEPENDS ${CMAKE_SOURCE_DIR}/build/llama.cpp/bin/llama-server
122+
)
123+
add_custom_target(copy_llama_server ALL DEPENDS ${CMAKE_BINARY_DIR}/llama-server)
124+
set_source_files_properties(${CMAKE_BINARY_DIR}/llama-server PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
125+
target_sources(musegpt PRIVATE ${CMAKE_BINARY_DIR}/llama-server)
126+
127+
# Copy llama-server to VST plugin format's output directory
128+
add_custom_command(TARGET musegpt POST_BUILD
129+
COMMAND ${CMAKE_COMMAND} -E copy
130+
${CMAKE_BINARY_DIR}/llama-server
131+
$<TARGET_FILE_DIR:musegpt>/VST3/musegpt.vst3/Contents/Resources/llama-server
132+
)
133+
134+
# Copy llama-server to Standalone plugin format's output directory
135+
add_custom_command(TARGET musegpt POST_BUILD
136+
COMMAND ${CMAKE_COMMAND} -E copy
137+
${CMAKE_BINARY_DIR}/llama-server
138+
$<TARGET_FILE_DIR:musegpt>/Standalone/musegpt.app/Contents/Resources/llama-server
139+
)
140+
141+
# Copy model weights to VST plugin format's output directory
142+
add_custom_command(TARGET musegpt POST_BUILD
143+
COMMAND ${CMAKE_COMMAND} -E copy
144+
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
145+
$<TARGET_FILE_DIR:musegpt>/VST3/musegpt.vst3/Contents/Resources/gemma-2b-it.fp16.gguf
146+
)
147+
148+
# Copy model weights to Standalone plugin format's output directory
149+
add_custom_command(TARGET musegpt POST_BUILD
150+
COMMAND ${CMAKE_COMMAND} -E copy
151+
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
152+
$<TARGET_FILE_DIR:musegpt>/Standalone/musegpt.app/Contents/Resources/gemma-2b-it.fp16.gguf
153+
)
154+
155+
# Copy model weights to AAX plugin format's output directory
156+
add_custom_command(TARGET musegpt POST_BUILD
157+
COMMAND ${CMAKE_COMMAND} -E copy
158+
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
159+
$<TARGET_FILE_DIR:musegpt>/AAX/musegpt.aaxplugin/Contents/Resources/gemma-2b-it.fp16.gguf
160+
)
161+
162+
# Copy model weights to AU plugin format's output directory
163+
add_custom_command(TARGET musegpt POST_BUILD
164+
COMMAND ${CMAKE_COMMAND} -E copy
165+
${CMAKE_SOURCE_DIR}/models/gemma-2b-it.fp16.gguf
166+
$<TARGET_FILE_DIR:musegpt>/AU/musegp.component/Contents/Resources/gemma-2b-it.fp16.gguf
167+
)
168+
endif()

README.md

Lines changed: 9 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# [musegpt](https://github.com/greynewell/musegpt) [![GitHub Repo stars](https://img.shields.io/github/stars/greynewell/musegpt)](https://github.com/greynewell/musegpt/stargazers)
22

3-
[![CMake](https://github.com/greynewell/musegpt/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/greynewell/musegpt/actions/workflows/cmake.yml) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) [![Platform Support](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue)](#supported-platforms) [![C++](https://img.shields.io/badge/c++-17-%2300599C.svg?logo=c%2B%2B&logoColor=white)](https://isocpp.org/) [![JUCE](https://img.shields.io/badge/JUCE-8-8DC63F&logo=juce&logoColor=white)](https://juce.com/) [![llama.cpp](https://img.shields.io/badge/llama.cpp-feff4aa-violet&logoColor=white)](https://github.com/ggerganov/llama.cpp/commit/feff4aa8461da7c432d144c11da4802e41fef3cf)
3+
[![CMake](https://github.com/greynewell/musegpt/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/greynewell/musegpt/actions/workflows/cmake.yml) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://github.com/greynewell/musegpt/blob/main/LICENSE) [![Platform Support](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-blue)](https://musegpt.org/requirements.html) [![C++](https://img.shields.io/badge/c++-17-%2300599C.svg?logo=c%2B%2B&logoColor=white)](https://musegpt.org/requirements.html) [![JUCE](https://img.shields.io/badge/JUCE-8-8DC63F&logo=juce&logoColor=white)](https://musegpt.org/requirements.html) [![llama.cpp](https://img.shields.io/badge/llama.cpp-feff4aa-violet&logoColor=white)](https://musegpt.org/requirements.html)
44

5-
Run local Large Language Models (LLMs) in your Digital Audio Workstation (DAW) to create music.
5+
Run local Large Language Models (LLMs) in your Digital Audio Workstation (DAW) to provide inspiration, instructions, and analysis for your music creation.
66

77
## Table of Contents
88

99
- [Features](#features)
1010
- [Demo](#demo)
11-
- [Installation](#installation)
12-
- [Getting Started](#getting-started)
1311
- [Requirements](#requirements)
12+
- [Installation](#installation)
1413
- [Usage](#usage)
15-
- [Supported Platforms](#supported-platforms)
16-
- [Supported Models](#supported-models)
1714
- [Architecture](#architecture)
1815
- [Contributing](#contributing)
1916
- [License](#license)
@@ -36,94 +33,19 @@ For more information about plans for upcoming features, check out the [Roadmap o
3633

3734
*Click the image above to watch a demo of musegpt in action.*
3835

39-
## Installation
40-
41-
To install `musegpt`, you can download the latest binaries from [Releases](https://github.com/greynewell/musegpt/releases).
42-
43-
If you want to build from source, follow these steps:
44-
45-
1. **Clone the repository:**
46-
47-
```bash
48-
git clone --recurse-submodules -j2 https://github.com/greynewell/musegpt.git
49-
cd musegpt
50-
```
51-
52-
2. **Install dependencies:**
53-
54-
Ensure you have the required dependencies installed. See [Requirements](#requirements) for details.
55-
56-
3. **Build the project:**
57-
58-
Run the shell build script:
59-
60-
```bash
61-
./scripts/build/debug.sh
62-
```
63-
64-
or
65-
66-
```bash
67-
./scripts/build/release.sh
68-
```
69-
70-
4. **Install the plugin:**
71-
72-
CMake will automatically copy the built VST3, AU, or AAX plugin to your DAW's plugin directory.
73-
74-
- **macOS:** `~/Library/Audio/Plug-Ins/VST3/`
75-
- **Linux:** `~/.vst3/`
76-
77-
## Getting Started
78-
79-
After installing musegpt, open your DAW and rescan for new plugins. Load `musegpt` as a plugin and start interacting with the LLM to enhance your music creation process!
80-
81-
## System Prompt
82-
83-
Feel free to experiment with the system prompt to customize the behavior of the LLM. Here's a suggestion to get you started:
84-
85-
> You are a helpful assistant that lives inside a musician's Digital Audio Workstation. Help them by giving them step-by-step instructions about music—composition, writing, performance, production, and engineering—in a creative and methodical way.
86-
8736
## Requirements
8837

89-
- **Operating System:**
90-
- macOS 10.11 or later
91-
- Linux (mainstream distributions)
92-
- **DAW Support:** Any DAW that supports VST3 plugins (Ableton Live, FL Studio, Logic Pro, Pro Tools, etc.)
93-
- **Dependencies:**
94-
- [JUCE](https://juce.com/) (Audio application framework)
95-
- [llama.cpp](https://github.com/ggerganov/llama.cpp) (LLM inference library)
96-
- C++17 compatible compiler (e.g., GCC 7+, Clang 5+, MSVC 2017+)
97-
- [CMake](https://cmake.org/) 3.15 or later
98-
99-
## Usage
100-
101-
1. **Load the Plugin:**
102-
103-
In your DAW, add musegpt as a VST3 plugin on a track.
38+
You'll need a C++17 compatible compiler, CMake, and Python 3.10 or later. See [Requirements](https://musegpt.org/requirements.html) for more details on supported Operating Systems, models, DAWs, and more.
10439

105-
2. **Interact with the LLM:**
106-
107-
Use the plugin's interface to chat with the integrated LLM. You can input MIDI or audio data for analysis (features under development).
108-
109-
3. **Create Music:**
110-
111-
Leverage the power of AI to inspire new musical ideas, assist with composition, or generate creative suggestions.
112-
113-
## Supported Platforms
114-
115-
musegpt is cross-platform and supports the following operating systems:
116-
117-
- **macOS:** macOS 10.11 or later
118-
- **Linux:** Mainstream distributions
40+
## Installation
11941

120-
## Supported Models
42+
To install `musegpt`, you can download the latest binaries from [Releases](https://github.com/greynewell/musegpt/releases).
12143

122-
musegpt currently supports the following models:
44+
If you want to build from source, follow the [Installation](https://musegpt.org/installation.html) instructions.
12345

124-
- **gemma-2b-it.fp16.gguf**
46+
## Usage
12547

126-
Any model compatible with `llama.cpp` should work with `musegpt`. Feel free to experiment with different models to find the best one for your needs—and raise a pull request!
48+
Please refer to the [Usage](https://musegpt.org/usage.html) section of the documentation.
12749

12850
## Architecture
12951

docs/features.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Features [![GitHub Repo stars](https://img.shields.io/github/stars/greynewell/musegpt)](https://github.com/greynewell/musegpt/stargazers)
22

3+
**musegpt** allows you to run local Large Language Models directly within your DAW, enhancing your music creation process by providing AI-powered assistance.
4+
5+
Current features include:
6+
37
- ✅ LLM chat
48
- ✅ VST3 plugin
59
- ✅ MIDI input
@@ -9,7 +13,7 @@
913
- ❌ MIDI generation (Upcoming)
1014
- ❌ Audio generation (Upcoming)
1115

12-
**musegpt** allows you to run local Large Language Models directly within your DAW, enhancing your music creation process by providing AI-powered assistance.
16+
To see upcoming features, check out the [GitHub issues](https://github.com/greynewell/musegpt/issues) and [Roadmap on GitHub Projects](https://github.com/greynewell/musegpt/projects/1).
1317

1418
---
1519

0 commit comments

Comments
 (0)