Changeset 29
- Timestamp:
- 05/07/07 23:57:30 (2 years ago)
- Files:
-
- nekostring/trunk/gui/Makefile (modified) (5 diffs)
- nekostring/trunk/gui/callbacks.c (modified) (1 diff)
- nekostring/trunk/gui/interface.c (modified) (2 diffs)
- nekostring/trunk/src/Makefile (modified) (4 diffs)
- nekostring/trunk/src/neko-dssi.c (modified) (2 diffs)
- nekostring/trunk/src/neko_data.c (modified) (4 diffs)
- nekostring/trunk/src/neko_ensemble.c (modified) (2 diffs)
- nekostring/trunk/src/neko_synth.c (modified) (1 diff)
- nekostring/trunk/src/neko_synth.h (modified) (2 diffs)
- nekostring/trunk/src/neko_voice.c (modified) (2 diffs)
- nekostring/trunk/src/neko_voice_render.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nekostring/trunk/gui/Makefile
r19 r29 72 72 CTAGS = ctags 73 73 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 74 ACLOCAL = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run aclocal-1.974 ACLOCAL = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run aclocal-1.9 75 75 AMDEP_FALSE = # 76 76 AMDEP_TRUE = 77 AMTAR = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run tar77 AMTAR = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run tar 78 78 AR = ar 79 AUTOCONF = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run autoconf80 AUTOHEADER = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run autoheader81 AUTOMAKE = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run automake-1.982 AWK = mawk79 AUTOCONF = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run autoconf 80 AUTOHEADER = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run autoheader 81 AUTOMAKE = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run automake-1.9 82 AWK = gawk 83 83 BUILD_GUI_FALSE = # 84 84 BUILD_GUI_TRUE = 85 85 CC = gcc 86 86 CCDEPMODE = depmode=gcc3 87 CFLAGS = - g -O287 CFLAGS = -Werror -Wall 88 88 CPP = gcc -E 89 89 CPPFLAGS = … … 104 104 FFLAGS = 105 105 GREP = /bin/grep 106 GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 106 GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 107 107 GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 108 108 INSTALL_DATA = ${INSTALL} -m 644 … … 116 116 LN_S = ln -s 117 117 LTLIBOBJS = 118 MAKEINFO = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run makeinfo118 MAKEINFO = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run makeinfo 119 119 OBJEXT = o 120 120 PACKAGE = nekostring 121 121 PACKAGE_BUGREPORT = 122 PACKAGE_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 122 PACKAGE_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 123 123 PACKAGE_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 124 124 PACKAGE_NAME = … … 164 164 includedir = ${prefix}/include 165 165 infodir = ${datarootdir}/info 166 install_sh = /home/gordonjcp/devel/nekostring/ trunk/install-sh166 install_sh = /home/gordonjcp/devel/nekostring/install-sh 167 167 libdir = ${exec_prefix}/lib 168 168 libexecdir = ${exec_prefix}/libexec … … 183 183 -DPACKAGE_DATA_DIR=\""$(datadir)"\" 184 184 185 # -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 186 nekostring_gtk_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include $(AM_CFLAGS)185 # -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 186 nekostring_gtk_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 $(AM_CFLAGS) 187 187 nekostring_gtk_SOURCES = \ 188 188 main.c \ nekostring/trunk/gui/callbacks.c
r9 r29 32 32 float value; 33 33 34 index=0; 35 value=0; 34 36 printf("from slider: %f\n",cval); 35 37 nekostring/trunk/gui/interface.c
r9 r29 296 296 297 297 image1 = gtk_image_new_from_icon_name ("gtk-dialog-warning", GTK_ICON_SIZE_BUTTON); 298 gtk_image_set_pixel_size ( image1, 57);298 gtk_image_set_pixel_size (GTK_IMAGE(image1), 57); 299 299 gtk_widget_show (image1); 300 300 gtk_box_pack_start (GTK_BOX (hbox5), image1, TRUE, TRUE, 0); … … 408 408 409 409 image2 = gtk_image_new_from_icon_name ("gtk-bold", GTK_ICON_SIZE_BUTTON); 410 gtk_image_set_pixel_size ( image2, 209);410 gtk_image_set_pixel_size (GTK_IMAGE(image2), 209); 411 411 gtk_widget_show (image2); 412 412 gtk_container_add (GTK_CONTAINER (notebook1), image2); nekostring/trunk/src/Makefile
r19 r29 76 76 CTAGS = ctags 77 77 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 78 ACLOCAL = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run aclocal-1.978 ACLOCAL = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run aclocal-1.9 79 79 AMDEP_FALSE = # 80 80 AMDEP_TRUE = 81 AMTAR = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run tar81 AMTAR = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run tar 82 82 AR = ar 83 AUTOCONF = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run autoconf84 AUTOHEADER = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run autoheader85 AUTOMAKE = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run automake-1.986 AWK = mawk83 AUTOCONF = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run autoconf 84 AUTOHEADER = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run autoheader 85 AUTOMAKE = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run automake-1.9 86 AWK = gawk 87 87 BUILD_GUI_FALSE = # 88 88 BUILD_GUI_TRUE = 89 89 CC = gcc 90 90 CCDEPMODE = depmode=gcc3 91 CFLAGS = - g -O291 CFLAGS = -Werror -Wall 92 92 CPP = gcc -E 93 93 CPPFLAGS = … … 108 108 FFLAGS = 109 109 GREP = /bin/grep 110 GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 110 GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 111 111 GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 112 112 INSTALL_DATA = ${INSTALL} -m 644 … … 120 120 LN_S = ln -s 121 121 LTLIBOBJS = 122 MAKEINFO = ${SHELL} /home/gordonjcp/devel/nekostring/ trunk/missing --run makeinfo122 MAKEINFO = ${SHELL} /home/gordonjcp/devel/nekostring/missing --run makeinfo 123 123 OBJEXT = o 124 124 PACKAGE = nekostring 125 125 PACKAGE_BUGREPORT = 126 PACKAGE_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 126 PACKAGE_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 127 127 PACKAGE_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 128 128 PACKAGE_NAME = … … 168 168 includedir = ${prefix}/include 169 169 infodir = ${datarootdir}/info 170 install_sh = /home/gordonjcp/devel/nekostring/ trunk/install-sh170 install_sh = /home/gordonjcp/devel/nekostring/install-sh 171 171 libdir = ${exec_prefix}/lib 172 172 libexecdir = ${exec_prefix}/libexec nekostring/trunk/src/neko-dssi.c
r6 r29 450 450 } 451 451 452 run_bog(synth, burst_size); 452 453 /* render the burst */ 453 454 neko_synth_render_voices(synth, synth->left + samples_done, burst_size, … … 458 459 // gjcp - this looks like where "global" effects should be! 459 460 ensemble (synth->left, synth->right, sample_count, synth); 461 462 460 463 461 464 #if defined(NEKO_DEBUG) && (NEKO_DEBUG & XDB_AUDIO) nekostring/trunk/src/neko_data.c
r9 r29 34 34 .7 // volume 35 35 36 }; 37 36 37 }; 38 39 /* 38 40 static int 39 is_comment(char *buf) / * line is blank, whitespace, or first non-whitespace character is '#' */41 is_comment(char *buf) // line is blank, whitespace, or first non-whitespace character is 40 42 { 41 43 int i = 0; … … 49 51 return 1; 50 52 } 51 53 */ 54 /* 52 55 static void 53 56 parse_name(const char *buf, char *name, int *inlen) … … 70 73 } 71 74 } 72 / * trim trailing spaces */75 // trim trailing spaces 73 76 while (o && name[o - 1] == ' ') o--; 74 77 name[o] = '\0'; … … 76 79 if (inlen) *inlen = i; 77 80 } 78 81 */ 79 82 int 80 83 neko_data_read_patch(FILE *file, neko_patch_t *patch) nekostring/trunk/src/neko_ensemble.c
r6 r29 11 11 12 12 #include 13 #include 13 14 #include "neko_synth.h" 14 15 … … 34 35 float s1, s2; // samples from the buffer 35 36 36 float s_mix_1 , s_mix_2, s_mix_3; // mix for antialiasing37 float s_mix_1; //, s_mix_2, s_mix_3; // mix for antialiasing 37 38 float so1,so2,so3; 38 39 float d1,d2; nekostring/trunk/src/neko_synth.c
r6 r29 637 637 } 638 638 } 639 640 void run_bog(neko_synth_t *synth, unsigned long sample_count) 641 { 642 unsigned int i; 643 float p; 644 645 for(i = 0; i<12; i++) { 646 p= synth->bog_pos[i]; 647 p += ((float)sample_count*neko_pitch[24+i] *440 * synth->deltat); 648 if (p>1.0f) p -= 1.0f; 649 synth->bog_pos[i]=p; 650 //printf("%d:%f\t", i, synth->bog_pos[i]); 651 } 652 // printf("\n"); 653 } nekostring/trunk/src/neko_synth.h
r6 r29 43 43 unsigned long nugget_remains; 44 44 45 /* bottom octave generator */ 46 47 float bog_pos[12]; 45 48 /* voice tracking and data */ 46 49 unsigned int note_id; /* incremented for every new note, used for voice-stealing prioritization */ … … 133 136 char *dssi_configure_message(const char *fmt, ...); 134 137 138 void run_bog(neko_synth_t *synth, unsigned long sample_count); 139 135 140 /* these come right out of alsa/asoundef.h */ 136 141 #define MIDI_CTL_MSB_MODWHEEL 0x01 /**< Modulation */ nekostring/trunk/src/neko_voice.c
r6 r29 44 44 unsigned char key, unsigned char velocity) 45 45 { 46 int i ,f_key,oldest_voice;46 int i; 47 47 float oct_mult,osc_pos; 48 48 49 voice->key=255; // impossible50 51 49 if (!synth->monophonic || !(_ON(voice) || _SUSTAINED(voice))) { 52 50 … … 100 98 voice->c5 = 0.0f; 101 99 voice->osc_index = 0; 100 101 oct_mult=pow(2,(key/12)-2); 102 102 103 // scan for octaves, try and start new oscillator in phase 104 // this would stop notes an octave apart cancelling 105 printf("in note_on\n"); 106 107 // loop through all voices 108 for(i = 0;i < (synth->voices);i++) 109 { 110 f_key=synth->voice[i]->key; 111 112 // redundant, 'cos we never complete the loop really 113 114 if (synth->voice[i]->key==255) { printf("This is voice %d\n",i); } 115 if (f_key==255) { printf("This is voice %d\n",i); } 116 117 118 // is our new note an octave away from something already here? 119 if (f_key%12==key%12) { 120 oct_mult=pow(2,(key/12-f_key/12)); 121 122 voice->osc_bass.pos = synth->voice[i]->osc_bass.pos*oct_mult; 123 voice->osc_cello.pos = synth->voice[i]->osc_cello.pos*oct_mult; 124 voice->osc_viola.pos = synth->voice[i]->osc_viola.pos*oct_mult; 125 voice->osc_violin.pos = synth->voice[i]->osc_violin.pos*oct_mult*2; 126 ; 127 printf("resetting voice phase from voice[%d], %f\n",i,synth->voice[i]->osc_viola.pos); 128 i=synth->voices+1; 129 f_key=1000; 130 131 } 132 133 } 134 if(f_key!=1000){ 135 voice->osc_bass.pos = 0.0f; 136 voice->osc_cello.pos = 0.0f; 137 voice->osc_viola.pos = 0.0f; 138 voice->osc_violin.pos = 0.0f; 139 printf("zeroed voice phase\n"); 140 } 141 } 103 voice->osc_bass.pos = 0;//synth->voice[i]->osc_bass.pos*oct_mult; 104 osc_pos=synth->bog_pos[key%12] *oct_mult /2; 105 osc_pos=osc_pos-(float)trunc(osc_pos); 106 voice->osc_cello.pos = osc_pos;//synth->voice[i]->osc_cello.pos*oct_mult; 107 osc_pos=synth->bog_pos[key%12] *oct_mult; 108 osc_pos=osc_pos-(float)trunc(osc_pos); 109 voice->osc_viola.pos = osc_pos; 110 osc_pos=synth->bog_pos[key%12] *oct_mult*2; 111 osc_pos=osc_pos-(float)trunc(osc_pos); 112 voice->osc_violin.pos = osc_pos;//synth->voice[i]->osc_violin.pos*oct_mult*2; 113 142 114 143 printf("%f\n",voice->osc_viola.pos);115 } 144 116 voice->eg1_phase = 0; 145 117 voice->eg2_phase = 0; nekostring/trunk/src/neko_voice_render.c
r6 r29 22 22 #include "neko_voice.h" 23 23 24 /********************************************************************25 * *26 * Neko-DSSI started out as a DSSI demonstration plugin, and *27 * originally this file was just Steve Brookes' Neko code with as *28 * little modification as was necessary to interface it with my DSSI *29 * plugin code. If you'd like to see that simpler version, check *30 * out the included file src/neko_voice_render-original.c. *31 * *32 * Since that beginning, the following code has gained band-limited *33 * oscillators, velocity sensitive envelopes, a more stable filter, *34 * and some measure of optimization, so it's considerably more *35 * complex. *36 * *37 * Oh, and Steve, wherever you are -- thanks. *38 * *39 ********************************************************************/40 41 24 #define M_2PI_F (2.0f * (float)M_PI) 42 25 #define M_PI_F (float)M_PI … … 95 78 /* MIDI note to pitch */ 96 79 for (i = 0; i < 128; ++i) { 97 // we randomise each note a little to avoid octaves "cancelling" 98 // it's hackish and horrible, and it means that some octaves can have a deep swooshy flange 99 // oh well. 100 pexp = (float)(i - pitch_ref_note) / 12.0f;//+(0.004-0.008*((float)rand()/2147483647)); 80 pexp = (float)(i - pitch_ref_note) / 12.0f; 101 81 neko_pitch[i] = powf(2.0f, pexp);//; 102 82 } … … 357 337 float fund_pitch; 358 338 float deltat = synth->deltat; 359 float freq, freqkey, freqeg1, freqeg2, lfo;339 // float freq, freqkey, freqeg1, freqeg2, lfo; 360 340 361 341 /* set up synthesis variables from patch */ … … 368 348 float eg2_rate_level[3], eg2_one_rate[3]; 369 349 370 float balance1 = 1.0f - *(synth->mix);371 float balance2 = *(synth->mix);350 // float balance1 = 1.0f - *(synth->mix); 351 // float balance2 = *(synth->mix); 372 352 float vol_out = volume(*(synth->volume) * synth->cc_volume); 373 353 // value = xpd->a * exp(xpd->c * cval * log(xpd->b)); … … 380 360 381 361 fund_pitch = voice->target_pitch; 382 383 362 fund_pitch *= synth->pitch_bend * *(synth->tuning); 363 364 384 365 385 366 omega1 = fund_pitch; … … 403 384 eg2_amp *= 0.99f; /* if (!eg1_phase && eg1 > 0.99f) eg1_phase = 1; */ 404 385 405 freq = M_PI_F * deltat * fund_pitch * synth->mod_wheel; /* now (0 to 1) * pi */386 // freq = M_PI_F * deltat * fund_pitch * synth->mod_wheel; /* now (0 to 1) * pi */ 406 387 407 388 /* --- LFO, EG1, and EG2 section */ … … 427 408 // generate cello 428 409 vco(sample_count, voice, &voice->osc_cello, 429 410 osc_index, 0.999, 0.3, *(synth->cello), deltat * omega1/2); 430 411 // generate viola 431 412 vco(sample_count, voice, &voice->osc_viola,