Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize a bit #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/cmake-build-*/
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: cpp

compiler:
- clang
# - gcc

before_install:
- sudo apt-get install -y cmake libasound2-dev freeglut3-dev libsndfile-dev libxi-dev libxmu-dev libgl1-mesa-dev

matrix:
include:
- os: linux
# - os: osx

script:
- mkdir build
- cd build
- cmake ..
- make

5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(sndpeek C CXX)
SET(PROJECT_VERSION 1.3+)

ADD_SUBDIRECTORY(src)
9 changes: 6 additions & 3 deletions INSTALL → INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## General

> make

follow directions!
```bash
mkdir build
cd build
cmake .. -DALSA
make
```

## Ubuntu dependencies

Expand Down
30 changes: 0 additions & 30 deletions README

This file was deleted.

30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# sndpeek

### A real-time audio visualization tool (animated, 3D)

**soundlab homepage**:
<http://soundlab.cs.princeton.edu/>

**sndpeek homepage**:
<http://soundlab.cs.princeton.edu/software/sndpeek/>

### Who it is for

- audio/multimedia researchers
- developers, composers
- and performers

### Supported platforms

- MacOS X (CoreAudio)
- Linux (ALSA/OSS/Jack)
- Windows/Cygwin (DirectSound)
- SGI (coming soon)

### Authors

- Ge Wang ([email protected])
- Perry R. Cook ([email protected])
- Ananya Misra ([email protected])

all three from the Princeton Sound Lab
2 changes: 1 addition & 1 deletion THANKS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ThanK you!
Thank you!

John Chowning: for working with us to design many new features and for
using sndpeek to visualize Stria!
Expand Down
2 changes: 0 additions & 2 deletions src/.gitignore

This file was deleted.

88 changes: 88 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This file is part of the sndpeek application.
# It builds the sndpeek executable.


SET(SOURCES_SNDPEEK_BASE
chuck_fft.c
RtAudio.cpp
sndpeek.cpp
Stk.cpp
Thread.cpp
WvIn.cpp
WvOut.cpp
)
SET(SOURCES_SNDPEEK
${SOURCES_SNDPEEK_BASE}
)

SET(UTIL_SNDFILE_SOURCES_DIR util_sndfile)

SET(MARSYAS_SOURCES_DIR marsyas)
SET(MARSYAS_LIBRARY_TARGET marsyas)

FIND_PACKAGE(Threads)

SET(CMAKE_C_FLAGS "-O3 -c")
SET(LIBS ${CMAKE_THREAD_LIBS_INIT} glut GL GLU Xmu X11 Xext Xi m sndfile ${MARSYAS_LIBRARY_TARGET})

SET(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${UTIL_SNDFILE_SOURCES_DIR} ${MARSYAS_SOURCES_DIR})

