-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·90 lines (77 loc) · 2.57 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·90 lines (77 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# Setup script for Musico (Raspberry Pi and macOS)
echo "Setting up Musico..."
# Detect operating system
if [[ "$OSTYPE" == "darwin"* ]]; then
OS="macos"
echo "Detected macOS"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
OS="linux"
echo "Detected Linux (Raspberry Pi)"
else
echo "Error: Unsupported operating system: $OSTYPE"
echo "This script supports macOS and Linux (Raspberry Pi)"
exit 1
fi
# Check if Python 3 is installed
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 is not installed. Please install Python 3 first."
if [[ "$OS" == "macos" ]]; then
echo "On macOS, you can install Python 3 using Homebrew: brew install python3"
echo "Or download from https://www.python.org/downloads/"
else
echo "On Linux, install with: sudo apt install python3"
fi
exit 1
fi
# Check if pip is installed
if ! command -v pip3 &> /dev/null; then
echo "Installing pip..."
if [[ "$OS" == "macos" ]]; then
# On macOS, pip3 usually comes with Python 3
echo "Please install pip3 manually or reinstall Python 3"
exit 1
else
sudo apt update
sudo apt install python3-pip -y
fi
fi
# Install system dependencies for audio processing
echo "Installing system dependencies..."
if [[ "$OS" == "macos" ]]; then
# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Install portaudio and other dependencies
echo "Installing audio dependencies via Homebrew..."
brew install portaudio
brew install ffmpeg # For audio processing with pydub
brew install python-tk # For tkinter GUI support
elif [[ "$OS" == "linux" ]]; then
sudo apt update
sudo apt install portaudio19-dev python3-pyaudio python3-venv python3-tk -y
fi
# Create virtual environment
echo "Creating virtual environment..."
python3 -m venv music_env
# Activate virtual environment
echo "Activating virtual environment..."
source music_env/bin/activate
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# Install Python dependencies
echo "Installing Python dependencies..."
pip install -r requirements.txt
echo ""
echo "Setup complete!"
echo ""
echo "To run Musico:"
echo "1. Activate the virtual environment: source music_env/bin/activate"
echo "2. Run the script: python Musico.py"
echo ""
echo "Or simply run: ./run.sh"
echo ""
echo "To deactivate the virtual environment when done: deactivate"