Commit fad95850 authored by jhammen's avatar jhammen

initial import

parents
CMakeLists.txt.user
html/
gitstats/
CMakeFiles/
CMakeCache.txt
Makefile
bipscript
cmake_install.cmake
Much appreciation to the following projects for the use of their code:
* abcmidi release abcMIDI-2016.05.05 (C) 1999 James Allwright
Many thanks also to current maintainer Seymour Shlien
* BTrack release 1.0.4 Copyright (c) 2014 Queen Mary University of London
by Adam Stark, Matthew Davies and Mark Plumbley
* Squirrel release 3.1 Copyright (c) 2003-2016 Alberto Demichelis
* tinymml release 0.5.0 Copyright (c) 2014-2015 Shinichiro Nakamura
* tlsf version 3.1 Copyright (c) 2006-2016, Matthew Conte
original bipscript code Copyright (c) 2015-2020 John Hammen
message(STATUS "CMAKE_CURRENT_SOURCE_DIR : ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "CMAKE_GENERATOR : ${CMAKE_GENERATOR}")
project(bipscript)
cmake_minimum_required(VERSION 2.8)
# create version.h
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
set(VERSION_COMMAND "git")
set(VERSION_ARG "describe")
else()
set(VERSION_COMMAND "echo")
set(VERSION_ARG "${BIPSCRIPT_VERSION}")
endif()
message(STATUS "create version.h from ${VERSION_COMMAND} ${VERSION_ARG}")
execute_process(COMMAND ${VERSION_COMMAND} ${VERSION_ARG}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE BIPSCRIPT_VERSION
)
configure_file("src/version.h.in" "version.h")
message(STATUS "BIPSCRIPT_VERSION : ${BIPSCRIPT_VERSION}")
aux_source_directory("src" SRC_LIST)
aux_source_directory("bindings" SRC_LIST)
aux_source_directory("abcmidi" SRC_LIST)
aux_source_directory("btrack" SRC_LIST)
aux_source_directory("squirrel/squirrel" SRC_LIST)
aux_source_directory("squirrel/sqstdlib" SRC_LIST)
aux_source_directory("tinymml" SRC_LIST)
aux_source_directory("tlsf" SRC_LIST)
include_directories("src")
include_directories("bindings")
include_directories("abcmidi")
include_directories("btrack")
include_directories("squirrel/include")
include_directories("tinymml")
include_directories("tlsf")
include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for version.h
add_definitions(-DANSILIBS)
add_definitions(-DUSE_FFTW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
# message(STATUS "SRC_LIST : ${SRC_LIST}")
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} "boost_system")
target_link_libraries(${PROJECT_NAME} "boost_filesystem")
target_link_libraries(${PROJECT_NAME} "dl")
target_link_libraries(${PROJECT_NAME} "fftw3")
target_link_libraries(${PROJECT_NAME} "jack")
target_link_libraries(${PROJECT_NAME} "lilv-0")
target_link_libraries(${PROJECT_NAME} "lo")
target_link_libraries(${PROJECT_NAME} "portSMF")
target_link_libraries(${PROJECT_NAME} "pthread")
target_link_libraries(${PROJECT_NAME} "sndfile")
target_link_libraries(${PROJECT_NAME} "stdc++")
target_link_libraries(${PROJECT_NAME} "m")
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
# bipscript
http://bipscript.org
/* abc.h - header file shared by abc2midi, abc2abc and yaps */
/* Copyright James Allwright 2000 */
/* may be copied under the terms of the GNU public license */
typedef enum {
ABC2MIDI,
ABC2ABC,
YAPS,
ABCMATCH} programname;
/* define types of abc object */
typedef enum {
/* types of bar sign */
SINGLE_BAR,
DOUBLE_BAR,
BAR_REP,
REP_BAR,
PLAY_ON_REP,
REP1,
REP2,
/* BAR1 = SINGLE_BAR + REP1 */
/* REP_BAR2 = REP_BAR + REP2 */
BAR1,
REP_BAR2,
DOUBLE_REP,
THICK_THIN,
THIN_THICK,
/* other things */
PART,
TEMPO,
TIME,
KEY,
REST,
TUPLE,
/* CHORD replaced by CHORDON and CHORDOFF */
NOTE,
NONOTE,
OLDTIE,
TEXT,
SLUR_ON,
SLUR_OFF,
TIE,
CLOSE_TIE,
TITLE,
CHANNEL,
TRANSPOSE,
RTRANSPOSE,
GTRANSPOSE,
GRACEON,
GRACEOFF,
SETGRACE,
SETC,
SETTRIM,
EXPAND,
GCHORD,
GCHORDON,
GCHORDOFF,
VOICE,
CHORDON,
CHORDOFF,
CHORDOFFEX,
DRUMON,
DRUMOFF,
DRONEON,
DRONEOFF,
SLUR_TIE,
TNOTE,
/* broken rhythm */
LT,
GT,
DYNAMIC,
LINENUM,
MUSICLINE,
MUSICSTOP,
WORDLINE,
WORDSTOP,
INSTRUCTION,
NOBEAM,
CHORDNOTE,
CLEF,
PRINTLINE,
NEWPAGE,
LEFT_TEXT,
CENTRE_TEXT,
VSKIP,
COPYRIGHT,
COMPOSER,
ARPEGGIO,
SPLITVOICE,
META,
PEDAL_ON,
PEDAL_OFF,
EFFECT
} featuretype;
/* note decorations */
#define DECSIZE 10
extern char decorations[];
#define STACCATO 0
#define TENUTO 1
#define LOUD 2
#define ROLL 3
#define FERMATA 4
#define ORNAMENT 5
#define TRILL 6
#define BOWUP 7
#define BOWDOWN 8
#define BREATH 9
/* The vstring routines provide a simple way to handle */
/* arbitrary length strings */
struct vstring {
int len;
int limit;
char* st;
};
#ifndef KANDR
/* vstring routines */
extern void initvstring(struct vstring* s);
extern void extendvstring(struct vstring* s);
extern void addch(char ch, struct vstring* s);
extern void addtext(char* text, struct vstring* s);
extern void clearvstring(struct vstring* s);
extern void freevstring(struct vstring* s);
/* error-handling routines */
extern void event_error(char *s);
extern void event_fatal_error(char *s);
extern void event_warning(char *s);
#else
/* vstring routines */
extern void initvstring();
extern void extendvstring();
extern void addch();
extern void addtext();
extern void clearvstring();
extern void freevstring();
/* error-handling routines */
extern void event_error();
extern void event_fatal_error();
extern void event_warning();
#endif
This diff is collapsed.
/* genmidi.h - part of abc2midi */
/* function prototypes for functions in genmidi.c used elsewhere */
#ifndef KANDR
/* functions required by store.c */
extern void reduce(int* a, int* b);
extern void set_meter(int a, int b);
extern void set_gchords(char *s);
extern void set_drums(char *s);
extern void addunits(int a, int b);
/* required by queues.c */
extern void midi_noteoff(long delta_time, int pitch, int chan);
extern void progress_sequence(int i);
#else
/* functions required by store.c */
extern void reduce();
extern void set_meter();
extern void set_gchords();
extern void addunits();
extern void set_drums();
/* required by queues.c */
extern void midi_noteoff();
extern void progress_sequence();
#endif
/* introduced 2010-02-01 (feb 01) [SS] */
struct trackstruct {enum {NOTES, WORDS, NOTEWORDS, GCHORDS, DRUMS, DRONE} tracktype;
int voicenum;
int midichannel; /* [SS] 2015-03-24 */
};
/* some definitions formerly in tomidi.c */
#define DIV 480
#define MAXPARTS 100
#define MAXCHORDNAMES 80
/* definitions for MIDI file parsing code */
#include <stdio.h>
extern int (*Mf_getc)();
extern void (*Mf_header)();
extern void (*Mf_trackstart)();
extern void (*Mf_trackend)();
extern void (*Mf_noteon)();
extern void (*Mf_noteoff)();
extern void (*Mf_pressure)();
extern void (*Mf_parameter)();
extern void (*Mf_pitchbend)();
extern void (*Mf_program)();
extern void (*Mf_chanpressure)();
extern void (*Mf_sysex)();
extern void (*Mf_metamisc)();
extern void (*Mf_seqspecific)();
extern void (*Mf_seqnum)();
extern void (*Mf_text)();
extern void (*Mf_eot)();
extern void (*Mf_timesig)();
extern void (*Mf_smpte)();
extern void (*Mf_tempo)();
extern void (*Mf_keysig)();
extern void (*Mf_arbitrary)();
extern void (*Mf_error)();
extern long Mf_currtime;
extern int Mf_nomerge;
/* definitions for MIDI file writing code */
extern int (*Mf_putc)();
extern long (*Mf_writetrack)();
extern int (*Mf_writetempotrack)();
float mf_ticks2sec();
long mf_sec2ticks();
void mfwrite();
void mfread();
int mf_write_meta_event();
int mf_write_midi_event();
void mf_write_tempo();
void mferror();
/* MIDI status commands most significant bit is 1 */
#define note_off 0x80
#define note_on 0x90
#define poly_aftertouch 0xa0
#define control_change 0xb0
#define program_chng 0xc0
#define channel_aftertouch 0xd0
#define pitch_wheel 0xe0
#define system_exclusive 0xf0
#define delay_packet (1111)
/* 7 bit controllers */
#define damper_pedal 0x40
#define portamento 0x41
#define sostenuto 0x42
#define soft_pedal 0x43
#define general_4 0x44
#define hold_2 0x45
#define general_5 0x50
#define general_6 0x51
#define general_7 0x52
#define general_8 0x53
#define tremolo_depth 0x5c
#define chorus_depth 0x5d
#define detune 0x5e
#define phaser_depth 0x5f
/* parameter values */
#define data_inc 0x60
#define data_dec 0x61
/* parameter selection */
#define non_reg_lsb 0x62
#define non_reg_msb 0x63
#define reg_lsb 0x64
#define reg_msb 0x65
/* Standard MIDI Files meta event definitions */
#define meta_event 0xFF
#define sequence_number 0x00
#define text_event 0x01
#define copyright_notice 0x02
#define sequence_name 0x03
#define instrument_name 0x04
#define lyric 0x05
#define marker 0x06
#define cue_point 0x07
#define channel_prefix 0x20
#define end_of_track 0x2f
#define set_tempo 0x51
#define smpte_offset 0x54
#define time_signature 0x58
#define key_signature 0x59
#define sequencer_specific 0x74
/* Manufacturer's ID number */
#define Seq_Circuits (0x01) /* Sequential Circuits Inc. */
#define Big_Briar (0x02) /* Big Briar Inc. */
#define Octave (0x03) /* Octave/Plateau */
#define Moog (0x04) /* Moog Music */
#define Passport (0x05) /* Passport Designs */
#define Lexicon (0x06) /* Lexicon */
#define Tempi (0x20) /* Bon Tempi */
#define Siel (0x21) /* S.I.E.L. */
#define Kawai (0x41)
#define Roland (0x42)
#define Korg (0x42)
#define Yamaha (0x43)
/* miscellaneous definitions */
#define MThd 0x4d546864
#define MTrk 0x4d54726b
#define lowerbyte(x) ((unsigned char)(x & 0xff))
#define upperbyte(x) ((unsigned char)((x & 0xff00)>>8))
This diff is collapsed.
/* parseabc.h - interface file for abc parser */
/* used by abc2midi, abc2abc and yaps */
/* abc.h must be #included before this file */
/* functions and variables provided by parseabc.c */
/* for Microsoft Visual C++ 6 */
#ifdef _MSC_VER
#define KANDR
#endif
/* the arg list to event_voice keeps growing; if we put the args into a structure
and pass that around, routines that don't need the new ones need not be altered.
NB. event_voice is *called* from parseabc.c, the actual procedure is linked
in from the program-specific file */
/* added middle= stuff */
#define V_STRLEN 64
struct voice_params {
int gotclef;
int gotoctave;
int gottranspose;
int gotname;
int gotsname;
int gotmiddle;
int gotother; /* [SS] 2011-04-18 */
int octave;
int transpose;
char clefname[V_STRLEN+1];
char namestring[V_STRLEN+1];
char snamestring[V_STRLEN+1];
char middlestring[V_STRLEN+1];
char other[V_STRLEN+1]; /* [SS] 2011-04-18 */
};
/* holds a fraction */
struct fraction {
int num;
int denom;
};
#ifndef KANDR
extern int readnump(char **p);
extern int readsnump(char **p);
extern int readnumf(char *num);
extern void skipspace(char **p);
extern int readsnumf(char *s);
extern void readstr(char out[], char **in, int limit);
extern int getarg(char *option, int argc, char *argv[]);
extern int *checkmalloc(int size);
extern char *addstring(char *s);
extern char *concatenatestring(char *s1, char *s2);
extern char *lookup_abbreviation(char symbol);
extern int ismicrotone(char **p, int dir);
extern void event_normal_tone(void);
extern void print_inputline(void);
extern void print_inputline_nolinefeed(void);
#else
extern int readnump();
extern int readsnump();
extern int readnumf();
extern void skipspace();
extern int readsnumf();
extern void readstr();
extern int getarg();
extern int *checkmalloc();
extern char *addstring();
extern char *concatenatestring();
extern char *lookup_abbreviation();
extern int ismicrotone();
extern void event_normal_tone();
extern void print_inputline_nolinefeed();
#endif
extern void parseron();
extern void parseroff();
extern int lineno;
/* event_X() routines - these are called from parseabc.c */
/* the program that uses the parser must supply these routines */
#ifndef KANDR
extern void event_init(int argc, char *argv[], char **filename);
extern void event_text(char *s);
extern void event_reserved(char p);
extern void event_tex(char *s);
extern void event_linebreak(void);
extern void event_startmusicline(void);
extern void event_endmusicline(char endchar);
extern void event_eof(void);
extern void event_comment(char *s);
extern void event_specific(char *package, char *s);
extern void event_specific_in_header(char *package, char *s);
extern void event_startinline(void);
extern void event_closeinline(void);
extern void event_field(char k, char *f);
extern void event_words(char *p, int continuation);
extern void event_part(char *s);
extern void event_voice(int n, char *s, struct voice_params *params);
extern void event_length(int n);
extern void event_blankline(void);
extern void event_refno(int n);
extern void event_tempo(int n, int a, int b, int rel, char *pre, char *post);
extern void event_timesig(int n, int m, int dochecking);
extern void event_octave(int num, int local);
extern void event_info_key(char *key, char *value);
extern void event_info(char *s);
extern void event_key(int sharps, char *s, int modeindex,
char modmap[7], int modmul[7], struct fraction modmicro[7],
int gotkey, int gotclef, char *clefname,
int octave, int transpose, int gotoctave, int gottranspose,
int explict);
extern void event_microtone(int dir, int a, int b);
extern void event_graceon(void);
extern void event_graceoff(void);
extern void event_rep1(void);
extern void event_rep2(void);
extern void event_playonrep(char *s);
extern void event_tie(void);
extern void event_slur(int t);
extern void event_sluron(int t);
extern void event_sluroff(int t);
extern void event_rest(int decorators[DECSIZE],int n,int m,int type);
extern void event_mrest(int n,int m);
extern void event_spacing(int n, int m);
extern void event_bar(int type, char *replist);
extern void event_space(void);
extern void event_lineend(char ch, int n);
extern void event_broken(int type, int mult);
extern void event_tuple(int n, int q, int r);
extern void event_chord(void);
extern void event_chordon(int chorddecorators[DECSIZE]);
extern void event_chordoff(int, int);
extern void event_instruction(char *s);
extern void event_gchord(char *s);
extern void event_note(int decorators[DECSIZE], char accidental, int mult,
char note, int xoctave, int n, int m);
extern void event_abbreviation(char symbol, char *string, char container);
extern void event_acciaccatura();
extern void event_start_extended_overlay();
extern void event_stop_extended_overlay();
extern void event_split_voice();
extern void print_voicecodes(void);
extern void init_abbreviations();
extern void free_abbreviations();
extern void parsefile();
extern void parsestring(const char *abc, int startline);
extern int parsetune();
#else
extern void event_init();
extern void event_text();
extern void event_reserved();
extern void event_tex();
extern void event_linebreak();
extern void event_startmusicline();
extern void event_endmusicline();
extern void event_eof();
extern void event_comment();
extern void event_specific();
extern void event_specific_in_header();
extern void event_startinline();
extern void event_closeinline();
extern void event_field();
extern void event_words();
extern void event_part();
extern void event_voice();
extern void event_length();
extern void event_blankline();
extern void event_refno();
extern void event_tempo();
extern void event_timesig();
extern void event_octave();
extern void event_info_key();
extern void event_info();
extern void event_key();
extern void event_microtone();
extern void event_graceon();
extern void event_graceoff();
extern void event_rep1();
extern void event_rep2();
extern void event_playonrep();
extern void event_tie();
extern void event_slur();
extern void event_sluron();
extern void event_sluroff();
extern void event_rest();
extern void event_mrest();
extern void event_spacing();
extern void event_bar();
extern void event_space();
extern void event_lineend();
extern void event_broken();
extern void event_tuple();
extern void event_chord();
extern void event_chordon();
extern void event_chordoff();
extern void event_instruction();
extern void event_gchord();
extern void event_note();
extern void event_abbreviation();
extern void event_acciaccatura();
extern void event_start_extended_overlay();
extern void event_stop_extended_overlay();
extern void event_split_voice();
extern void print_voicecodes();
extern void init_abbreviations();
extern void free_abbreviations();
extern void parsefile();
extern int parsetune();
#endif
/* parser2.c - further parsing */