diff --git a/Makefile b/Makefile index cbd239a8aa2c235adc0e699c65b6445a381f6957..c74c07816ee280199dbabeafba33a05384ef3f3d 100644 --- a/Makefile +++ b/Makefile @@ -23,12 +23,12 @@ SRC = main.c mainpanel.c multibar.c readout.c input.c output.c clippanel.c \ declip.c reconstruct.c multicompand.c windowbutton.c subpanel.c \ feedback.c freq.c eq.c eqpanel.c compandpanel.c subband.c lpc.c \ bessel.c suppresspanel.c suppress.c singlecomp.c singlepanel.c \ - limit.c limitpanel.c mute.c mixpanel.c mix.c reverb.c + limit.c limitpanel.c mute.c mixpanel.c mix.c reverb.c reverbpanel.c OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o clippanel.o \ declip.o reconstruct.o multicompand.o windowbutton.o subpanel.o \ feedback.o freq.o eq.o eqpanel.o compandpanel.o subband.o lpc.o \ bessel.o suppresspanel.o suppress.o singlecomp.o singlepanel.o \ - limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o + limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o reverbpanel.o GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED all: diff --git a/main.c b/main.c index fcd088844ef44f7801c2119e6bceff820eaf7620..882459307d3bf768848a9a01ae6e197b1cea2aaf 100644 --- a/main.c +++ b/main.c @@ -40,6 +40,7 @@ #include "limit.h" #include "mute.h" #include "mix.h" +#include "reverb.h" pthread_mutex_t master_mutex=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; @@ -149,6 +150,7 @@ int main(int argc, char **argv){ if(limit_load(OUTPUT_CHANNELS))exit(1); if(mute_load())exit(1); if(mix_load(OUTPUT_CHANNELS))exit(1); + if(plate_load(OUTPUT_CHANNELS))exit(1); /* look at stdout... do we have a file or device? */ if(!isatty(STDOUT_FILENO)){ diff --git a/mainpanel.c b/mainpanel.c index 678fd5ad0eba506f871d577576393b4ef6e13cd1..8dd3425a07d955faeec627842114e52bd314f79b 100644 --- a/mainpanel.c +++ b/mainpanel.c @@ -962,7 +962,7 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){ mainpanel_chentry(panel,channeltable,"_Singlecomp ",2,0,singlepanel_create_channel); mainpanel_chentry(panel,channeltable,"De_verb ",3,suppresspanel_create_channel,0); mainpanel_chentry(panel,channeltable,"_EQ ",4,0,eqpanel_create_channel); - mainpanel_chentry(panel,channeltable,"_Reverb ",5,0,0); + mainpanel_chentry(panel,channeltable,"_Reverb ",5,0,reverbpanel_create_channel); mainpanel_chentry(panel,channeltable,"Atten/Mi_x ",6,attenpanel_create, mixpanel_create_channel); @@ -989,17 +989,16 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){ mainpanel_masterentry(panel,mastertable,"_Multicomp "," m ",GDK_m,0,compandpanel_create_master); mainpanel_masterentry(panel,mastertable,"_Singlecomp "," s ",GDK_s,1,singlepanel_create_master); - mainpanel_masterentry(panel,mastertable,"_Reverb "," r ",GDK_r,2,0); - mainpanel_masterentry(panel,mastertable,"_EQ "," e ",GDK_e,3,eqpanel_create_master); + mainpanel_masterentry(panel,mastertable,"_EQ "," e ",GDK_e,2,eqpanel_create_master); + mainpanel_masterentry(panel,mastertable,"_Reverb "," r ",GDK_r,3,reverbpanel_create_master); mainpanel_masterentry(panel,mastertable,"_Limit "," l ",GDK_l,4,limitpanel_create); /* output has three activity buttons not in the main grid */ { GtkWidget *ww=windowbutton_new("_Output "); - GtkWidget *std=gtk_toggle_button_new_with_label("o"); - GtkWidget *ply=gtk_toggle_button_new_with_label("p"); - GtkWidget *fil=gtk_toggle_button_new_with_label("f"); + GtkWidget *std=gtk_toggle_button_new_with_label(" o "); + GtkWidget *ply=gtk_toggle_button_new_with_label("play"); GtkWidget *box=gtk_hbox_new(0,0); GtkWidget *box2=gtk_hbox_new(1,0); @@ -1011,12 +1010,10 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){ gtk_widget_add_accelerator (std, "activate", panel->group, GDK_o, 0, 0); gtk_widget_add_accelerator (ply, "activate", panel->group, GDK_p, 0, 0); - gtk_widget_add_accelerator (fil, "activate", panel->group, GDK_f, 0, 0); gtk_box_pack_start(GTK_BOX(box),ww,0,0,0); gtk_box_pack_start(GTK_BOX(box),box2,1,1,2); gtk_box_pack_start(GTK_BOX(box2),ply,1,1,0); - gtk_box_pack_start(GTK_BOX(box2),fil,1,1,0); gtk_table_attach_defaults(GTK_TABLE(mastertable),fw,0,1,6,7); diff --git a/mainpanel.h b/mainpanel.h index 72fe794807dcbe7bc843ca9e3d19c238ae710bea..1b253315e31817adabab3f977bb0cf5afd623eca 100644 --- a/mainpanel.h +++ b/mainpanel.h @@ -33,7 +33,7 @@ typedef struct postfish_mainpanel postfish_mainpanel; #include "suppresspanel.h" #include "limitpanel.h" #include "mixpanel.h" -#include "mutedummy.h" +#include "reverbpanel.h" struct postfish_mainpanel{ GtkWidget *twirlimage; diff --git a/mix.c b/mix.c index f65df1dc3ae993c8214626437bbd50950deedd0c..c5b1da0a5c595aa803789dbb8048265b0ea9e004 100644 --- a/mix.c +++ b/mix.c @@ -279,12 +279,17 @@ time_linkage *mix_read(time_linkage *in, /* eliminate asynch change possibility */ memcpy(ms.curr,mix_set,sizeof(*mix_set)*input_ch); - /* a bit of laziness that may actually save time by avoiding + /* a bit of laziness that may actually save CPU time by avoiding special-cases later */ - for(i=0;iactive,i)) memset(in->data[i],0,sizeof(**in->data)*input_size); - + if(mute_channel_muted(inA->active,i)) + memset(inA->data[i],0,sizeof(**inA->data)*input_size); + if(mute_channel_muted(inB->active,i)) + memset(inB->data[i],0,sizeof(**inB->data)*input_size); + } + /* input-by-input */ for(i=0;iactive,i)){ memset(mix,0,sizeof(mix)); mixwork(inA->data[i],ms.cacheP[i],ms.cachePP[i], @@ -322,14 +327,14 @@ time_linkage *mix_read(time_linkage *in, bypass=0; for(j=0;jpeak[0][i])peak[0][i]=val; + if(val>peak[1][i])peak[1][i]=val; acc+=val; } - peak[1][i]=peak[0][i]; rms[1][i]=acc/input_size; } + acc=0.; if(inB && !mute_channel_muted(inB->active,i)){ memset(mix,0,sizeof(mix)); mixwork(inB->data[i],ms.cacheP[i],ms.cachePP[i], @@ -338,11 +343,10 @@ time_linkage *mix_read(time_linkage *in, bypass=0; for(j=0;jpeak[0][i])peak[0][i]=val; + if(val>peak[2][i])peak[2][i]=val; acc+=val; } - peak[2][i]=peak[0][i]; rms[2][i]=acc/input_size; } } diff --git a/mixpanel.c b/mixpanel.c index 437166ddf54ff346ff413aa35f80a6e105b3299b..9ba26d899a96993b757df8344e58baf98029fc1b 100644 --- a/mixpanel.c +++ b/mixpanel.c @@ -120,7 +120,8 @@ static float levels_del[6]={-50,-20,-10,-5,-1,0}; static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp, subpanel_generic *panel, - mix_settings *m){ + mix_settings *m, + int thisch){ int i,j; @@ -177,9 +178,9 @@ static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp, multibar_callback(MULTIBAR(AB->s),AB_slider_change,AB); multibar_thumb_set(MULTIBAR(AB->s),100,0); multibar_callback(MULTIBAR(att->s),dB_slider_change,att); - multibar_thumb_set(MULTIBAR(att->s),0,0); + multibar_thumb_set(MULTIBAR(att->s),-3,0); multibar_callback(MULTIBAR(del->s),ms_slider_change,del); - multibar_thumb_set(MULTIBAR(del->s),0,0); + multibar_thumb_set(MULTIBAR(del->s),-1,0); ps->place[0]=multibar_new(6,labels_dBn,levels_dBn,0, LO_ATTACK|LO_DECAY|HI_DECAY); @@ -316,7 +317,10 @@ static mix_panelsave *mixpanel_create_helper(postfish_mainpanel *mp, G_CALLBACK (toggle_callback), (gpointer)&m->insert_source[i][2]); - + if(i==0){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bM),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bA),1); + } for(j=0;jinsert_dest[i][j]); + if(thisch%2 == j && i == 0) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(b),1); + gtk_box_pack_start(GTK_BOX(boxB),b,1,1,0); } @@ -385,7 +392,7 @@ void mixpanel_create_channel(postfish_mainpanel *mp, &mixpanel_visible[i], buffer,0,i,1); - mix_panels[i]=mixpanel_create_helper(mp,panel,mix_set+i); + mix_panels[i]=mixpanel_create_helper(mp,panel,mix_set+i,i); } } @@ -463,6 +470,8 @@ void attenpanel_create(postfish_mainpanel *mp, GTK_FILL|GTK_EXPAND,0,0,0); gtk_table_attach(GTK_TABLE(table),del->r,3,4,1+i*3,2+i*3, GTK_FILL|GTK_EXPAND,0,0,0); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(activebutton[i]),1); } gtk_box_pack_start(GTK_BOX(panel->subpanel_box),table,1,1,4); @@ -488,8 +497,8 @@ void mixpanel_feedback(int displayit){ if(pull_mix_feedback(peakfeed,rmsfeed)==1){ for(j=0;jlabels;i++){ + for(i=0;i<=m->labels;i++){ pango_layout_get_pixel_size(m->layout[i],&x,&y); if(x>maxx)maxx=x; diff --git a/mutedummy.h b/mutedummy.h deleted file mode 100644 index c999d9ed137c1eb2655b5145580069189ca9cb7a..0000000000000000000000000000000000000000 --- a/mutedummy.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * postfish - * - * Copyright (C) 2002-2004 Monty - * - * Postfish is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * Postfish is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Postfish; see the file COPYING. If not, write to the - * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - */ - -extern void mutedummy_create(postfish_mainpanel *mp, - GtkWidget **windowbutton, - GtkWidget **activebutton); diff --git a/output.c b/output.c index acf7c50ff90da9b37441b7c57c81be2ce6907e06..24ae5577bbd373652a2475b65166ce88c0cba57c 100644 --- a/output.c +++ b/output.c @@ -36,6 +36,7 @@ #include "limit.h" #include "mute.h" #include "mix.h" +#include "reverb.h" extern int input_size; extern int input_rate; @@ -67,6 +68,7 @@ void pipeline_reset(){ limit_reset(); /* clear any persistent lapping state */ output_reset(); /* clear any persistent lapping state */ mix_reset(); + plate_reset(); } typedef struct output_feedback{ @@ -250,8 +252,16 @@ void *playback_thread(void *dummy){ link=eq_read_channel(link); result|=link->samples; - link=mix_read(link,0,0); - result|=link->samples; + /* per-channel plate reverb generates more channels than it takes; + these are swallowed and mixed immediately by mixdown */ + { + time_linkage *reverbA; + time_linkage *reverbB; + link=plate_read_channel(link,&reverbA,&reverbB); + + link=mix_read(link,reverbA,reverbB); + result|=link->samples; + } link=multicompand_read_master(link); result|=link->samples; @@ -259,11 +269,12 @@ void *playback_thread(void *dummy){ result|=link->samples; link=eq_read_master(link); result|=link->samples; + link=plate_read_master(link); + result|=link->samples; if(!result)break; /************/ - /* master att */ if(link->samples>0){ float scale=fromdB(master_att/10.); diff --git a/version.h b/version.h index a37e71b61672d799c39f7a674fece6ead7134ce2..566da0d525a79ad1c4844ef718313e9dbc5bae78 100644 --- a/version.h +++ b/version.h @@ -1,2 +1,2 @@ #define VERSION "$Id$ " -/* DO NOT EDIT: Automated versioning hack [Mon May 17 04:15:01 EDT 2004] */ +/* DO NOT EDIT: Automated versioning hack [Mon May 17 17:49:56 EDT 2004] */