Skip to content

Commit

Permalink
Initial commit (code from 2012)
Browse files Browse the repository at this point in the history
  • Loading branch information
pertusa committed Sep 26, 2016
1 parent 46b79a7 commit be4e7e7
Show file tree
Hide file tree
Showing 37 changed files with 6,767 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*~
src/*~
675 changes: 675 additions & 0 deletions COPYING

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions Makefile
@@ -0,0 +1,40 @@
####################
# Requires libsnd, fftw and boost
# Change BOOSTPATH if necessary (only if it was downloaded from boost webpage, not via package-installer)
####################
BOOSTPATH=~/boost_path/boost_1_42_0
####################

TARGET=./bin/alg

OBJS= \
objs/myfft.o \
objs/bands.o \
objs/processwav.o \
objs/ocsound.o \
objs/onsets.o \
objs/midi.o \
objs/writemidi.o \
objs/spectralpattern.o \
objs/peaksatt.o \
objs/combination.o \
objs/alg.o

CC=g++
FLAGS_COMPILER= -c -O3 -Wall -Wno-deprecated -I $(BOOSTPATH)
FLAGS_LINKER= -lm -lsndfile -lfftw3

all: $(OBJS)
@echo 'Linking: $@'
$(CC) $(OBJS) $(FLAGS_LINKER) -o $(TARGET)


$(OBJS): ./objs/%.o : ./src/%.cpp
@echo 'Compiling $< ...'
$(CC) $(FLAGS_COMPILER) -o "./$@" "./$<"

clean:
@echo 'Cleaning '
rm -f ./objs/*
@echo 'Cleaning '
rm -f $(TARGET)
72 changes: 70 additions & 2 deletions README.md
@@ -1,2 +1,70 @@
# mf0
Multiple fundamental frequency estimation system
# Multiple fundamental frequency estimation system

This is method described in:

```
A. Pertusa and J.M. Iñesta, "Efficient methods for joint estimation of
multiple fundamental frequencies in music signals", EURASIP
Journal on Advances in Signal Processing, vol. 2012, pp. 27 (2012)
```

It takes an input WAV file and outputs a MIDI file. The input file must be WAV,
MONO, and with 22kHz or 44kHz sampling rate

## Compilation

To compile the source code in Linux or MacOS, type from the command line:

```
make
```

The software requires libsndfile and fftw3 libraries. Both
are standard in Linux distributions and they can be obtained from the
corresponding package installer. In MacOS, they can be downloaded from:

http://www.mega-nerd.com/libsndfile/
http://www.fftw.org/

Boost library is also required. It is standard in Linux distributions, and
in MacOSX it can be downloaded from:

http://www.boost.org/

Boost needs to be extracted, but it is not necessary to compile it.
If it was downloaded from boost webpage, then change the path in the Makefile. If
it was installed via a package installer, the Makefile does not need to be
changed.

## Usage

The basic syntax once compiled is:

```
./alg input.wav -o output.mid
```

Some parameters can be controlled from command line.
To view the syntax, please type:

```
./alg --help
```

These are the calls that were used to evaluate the methods in the results
section:

### Extended method without tracking:
```
alg input.wav -o output.mid -clean
```
### Extended method with tracking:
```
alg input.wav -o output.mid -fixsp
```
### Extended method merging information within inter-onset frames.
In this case, onset times must be previously extracted and stored into
onsetsfile.txt:
```
alg input.wav -loadonsets onsetsfile.txt -mergeIOI -clean -o output.mid
```
1 change: 1 addition & 0 deletions bin/.gitignore
@@ -0,0 +1 @@
./alg
Binary file added bin/alg
Binary file not shown.
1 change: 1 addition & 0 deletions objs/.gitignore
@@ -0,0 +1 @@
*.o

0 comments on commit be4e7e7

Please sign in to comment.