Codebase list guitarix / upstream/0.22.3
Imported Upstream version 0.22.3 Ross Gammon 8 years ago
5 changed file(s) with 47 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
199199 ** GxConvolver
200200 */
201201
202 /*
203 ** GxConvolver::read_sndfile()
204 **
205 ** read samples from soundfile into convolver
206 ** the convolver is working at rate samplerate, the audio file has audio.rate
207 **
208 ** offset, length, points are based on audio.rate, delay and the count of
209 ** samples written into the convolver are based on samplerate.
210 **
211 ** Arguments:
212 ** Audiofile& audio already opened, will be converted to samplerate
213 ** on the fly
214 ** int nchan channel count for convolver (can be less
215 ** or more than audio.chan())
216 ** int samplerate current engine samplerate
217 ** const float *gain array[nchan] of gains to be applied
218 ** unsigned int *delay array[nchan], starting sample index for values
219 ** stored into convolver
220 ** unsigned int offset offset into audio file
221 ** unsigned int length number of samples to be read from audio
222 ** const Gainline& points gain line to be applied
223 **
224 ** returns false if some error occurred, else true
225 */
202226 bool GxConvolver::read_sndfile(
203227 Audiofile& audio, int nchan, int samplerate, const float *gain,
204228 unsigned int *delay, unsigned int offset, unsigned int length,
218242 return false;
219243 }
220244 try {
221 buff = new float[BSIZE * nchan];
245 buff = new float[BSIZE * audio.chan()];
222246 } catch(...) {
223247 audio.close();
224248 gx_system::gx_print_error("convolver", "out of memory");
225249 return false;
226250 }
227251 if (samplerate != audio.rate()) {
228 ostringstream buf;
229 buf << "resampling from " << audio.rate() << " to " << samplerate;
230 gx_system::gx_print_info("convolver", buf.str());
231 if (!resamp.setup(audio.rate(), samplerate, nchan)) {
252 gx_system::gx_print_info(
253 "convolver", Glib::ustring::compose(
254 _("resampling from %1 to %2"), audio.rate(), samplerate));
255 if (!resamp.setup(audio.rate(), samplerate, audio.chan())) {
256 gx_system::gx_print_error("convolver", "resample failure");
232257 assert(false);
258 return false;
233259 }
234260 try {
235 rbuff = new float[resamp.get_max_out_size(BSIZE)*nchan];
261 rbuff = new float[resamp.get_max_out_size(BSIZE)*audio.chan()];
236262 } catch(...) {
237263 audio.close();
238264 gx_system::gx_print_error("convolver", "out of memory");
273299 compute_interpolation(fct, gp, idx, points, offset);
274300 }
275301
276 for (int ichan = 0; ichan < nchan; ichan++) {
277 buff[ix*nchan+ichan] *= pow(10, gp + ix*fct) * gain[ichan];
302 for (int ichan = 0; ichan < min(audio.chan(), nchan); ichan++) {
303 buff[ix*audio.chan()+ichan] *= pow(10, gp + ix*fct) * gain[ichan];
278304 }
279305 }
280306 offset += nfram;
352378 << ", lgain" << lgain << endl;
353379 */
354380
381 if (samplerate != static_cast<unsigned int>(audio.rate())) {
382 float f = float(samplerate) / audio.rate();
383 size = round(size * f) + 2; // 2 is safety margin for rounding differences
384 delay = round(delay * f);
385 ldelay = round(ldelay * f);
386 }
355387 if (Convproc::configure(2, 2, size, buffersize, bufsize, Convproc::MAXPART)) {
356388 gx_system::gx_print_error("convolver", "error in Convproc::configure ");
357389 return false;
9898 * in gx_amp.dsp - gx_ampmodul.dsp
9999 */
100100
101 static inline float Ftube(int table, float Vgk) {
101 static inline double Ftube(int table, double Vgk) {
102102 const table1d& tab = *tubetab[table];
103 float f = (Vgk - tab.low) * tab.istep;
103 double f = (Vgk - tab.low) * tab.istep;
104104 int i = static_cast<int>(f);
105105 if (i < 0)
106106 return tab.data[0];
281281 sigc::group(&gx_cairo::splash_expose, GTK_WIDGET(gobj()),
282282 sigc::_1, (void*)0), false);
283283 set_decorated(false);
284 set_auto_startup_notification(false);
284285 set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
285286 set_position(Gtk::WIN_POS_CENTER );
286287 set_default_size(280,80);
339340
340341 gx_system::CmdlineOptions options;
341342 Gtk::Main main(argc, argv, options);
343
342344 GxSplashBox * Splash = new GxSplashBox();
343345
344346 gx_system::GxExit::get_instance().signal_msg().connect(
496496 evbox.set_above_child(mode);
497497 if (mode) {
498498 mconbox.hide();
499 if (preset_button)
499500 preset_button->hide();
500501 mb_expand_button->hide();
501502 if (mb_delete_button) {
503504 }
504505 } else {
505506 mconbox.show();
507 if (preset_button)
506508 preset_button->show();
507509 mb_expand_button->show();
508510 if (mb_delete_button) {
2323 use_2to3 = True
2424
2525 # used by waf dist and waf build
26 VERSION='0.22.2'
26 VERSION='0.22.3'
2727 APPNAME='guitarix'
2828
2929 good_faust_versions = ['0.9.43']