Skip to content

Commit

Permalink
Merge branch 'master' of ssh://git.code.sf.net/p/csound/csound6-git
Browse files Browse the repository at this point in the history
  • Loading branch information
fggp committed Jun 11, 2013
2 parents 3db4f28 + 5b00757 commit 6e5afc9
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Top/argdecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ PUBLIC int argdecode(CSOUND *csound, int argc, char **argv_)
/* 0: normal, 1: ignore, 2: fail */
if (csound->orcname_mode == 2) {
csound->Die(csound, Str("error: orchestra and score name not "
"allowed in .csoundrc"));
"allowed in .csound6rc"));
}
else if (csound->orcname_mode == 0) {
if (csound->orchname == NULL)
Expand Down
22 changes: 11 additions & 11 deletions Top/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,47 +76,47 @@ PUBLIC int csoundCompileArgs(CSOUND *csound, int argc, char **argv)
csound->orcname_mode = 0; /* 0: normal, 1: ignore, 2: fail */
if (argdecode(csound, argc, argv) == 0)
csound->LongJmp(csound, 1);
/* do not allow orc/sco/csd name in .csoundrc */
/* do not allow orc/sco/csd name in .csound6rc */
csound->orcname_mode = 2;
{
const char *csrcname;
const char *home_dir;
FILE *csrc = NULL;
void *fd = NULL;
/* IV - Feb 17 2005 */
csrcname = csoundGetEnv(csound, "CSOUNDRC");
csrcname = csoundGetEnv(csound, "CSOUND6RC");
if (csrcname != NULL && csrcname[0] != '\0') {
fd = csound->FileOpen2(csound, &csrc, CSFILE_STD, csrcname, "r", NULL,
CSFTYPE_OPTIONS, 0);
if (fd == NULL)
csoundMessage(csound, Str("WARNING: cannot open csoundrc file %s\n"),
csoundMessage(csound, Str("WARNING: cannot open csound6rc file %s\n"),
csrcname);
else
csound->Message(csound, Str("Reading options from $CSOUNDRC: %s \n"),
csound->Message(csound, Str("Reading options from $CSOUND6RC: %s \n"),
csrcname);
}
if (fd == NULL && ((home_dir = csoundGetEnv(csound, "HOME")) != NULL &&
home_dir[0] != '\0')) {
s = csoundConcatenatePaths(csound, home_dir, ".csoundrc");
s = csoundConcatenatePaths(csound, home_dir, ".csound6rc");
fd = csound->FileOpen2(csound, &csrc, CSFILE_STD, s, "r", NULL,
CSFTYPE_OPTIONS, 0);
if (fd != NULL)
csound->Message(csound, Str("Reading options from $HOME/.csoundrc\n"));
csound->Message(csound, Str("Reading options from $HOME/.csound6rc\n"));
mfree(csound, s);
}
/* read global .csoundrc file (if exists) */
/* read global .csound6rc file (if exists) */
if (fd != NULL) {

readOptions(csound, csrc, 0);
csound->FileClose(csound, fd);
}
/* check for .csoundrc in current directory */
fd = csound->FileOpen2(csound, &csrc, CSFILE_STD, ".csoundrc", "r", NULL,
/* check for .csound6rc in current directory */
fd = csound->FileOpen2(csound, &csrc, CSFILE_STD, ".csound6rc", "r", NULL,
CSFTYPE_OPTIONS, 0);
if (fd != NULL) {
readOptions(csound, csrc, 0);
csound->Message(csound,
Str("Reading options from local directory .csoundrc \n"));
Str("Reading options from local directory .csound6rc \n"));
csound->FileClose(csound, fd);
}
}
Expand Down Expand Up @@ -170,7 +170,7 @@ PUBLIC int csoundCompileArgs(CSOUND *csound, int argc, char **argv)
(csound->stdout_assign_flg & (csound->stdout_assign_flg - 1)) != 0) {
csound->Die(csound, Str("error: multiple uses of stdout"));
}
/* done parsing csoundrc, CSD, and command line options */
/* done parsing csound6rc, CSD, and command line options */

if (csound->scorename == NULL && csound->scorestr==NULL) {
/* No scorename yet */
Expand Down
30 changes: 25 additions & 5 deletions What_is_New.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
WHAT NEEDS HEAVY TESTING
========================
Changes since 6.00RC2 (from logs)
=====================

Multiple strings in score
Many bug fixes and code improvements

--sample-accurate
New opcodes: faustgen, array

Added 0dbfs and nchnls override

Added delete tree to the API

Greatly improve array arithmetic operations

Removed limit on number of instances in parallel code

Fixed schedwhen for named instrs

Change to escape characters in score strings -- they do not happen
(this is still subject to change)

Fixed dssi

Use thread-safe internal functions in compilaton etc

Thread-safe use of locales

String variables re-implemented

Arrays

What is New, What has Changed
=============================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# Simple script to copy "local" shared libs to the installation libs directories.
# This because I can't seem to get the canonical way to do this to work.

# Do this first because Android does not support embedded versioned sonames?

mkdir libs
mkdir libs/armeabi
mkdir libs/armeabi-v7a

cp -f ../pluginlibs/libfluidsynth/libs/armeabi/libfluidOpcodes.so libs/armeabi/
cp -f ../pluginlibs/libstdutil/libs/armeabi/*.so libs/armeabi/
cp -f ../pluginlibs/signalflowgraph/libs/armeabi/*.so libs/armeabi/
Expand All @@ -15,7 +21,6 @@ cp -f ../pluginlibs/LuaCsound/libs/armeabi-v7a/libLuaCsound.so libs/armeabi-v7a/

# Also copy other resources used by Csound opcodes.

cd ../CSDPlayer

mkdir assets/samples/
cp -f ../../samples/* assets/samples

Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ public synchronized void onClick(View v) {
try {
CsoundAppActivity.this.postMessage(pluginPath + "\n");
System.load(pluginPath);

} catch (Throwable e) {
CsoundAppActivity.this.postMessage(e.toString() + "\n");
}
Expand Down
5 changes: 0 additions & 5 deletions android/CsoundAndroid/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ cd jni

$ANDROID_NDK_ROOT/ndk-build

# Copy the local libs to the libs directory -- doing this is easier than the alternatives, believe me!

cd ..

sh install_libs.sh

4 changes: 2 additions & 2 deletions android/CsoundAndroid/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ java_interfaceJAVA_wrap.cpp

LOCAL_LDLIBS += -llog -lOpenSLES -ldl -lstdc++ -lm -lc

LOCAL_SHARED_LIBRARIES += sndfile luajit
LOCAL_PREBUILT_LIBRARIES += luajit-2.0 sndfile libstdutil signalflowgraph libfluidsynth
LOCAL_SHARED_LIBRARIES += sndfile
LOCAL_PREBUILT_LIBRARIES += sndfile

include $(BUILD_SHARED_LIBRARY)

Expand Down
5 changes: 2 additions & 3 deletions android/CsoundAndroid/src/com/csounds/CsoundObj.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ public synchronized void stopCsound() {
thread.join();
thread = null;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
Log.d("CsoundObj", "InterruptedException in stopCsound.");
Log.d("CsoundObj", e.toString());
e.printStackTrace();
}
}
Expand Down Expand Up @@ -452,7 +451,7 @@ public void MessageCallback(int attr, String msg) {
audioRecord.release();
audioIn.Clear();
}
//csound.Stop();
csound.Stop();
csound.Cleanup();
csound.Reset();
for (CsoundValueCacheable cacheable : valuesCache) {
Expand Down
9 changes: 2 additions & 7 deletions android/pluginlibs/LuaCsound/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := luajit
LOCAL_SRC_FILES := $(NDK_MODULE_PATH)/luajit-2.0/src/libluajit.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)

CSOUND_SRC_ROOT := ../../../..
Expand All @@ -15,14 +10,14 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)../../../luajit-2.0/src $(LOCAL_PATH)/../../../
LOCAL_CFLAGS := -O3 -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DLINUX -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H
LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS)
# MUST explicitly link TO THIS SPECIFIC LIBRARY not the Windows one.
LOCAL_LDFLAGS += -Wl,--export-dynamic $(LOCAL_PATH)../../../luajit-2.0/src/libluajit.so
LOCAL_LDFLAGS += -Wl,--export-dynamic $(LOCAL_PATH)../../../luajit-2.0/src/libluajit.a
###

LOCAL_LDLIBS += -ldl

LOCAL_SRC_FILES := $(CSOUND_SRC_ROOT)/Opcodes/LuaCsound.cpp

LOCAL_SHARED_LIBRARIES += libluajit
LOCAL_STATIC_LIBRARIES += libluajit

include $(BUILD_SHARED_LIBRARY)

27 changes: 27 additions & 0 deletions android/pluginlibs/fluidsynth-android/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := fluidsynth-static
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_CFLAGS := -DHAVE_PTHREAD_H -DHAVE_STDLIB_H -DHAVE_STDIO_H -DHAVE_MATH_H -DHAVE_STRING_H -DHAVE_STDARG_H -DHAVE_SYS_SOCKET_H -DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_NETINET_TCP_H -DHAVE_UNISTD_H -DHAVE_ERRNO_H -DHAVE_FCNTL_H -DVERSION=1.0.9
LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS)

LOCAL_SRC_FILES := fluid_adriver.c fluid_dll.c fluid_list.c fluid_seq.c \
fluid_mdriver.c fluid_seqbind.c fluid_aufile.c fluid_cmd.c\
fluid_dsp_float.c fluid_midi.c fluid_settings.c \
fluid_chan.c fluid_midi_router.c fluid_sndmgr.c \
fluid_chorus.c fluid_event.c fluid_synth.c \
fluid_gen.c fluid_mod.c fluid_sys.c \
fluid_conv.c fluid_hash.c fluid_tuning.c \
fluid_voice.c fluid_io.c \
fluid_dart.c fluid_ramsfont.c \
fluid_defsfont.c fluid_rev.c

LOCAL_LDLIBS += -llog -ldl

include $(BUILD_STATIC_LIBRARY)

#include $(BUILD_SHARED_LIBRARY)

44 changes: 44 additions & 0 deletions android/pluginlibs/libsndfile-android/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OGG_ROOT := $(LOCAL_PATH)/../deps/libogg/include
VORBIS_ROOT := $(LOCAL_PATH)/../deps/libvorbis/include

LOCAL_CFLAGS := -DHAVE_EXTERNAL_LIBS
LOCAL_C_INCLUDES := $(OGG_ROOT) $(VORBIS_ROOT)

LOCAL_MODULE := sndfile

OGG_SRC_FILES := ../deps/libogg/src/bitwise.c ../deps/libogg/src/framing.c
V_SRC := ../deps/libvorbis/src
VORBIS_SRC_FILES := $(V_SRC)/analysis.c $(V_SRC)/floor0.c $(V_SRC)/lsp.c $(V_SRC)/res0.c \
$(V_SRC)/vorbisfile.c $(V_SRC)/bitrate.c $(V_SRC)/floor1.c $(V_SRC)/mapping0.c $(V_SRC)/sharedbook.c \
$(V_SRC)/window.c $(V_SRC)/block.c $(V_SRC)/info.c $(V_SRC)/mdct.c $(V_SRC)/smallft.c \
$(V_SRC)/codebook.c $(V_SRC)/lookup.c $(V_SRC)/psy.c $(V_SRC)/synthesis.c \
$(V_SRC)/envelope.c $(V_SRC)/lpc.c $(V_SRC)/registry.c $(V_SRC)/vorbisenc.c

LOCAL_SRC_FILES := mat5.c windows.c G72x/g723_24.c G72x/g72x.c \
G72x/g723_40.c G72x/g721.c G72x/g723_16.c \
float32.c chanmap.c test_endswap.c rf64.c sndfile.c htk.c dither.c \
test_log_printf.c txw.c ms_adpcm.c ima_adpcm.c flac.c aiff.c \
wav.c macbinary3.c mat4.c pcm.c caf.c \
audio_detect.c id3.c alaw.c macos.c file_io.c broadcast.c double64.c \
raw.c test_broadcast_var.c \
g72x.c command.c chunk.c avr.c sd2.c voc.c test_audio_detect.c \
mpc2k.c gsm610.c dwd.c \
interleave.c common.c test_strncpy_crlf.c sds.c pvf.c paf.c au.c \
test_float.c \
vox_adpcm.c ulaw.c strings.c svx.c test_conversions.c rx2.c nist.c \
GSM610/code.c GSM610/gsm_destroy.c \
GSM610/gsm_decode.c GSM610/short_term.c GSM610/gsm_create.c \
GSM610/decode.c GSM610/gsm_option.c \
GSM610/long_term.c GSM610/table.c GSM610/rpe.c GSM610/preprocess.c \
GSM610/gsm_encode.c GSM610/lpc.c \
GSM610/add.c dwvw.c wav_w64.c wve.c ogg.c ogg_vorbis.c w64.c test_file_io.c\
ircam.c xi.c ima_oki_adpcm.c \
$(OGG_SRC_FILES) $(VORBIS_SRC_FILES)

LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)

18 changes: 18 additions & 0 deletions android/pluginlibs/signalflowgraph/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

CSOUND_SRC_ROOT := ../../../..

LOCAL_MODULE := signalflowgraph

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../Engine $(LOCAL_PATH)/../../../../H $(LOCAL_PATH)/../../../../include $(LOCAL_PATH)/../../../.. $(LOCAL_PATH)/../../../ $(NDK_MODULE_PATH)/libsndfile-android/jni
LOCAL_CFLAGS := -O3 -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DLINUX -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H
LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS)
LOCAL_LDFLAGS += -Wl,--export-dynamic
###

LOCAL_SRC_FILES := $(CSOUND_SRC_ROOT)/Opcodes/signalflowgraph.cpp

include $(BUILD_SHARED_LIBRARY)

9 changes: 5 additions & 4 deletions examples/opcode_demos/luaopcode.csd
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
lua_opdef "luatest", {{
local ffi = require("ffi")
local string = require("string")
local csoundLibrary = ffi.load('libcsound64.so')
local csoundLibrary = ffi.load('csound64.dll')
ffi.cdef[[
int csoundGetKsmps(void *);
double csoundGetSr(void *);
struct luatest_arguments {double *out; double *stringout; char *stringin; double *in1; double *in2; double sr; int ksmps; };
struct STRINGDAT {char *data; int size;};
struct luatest_arguments {double *out; struct STRINGDAT *stringout; struct STRINGDAT *stringin; double *in1; double *in2; double sr; int ksmps; };
]]
function luatest_init(csound, opcode, carguments)
local arguments = ffi.cast("struct luatest_arguments *", carguments)
arguments.sr = csoundLibrary.csoundGetSr(csound)
print(string.format('stringin: %s', ffi.string(arguments.stringin)))
print(string.format('stringin: %s', ffi.string(arguments.stringin.data, arguments.stringin.size)))
print(string.format('sr: %f', arguments.sr))
arguments.ksmps = csoundLibrary.csoundGetKsmps(csound)
print(string.format('ksmps: %d', arguments.ksmps))
arguments.out[0] = arguments.in1[0] * arguments.in2[0]
ffi.copy(arguments.stringout, 'Hello, world!')
ffi.copy(arguments.stringout.data, 'Hello, world!')
return 0
end
function luatest_kontrol(csound, opcode, carguments)
Expand Down

0 comments on commit 6e5afc9

Please sign in to comment.