Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d530cb7
added new texture? unteste
alicelavander Feb 22, 2023
b496201
fixed texture, tested!
alicelavander Mar 3, 2023
b55ce54
Fix typo
alicelavander Mar 4, 2023
3869967
added intervals & isOnSet to the returning value
alicelavander Mar 4, 2023
6aa8584
Merge branch 'dev-textures' of github.com:Alicelavander/AugmentedNet …
alicelavander Mar 4, 2023
d062433
bash script setup.sh
alicelavander Mar 9, 2023
6927a9c
Update setup.sh
alicelavander Mar 9, 2023
ff614ed
Update setup.sh
alicelavander Mar 10, 2023
e894918
Update setup.sh
alicelavander Mar 10, 2023
c0df8cf
cleanup setup.sh
alicelavander Mar 10, 2023
60093d1
Update setup.sh
alicelavander Mar 17, 2023
42cf463
Update README.md
alicelavander Mar 18, 2023
e3ea039
Update setup.sh
alicelavander Mar 18, 2023
d635527
Update README.md
alicelavander Mar 18, 2023
cde2080
Update setup.sh
alicelavander Mar 23, 2023
f0a1a6f
Update setup.sh
alicelavander Mar 26, 2023
7969571
Update setup.sh
alicelavander Mar 26, 2023
270e38d
Update setup.sh
alicelavander Mar 27, 2023
6b7cbb5
Update setup.sh
alicelavander Mar 27, 2023
f9aa2b2
Merge branch 'setup' of github.com:Alicelavander/AugmentedNet into setup
alicelavander Mar 27, 2023
8b843c0
separate setup fiels
alicelavander Mar 27, 2023
021200b
install setup-augmentednet.sh at the end
alicelavander Mar 27, 2023
b0deb2b
updated instructions for GCP VM setup
alicelavander Mar 27, 2023
51d0051
Update README.md
alicelavander Mar 27, 2023
979c4b9
add permission to setup-augmentednet.sh
alicelavander Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions AugmentedNet/texturizers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Templates for texturizing annotation files and turn them into scores."""

import random
from music21 import note
from music21 import interval


class TextureTemplate(object):
Expand Down Expand Up @@ -218,6 +220,36 @@ def templateSeventh(self):
"""


class AuxiliaryNotes(TextureTemplate):
"""A syncopated pattern to separate the upper voice from the rest.

TODO: Add details"""

supported_durations = [1.0, 2.0]

def templateTriad(self):
transposed_note = note.Note(self.notes[2]).transpose(-1)
transposed_name = transposed_note.nameWithOctave
transposed_interval = interval.Interval(noteStart=note.Note(self.notes[0]), noteEnd=transposed_note).name
dur = self.duration / 4
return f"""\
0.0,{dur},,"['{self.notes[0]}', '{self.notes[1]}', '{self.notes[2]}']","['{self.intervals[0]}', '{self.intervals[1]}']","[True, True, True]"
{dur},{dur},,"['{self.notes[0]}', '{self.notes[1]}', '{transposed_name}']","['{self.intervals[0]}', '{transposed_interval}']","[False, False, True]"
{dur*2},{dur*2},,"['{self.notes[0]}', '{self.notes[1]}', '{self.notes[2]}']","['{self.intervals[0]}', '{self.intervals[1]}']","[False, False, True]"
"""

def templateSeventh(self):
transposed_note = note.Note(self.notes[3]).transpose(-1)
transposed_name = transposed_note.nameWithOctave
transposed_interval = interval.Interval(noteStart=note.Note(self.notes[0]), noteEnd=transposed_note).name
dur = self.duration / 4
return f"""\
0.0,{dur},,"['{self.notes[0]}', '{self.notes[1]}', '{self.notes[2]}', '{self.notes[3]}']","['{self.intervals[0]}', '{self.intervals[1]}', '{self.intervals[2]}']","[True, True, True, True]"
{dur},{dur},,"['{self.notes[0]}', '{self.notes[1]}', '{self.notes[2]}', '{transposed_name}']","['{self.intervals[0]}', '{self.intervals[1]}', '{transposed_interval}']","[False, False, False, True]"
{dur*2},{dur*2},,"['{self.notes[0]}', '{self.notes[1]}', '{self.notes[2]}', '{self.notes[3]}']","['{self.intervals[0]}', '{self.intervals[1]}', '{self.intervals[2]}']","[False, False, False, True]"
"""


class BlockChord(TextureTemplate):
"""A block-chord texture. The default texture in music21-generated scores."""

Expand All @@ -235,10 +267,11 @@ def templateSeventh(self):


available_templates = {
"BassSplit": BassSplit,
"Alberti": Alberti,
"Syncopation": Syncopation,
# "BassSplit": BassSplit,
# "Alberti": Alberti,
# "Syncopation": Syncopation,
"BlockChord": BlockChord,
"AuxiliaryNotes": AuxiliaryNotes,
}

available_durations = list(
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,14 @@ These are the results for the best AugmentedNet configuration (11+) against othe
| BPS | BPS | CS18 | 66.7 | 51.8 | 60.6 | 59.1 | - | - | 25.7 | - |

**[Visualize experiments in TensorBoard.dev!](https://tensorboard.dev/experiment/fXVA71nWTkSZh6CqTXCeCw/#scalars)**

## How to run on Google Cloud VM

1. `wget https://github.com/Alicelavander/AugmentedNet/raw/setup/setup-cuda.sh`
2. `chmod +x setup-cuda.sh`
3. `sudo ./setup-cuda.sh`
4. `./setup-augmentednet.sh`
5. `sudo shutdown -r now`
6. `cd AugmentedNet`
7. `conda create -n aha python=3.8`
8. `conda activate aha`
21 changes: 21 additions & 0 deletions setup-augmentednet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

#setup ssh for GitHub
#cd $HOME/.ssh
#ssh-keygen -t rsa
#cat id_rsa.pub
#ssh -T git@github.com

#setup AugmentedNet
#git clone --recursive git@github.com:Alicelavander/AugmentedNet.git
wget https://github.com/napulen/AugmentedNet/archive/refs/heads/main.zip
apt install unzip
unzip main.zip
mv AugmentedNet-main AugmentedNet
cd AugmentedNet/
wget https://github.com/napulen/AugmentedNet/releases/latest/download/dataset.zip
unzip dataset.zip
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh
bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh

#pip install -r requirements.txt
23 changes: 23 additions & 0 deletions setup-cuda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

#setup CUDA & cuDNN
apt install gcc
apt-get install linux-headers-$(uname -r)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb
dpkg -i cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb
cp /var/cuda-repo-ubuntu2004-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
apt-get update
apt-get -y install cuda
apt install nvidia-cuda-toolkit
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
apt-get update
apt-get install libcudnn8=8.8.0.121-1+cuda12.0
apt-get autoremove

wget https://github.com/Alicelavander/AugmentedNet/raw/setup/setup-augmentednet.sh
chmod +x setup-augmentednet.sh

#nvidia-smi