diff --git a/docker/accompaniator-dev/Dockerfile b/docker/accompaniator-dev/Dockerfile new file mode 100644 index 0000000..1199552 --- /dev/null +++ b/docker/accompaniator-dev/Dockerfile @@ -0,0 +1,3 @@ +FROM accompaniator + +RUN git clone https://github.com/nzinov/accompaniator diff --git a/docker/accompaniator-prod/Dockerfile b/docker/accompaniator-prod/Dockerfile new file mode 100644 index 0000000..ca59bd8 --- /dev/null +++ b/docker/accompaniator-prod/Dockerfile @@ -0,0 +1,3 @@ +FROM accompaniator + +RUN git clone https://github.com/nzinov/accompaniator accompaniator diff --git a/docker/accompaniator/.bashrc b/docker/accompaniator/.bashrc new file mode 100644 index 0000000..3d184de --- /dev/null +++ b/docker/accompaniator/.bashrc @@ -0,0 +1,3 @@ +microphone-test () { + arecord -vvv -f dat /dev/null +} diff --git a/docker/accompaniator/Dockerfile b/docker/accompaniator/Dockerfile new file mode 100644 index 0000000..54b9d07 --- /dev/null +++ b/docker/accompaniator/Dockerfile @@ -0,0 +1,30 @@ +FROM base/devel + +RUN mkdir /build +WORKDIR /build + +RUN pacman -Syu --noconfirm +RUN pacman -S --noconfirm alsa-lib alsa-utils alsa-plugins + +RUN pacman -S --noconfirm fluidsynth soundfont-fluid mpg123 rtmidi + +RUN pacman -S --noconfirm python python-pip python-virtualenv git htop \ + && mkdir env \ + && python3 -m venv env/ \ + && source env/bin/activate + +RUN paccache -rk 0 + +# By copying over requirements first, we make sure that Docker will cache +# our installed requirements rather than reinstall them on every build +ADD requirements.txt /build/ + +RUN pip install --upgrade pip \ + && pip install -r requirements.txt + +ADD . /build/ + +RUN mv asound.conf /etc/asound.conf +RUN cat ./.bashrc >> ~/.bashrc + +CMD ./startup.sh diff --git a/docker/accompaniator/asound.conf b/docker/accompaniator/asound.conf new file mode 100644 index 0000000..6cd8225 --- /dev/null +++ b/docker/accompaniator/asound.conf @@ -0,0 +1,8 @@ +pcm.!default { + type hw + card 1 +} +ctl.!default { + type hw + card 1 +} diff --git a/docker/accompaniator/requirements.txt b/docker/accompaniator/requirements.txt new file mode 100644 index 0000000..777313d --- /dev/null +++ b/docker/accompaniator/requirements.txt @@ -0,0 +1,6 @@ +aubio +pyaudio +mido +python-rtmidi +sklearn +tensorflow diff --git a/docker/accompaniator/startup.sh b/docker/accompaniator/startup.sh new file mode 100755 index 0000000..270d119 --- /dev/null +++ b/docker/accompaniator/startup.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Start the first process +nohup fluidsynth -a alsa -m alsa_seq -l -s -i /usr/share/soundfonts/FluidR3_GM.sf2 & +status=$? +if [ $status -ne 0 ]; then + echo "Failed to start fluidsynth: $status" + exit $status +else + echo "Fluidsynth ran successfully" +fi + +bash \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..0398eed --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3.1' + +services: + + accompaniator: + image: accompaniator + build: accompaniator + devices: + - /dev/snd:/dev/snd + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + - /run/dbus/:/run/dbus/:rw + - /dev/shm:/dev/shm + + accompaniator-dev: + image: accompaniator-dev + build: accompaniator-dev + devices: + - /dev/snd:/dev/snd + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + - /run/dbus/:/run/dbus/:rw + - /dev/shm:/dev/shm + - ./../:/build/accompaniator + + accompaniator-prod: + image: accompaniator-prod + build: accompaniator-prod + devices: + - /dev/snd:/dev/snd + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + - /run/dbus/:/run/dbus/:rw + - /dev/shm:/dev/shm diff --git a/nottingham_test/rf_nottingham.pkl b/production/models/rf_4_4_no_beat.pkl similarity index 100% rename from nottingham_test/rf_nottingham.pkl rename to production/models/rf_4_4_no_beat.pkl diff --git a/production/rf_nottingham.pkl b/production/models/rf_nottingham.pkl similarity index 100% rename from production/rf_nottingham.pkl rename to production/models/rf_nottingham.pkl