IF(NOT SOUND_SYSTEM)
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
SET(SOUND_SYSTEM "WIN32")
ELSEIF("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
SET(SOUND_SYSTEM "OSX")
ELSE()
SET(SOUND_SYSTEM "ALSA")
ENDIF()
ENDIF()

IF("${SOUND_SYSTEM}" STREQUAL "ALSA")
ADD_DEFINITIONS(-D__LINUX_ALSA__ -D__LITTLE_ENDIAN__)
SET(LIBS ${LIBS} -lasound)
ELSEIF("${SOUND_SYSTEM}" STREQUAL "JACK")
ADD_DEFINITIONS(-D__LINUX_JACK__ -D__LITTLE_ENDIAN__)
SET(LIBS ${LIBS} -lasound -ljack)
ELSEIF("${SOUND_SYSTEM}" STREQUAL "OSS")
add_definitions(-D__LINUX_OSS__ -D__LITTLE_ENDIAN__)
SET(LIBS ${LIBS} -lstdc++)
ELSEIF("${SOUND_SYSTEM}" STREQUAL "OSX")
ADD_DEFINITIONS(-D__MACOSX_CORE__)
SET(LIBS -framework CoreAudio -framework CoreMIDI -framework CoreFoundation -framework OpenGL -framework GLUT -framework Foundation -framework AppKit)
SET(SOURCES_SNDPEEK
${SOURCES_SNDPEEK}
${SOURCES_SNDUTIL}
)
ELSEIF("${SOUND_SYSTEM}" STREQUAL "OSX-UB")
ADD_DEFINITIONS(-D__MACOSX_CORE__)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk")
SET(LIBS -framework CoreAudio -framework CoreMIDI -framework CoreFoundation -framework OpenGL -framework GLUT -framework Foundation -framework AppKit -lstdc++ -lm -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk)
SET(SOURCES_SNDPEEK
${SOURCES_SNDPEEK}
${SOURCES_SNDUTIL}
)
#SF_OBJ=util_sndfile.o

#-----------------------------------------------------------------------------
# by default, ChucK uses a pre-configured libsndfile...
# uncomment the next 3 lines to use libsndfile on your system
#-----------------------------------------------------------------------------
#FLAGS+= -D__CK_SNDFILE_NATIVE__
#LIBS+= -lsndfile
#SF_OBJ=
ELSEIF("${SOUND_SYSTEM}" STREQUAL "WIN32")
ADD_SUBDIRECTORY(${UTIL_SNDFILE_SOURCES_DIR})
SET(INCLUDE_DIRS ${INCLUDE_DIRS} /usr/include/directx/)
ADD_DEFINITIONS(-D__WINDOWS_DS__ -D__WINDOWS_PTHREAD__ -D__LITTLE_ENDIAN__)
SET(LIBS dsound dxguid winmm pthread opengl32 glu32 glut32)
SET(SOURCES_SNDPEEK
${SOURCES_SNDPEEK}
${SOURCES_SNDUTIL}
)
ENDIF()

ADD_SUBDIRECTORY(marsyas)

ADD_EXECUTABLE(sndpeek ${SOURCES_SNDPEEK})
TARGET_INCLUDE_DIRECTORIES(sndpeek PRIVATE ${INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(sndpeek ${LIBS})
2 changes: 1 addition & 1 deletion src/sndpeek/RtAudio.cpp → src/RtAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void RtAudio::initialize( RtAudioApi api )
}
catch (RtError &) {
#if defined(__RTAUDIO_DEBUG__)
fprintf(stderr, "\nRtAudio: no devices found for second api option (Alsa or DirectSound).\n\n");
fprintf(stderr, "\nRtAudio: no devices found for second API option (Alsa or DirectSound).\n\n");
#endif
rtapi_ = 0;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions src/marsyas/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is part of the sndpeek application.
# It builds the Marsyas library.
# It has no (non-system) dependencies.

SET(SOURCES_MARSYAS
AutoCorrelation.cpp
Centroid.cpp
Communicator.cpp
DownSampler.cpp
Flux.cpp
fmatrix.cpp
fvec.cpp
Hamming.cpp
LPC.cpp
MagFFT.cpp
MarSignal.cpp
MFCC.cpp
NormRMS.cpp
RMS.cpp
Rolloff.cpp
System.cpp
)

SET(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})

ADD_LIBRARY(marsyas ${SOURCES_MARSYAS})
TARGET_INCLUDE_DIRECTORIES(marsyas PRIVATE ${INCLUDE_DIRS})
2 changes: 1 addition & 1 deletion src/marsyas/fmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fmatrix::fmatrix(): data_(NULL), size_(0), rows_(0), cols_(0), name_("m"), print

fmatrix::~fmatrix()
{
delete data_;
delete[] data_;
}

fmatrix::fmatrix(unsigned int rows): data_(new double[rows * rows]), size_(rows*rows), rows_(rows), cols_(rows), name_("m"), printHeader_(true)
Expand Down
2 changes: 1 addition & 1 deletion src/marsyas/fvec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fvec::fvec()

fvec::~fvec()
{
delete data_;
delete[] data_;
}

fvec::fvec(unsigned int size)
Expand Down
14 changes: 7 additions & 7 deletions src/sndpeek/sndpeek.cpp → src/sndpeek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
#include "chuck_fft.h"

// Marsyas
#include "Centroid.h"
#include "DownSampler.h"
#include "Flux.h"
#include "LPC.h"
#include "MFCC.h"
#include "RMS.h"
#include "Rolloff.h"
#include "marsyas/Centroid.h"
#include "marsyas/DownSampler.h"
#include "marsyas/Flux.h"
#include "marsyas/LPC.h"
#include "marsyas/MFCC.h"
#include "marsyas/RMS.h"
#include "marsyas/Rolloff.h"



Expand Down
Loading