lingot-1.0.1/0000755000175000017500000000000013320113730007777 500000000000000lingot-1.0.1/README0000644000175000017500000001516413320113677010620 00000000000000LINGOT - A musical instrument tuner. Written by: Iban Cereijo Jairo Chapela Copyright (C) 2004-2018 Iban Cereijo Copyright (C) 2004-2018 Jairo Chapela Description =========== Lingot is a musical instrument tuner. It's accurate, easy to use, and highly configurable. Originally conceived to tune electric guitars, it can now be used to tune other instruments. It looks like an analog tuner, with a gauge indicating the relative shift to a certain note found automatically as the closest note to the estimated frequency. Requirements ============ * Sound card. * Linux kernel with audio support (OSS, ALSA, JACK or PulseAudio). * GTK+ library, version 3.10. Installation ============ If you are building a release, just type: > ./configure > make install If you are building a development version obtained from our VCS you will need to create the configure script first by calling: > ./bootstrap Lingot supports the following audio systems/servers: OSS ALSA JACK PulseAudio You can enable/disable each of them with the following options passed to the configure script, all of them enabled by default: --enable-oss= --enable-alsa= --enable-jack= --enable-pulseaudio= Also, the depedency to libfftw can be enabled/disabled with --enable-libfftw= Please, see the INSTALL file. Synopsis ======== lingot [-c config] The -c option causes the search of a file named {config}.conf in the ~/.lingot folder. For example: lingot -c bass will take the configuration file ~/.lingot/bass.conf. This is useful for maintaining different configurations for different instruments. It's also possible to load and save configuration files from the GUI. The default configuration file is ~/.lingot/lingot.conf. Configuration file ================== When lingot is launched for the first time, the default configuration file ~/.lingot/lingot.conf will be created. The default values are optimized for tuning electric guitars, other musical instruments might require these values to be slightly changed (a good practice would be to have a configuration file for each instrument). The options can be changed via GUI. There is a wide range of options, with the purpose of keeping the maximum configurability. Some background in signal processing is needed for a good understanding of all of their effects. We detail the main options that constitute this file, and we recommend to make changes depending on the desired tuning precision and demanded CPU time. If you don't understand the effects of some options, then just try different values or, even better, don't change them. AUDIO_SYSTEM Audio system switch. Possible values: OSS ALSA [default value] JACK PulseAudio AUDIO_DEV (OSS sound device) Selected sound device for the OSS audio system. The default value is '/dev/dsp'. AUDIO_DEV_ALSA (ALSA sound device) Selected sound device for ALSA, the default value is 'default'. AUDIO_DEV_JACK (JACK port) Selected sound port for JACK, the default value is 'default'. AUDIO_DEV_PULSEAUDIO (PulseAudio sound device) Selected sound device for PulseAudio, the default value is 'default'. ROOT_FREQUENCY_ERROR ("A" reference note shift) This option is used when we want to tune with a certain amount of shift in frequency. This can be useful when tuning an instrument against a recording with a shifted tuning. For example, if we hear an "A" note in a recording that it's a quarter of a tone over the real frequency (440 Hz), we can put 50 cents of shift here. It must be a real number, expressed in cents. The default value is 0. FFT_SIZE (Size of the FTT) A high value gets more accuracy, especially more precision locking the desired frequency, but it demands more CPU time. We must consider the time interval involved on the calculus before unnecessarily raising this value: having a buffer of 4096 samples for the FFT, and a sampling rate of 8 KHz, each transform needs the last 512 ms temporary values, so there is no point in putting a shorter temporal window. It must be an integer power of 2. The default value is 512 samples. TEMPORAL_WINDOW The length in time of the signal used to compute the final frequency. With higher values, we'll obtain a more accurate result, but also a slower response polluted by earlier notes. As a practical rule, we say that if we have a temporal window of 1 second, we must wait 1 second between two consecutive notes to obtain a correct tuning. Therefore, this parameter affects directly to the responsiveness of the tuner. The temporal window size in samples (obtained as the multiplication of its duration in seconds and the effective sampling rate) must be greater than the FFT buffer size. It must be a real number in seconds. The default value is 0.32 seconds. MIN_SNR To avoid tuning noise, this is the lower signal-to-noise ratio we require to start the tuning process. It's a real number whose units are dB. The default value is 20 dB. CALCULATION_RATE With higher calculations per second, the tuner gives us a better dynamic sensation, but it'll need more CPU time. It's a real number, in hertz, and the default value is 20 Hz. VISUALIZATION_RATE It has impact in the dynamism sensation achieved, but less in the computation time. There is no point having a calculation rate greater than the visualization rate. It's a real number, in hertz. The default value is 30 Hz. MINIMUM_FREQUENCY and MAXIMUM_FREQUENCY The minimum and maximum notes the instrument can tipically generate. These are not hard boundaries, but a guideline to help Lingot set its internal parameters. They are eal numbers, in hertz. The default values are 82.41 Hz (E2) and 329.63 Hz (E4) SCALE Definition of the scale used for the tuning. By default a 12 semitones equal-tempered scale is used. It contains several parameters: NAME: Scale name, only for your information. BASE_FREQUENCY: The absolute frequency - in hertz - of the first note. NOTE_COUNT: number of notes in the scale. NOTES: list of notes, being them pairs of name and frequency shift. The frequency shift can be expressed as a real number in cents or a division of integer values, encoding a frequency ratio, like '3/2' or '5/4'. Be careful with leaving wide gaps in frequency between each pair of adjacent notes, as the gauge range will adapt to the maximum of those distances. Try to use scales with at least 12 tones. lingot-1.0.1/NEWS0000644000175000017500000000751613320113677010441 00000000000000 Lingot 1.0.0 (2018-07-06) ------------------------- * Added PulseAudio support. * Migration to GTK+ 3.10 * Migration to graphic vectors with libcairo. Main window now resizable. * Modified the frequency finding algorithm. * Modified the configuration: the user specifies now the frequency range of the instrument, instead of providing low level parameters like the sample rate. * Implemented task #11284: audio devices autodetection. * Fixed several bugs: #32581, #35183, #35220, #35221, #54209, #40525. * Fixed SIGSEGV when there's no scale in config file (thanks to K. Volný). * Showing octave index along with the note. * Implemented task #10683: config file validation. * Implemented task #11100: add libfftw support. * Fixed bugs #643435, #730175 in debian. * Enhanced some error messages. * Fixed potential error when reading from OSS and ALSA. * Fixed memory leaks and improved memory management (thanks to Nicolas Boulenguez). Lingot 0.9.1 (2011-08-22) ------------------------- * Fixed bug #34007 (#637610 in debian). * Fixed bug #33046 (#622038 in debian). * Added 48K sample rate to OSS and ALSA. Lingot 0.9.0 (2011-02-21) ------------------------- * Lingot is now an universal tuner, it can tune any instrument according to a provided scale. + Scale edition in a table. + Importation of Scala .scl files (http://www.huygens-fokker.org/scala/) + The gauge adapts its range to the scale. + The deviation control has been moved to the scale tab. * Now it's possible to load and save configuration files from the GUI. * The graphic controllers in the audio capture section have been changed. The user can choose now any hardware sampling rate, and is notified when the rate is not available. * The GUI has been improved with tooltips and new notification messages. * Fixed bugs #31532 and #31369. Lingot 0.8.1 (2010-03-17) ------------------------- * Added a graphic controller for the MIN_FREQUENCY parameter. * Fixed a SIGSEGV in the JACK thread management (bug #29090). * Fixed core hang up bug #29091 (#562425 in debian). * Fixed https://bugzilla.redhat.com/show_bug.cgi?id=517970#c9 Lingot 0.8.0 (2010-02-26) ------------------------- * Added JACK and ALSA support. * New configuration dialog layout. * Fixed memory leak in GUI. * Changed default sample rate to 44100 Hz instead of 8 KHz. * Added translations: cs, sv, de, it, pt_BR, zh_CN. Lingot 0.7.6 (2007-12-23) ------------------------- * Fixed SEGFAULT bug on spectrum representation. * Changed Gnome menu ubication. Lingot 0.7.5 (2007-12-18) ------------------------- * Now the spectrum section has a real grid, with axis labels referred to the frequency and the signal power. * The spectrum section has also a dotted line indicating the noise threshold, enabling a more accurate and easy manner of adjusting it. * There has been implemented some internal features, as internal computation of filter coefficients and a Hamming window. * The source code has been "downgraded" from C++ to C as a first approach to GNU coding standards. * Added Catalan translation, thanks to Raúl Cambeiro. Lingot 0.7.4 (2007-08-30) ------------------------- * Added frequency legend, noise threshold and scroll bar to spectrum area * Reorganized Menu Items * Added a "View" menu item * Added translations: gl Lingot 0.7.4 (2007-08-23) ------------------------- * Fixed UTF-8 charset problems * Added translations: es Lingot 0.7.3 (2007-07-17) ------------------------- * Fixed two SIGSEGV bugs * Using GtkAboutDialog to show about info * Fixed size of the 'Note' frame on main window * Removed some gtk deprecated callings * Config dialog made more "GTK-compliant" Lingot 0.7.1 (2007-01-28) -------------------------- * Files reorganized to a more "GNU-like" structure. * Added multilingual support Lingot 0.6.0 (2004-12-19) ------------------------- * Initial release. lingot-1.0.1/configure.ac0000644000175000017500000001461013320113677012221 00000000000000dnl Process this file with autoconf to produce a configure script. dnl Created by Anjuta - will be overwritten dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration AC_INIT([Lingot], [1.0.1]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE AC_ISC_POSIX AC_PROG_CC AC_PROG_CC_STDC AC_HEADER_STDC AC_PROG_INTLTOOL([0.23]) AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources]) PKG_PROG_PKG_CONFIG([0.22]) GLIB_GSETTINGS GETTEXT_PACKAGE=lingot AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [lingot]) dnl Languages which your application supports ALL_LINGUAS="ca cs de es gl it pt_BR sv zh_CN fr" AM_GLIB_GNU_GETTEXT AC_PROG_LIBTOOL AC_CHECK_LIB(m, sin) AC_CHECK_HEADERS([langinfo.h]) AC_CHECK_HEADERS([libintl.h]) AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_FUNCS([floor]) AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_FUNCS([memmove]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([mkdir]) AC_CHECK_FUNCS([pow]) AC_CHECK_FUNCS([rint]) AC_CHECK_FUNCS([setlocale]) AC_CHECK_FUNCS([sqrt]) AC_CHECK_FUNCS([strchr]) AC_CHECK_FUNCS([strdup]) AC_CHECK_FUNCS([strerror]) AC_CHECK_FUNCS([strrchr]) AC_CHECK_FUNCS([strcasecmp]) AC_FUNC_MALLOC PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.10]) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) useoss=yes AC_ARG_ENABLE( oss, AC_HELP_STRING([--enable-oss], [use OSS @<:@default=yes@:>@]), [ if test "x$enableval" = "xno"; then useoss=no fi ]) if test "x$useoss" = "xyes"; then AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([sys/ioctl.h]) AC_SUBST(OSS_CFLAGS) AC_SUBST(OSS_LIBS) CFLAGS="$CFLAGS -DOSS" fi usealsa=yes AC_ARG_ENABLE( alsa, AC_HELP_STRING([--enable-alsa], [use ALSA @<:@default=yes@:>@]), [ if test "x$enableval" = "xno"; then usealsa=no fi ]) if test "x$usealsa" = "xyes"; then PKG_CHECK_MODULES([ALSA], [alsa]) AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_LIBS) CFLAGS="$CFLAGS -DALSA" fi usejack=yes AC_ARG_ENABLE( jack, AC_HELP_STRING([--enable-jack], [use JACK @<:@default=yes@:>@]), [ if test "x$enableval" = "xno"; then usejack=no fi ]) AM_CONDITIONAL(HAVE_JACK, test "x$usejack" = "xyes") if test "x$usejack" = "xyes"; then PKG_CHECK_MODULES(JACK, jack >= 0.117.0) AC_SUBST(JACK_CFLAGS) AC_SUBST(JACK_LIBS) CFLAGS="$CFLAGS -DJACK" fi usepulseaudio=yes AC_ARG_ENABLE( pulseaudio, AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio @<:@default=yes@:>@]), [ if test "x$enableval" = "xno"; then usepulseaudio=no fi ]) AM_CONDITIONAL(HAVE_PULSEAUDIO, test "x$usepulseaudio" = "xyes") if test "x$usepulseaudio" = "xyes"; then PKG_CHECK_MODULES(PULSEAUDIO, libpulse-simple >= 0.9.10) dnl PKG_CHECK_MODULES(PULSEAUDIO, pulseaudio >= 0.9.10) AC_SUBST(PULSEAUDIO_CFLAGS) AC_SUBST(PULSEAUDIO_LIBS) CFLAGS="$CFLAGS -DPULSEAUDIO" fi uselibfftw=yes fftw_found=no AC_ARG_ENABLE( libfftw, AC_HELP_STRING([--enable-libfftw], [use libfftw @<:@default=yes@:>@]), [ if test "x$enableval" = "xno"; then uselibfftw=no fi ]) dnl AM_CONDITIONAL(HAVE_LIBFFTW, test "x$uselibfftw" = "xyes") if test "x$uselibfftw" = "xyes"; then PKG_CHECK_MODULES([LIBFFTW], [fftw3 >= 3.2.2 fftw3f >= 3.2.2], [fftw_found=yes], [fftw_found=no]) if test "x$fftw_found" = xyes ; then AC_SUBST([LIBFFTW_CFLAGS]) AC_SUBST([LIBFFTW_LIBS]) CFLAGS="$CFLAGS -DLIBFFTW" else AC_MSG_WARN([ No libfftw was found : FFT will be slower ]) fi fi dnl PKG_CHECK_MODULES([GLADE], [libglade-2.0]) dnl AC_SUBST(GLADE_CFLAGS) dnl AC_SUBST(GLADE_LIBS) dnl Set PACKAGE_LOCALE_DIR in config.h. if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale", [Package local directory]) else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", [Package local directory]) fi dnl Set PACKAGE SOURCE DIR in config.h. packagesrcdir=`cd $srcdir && pwd` dnl Set PACKAGE PREFIX if test "x${prefix}" = "xNONE"; then packageprefix=${ac_default_prefix} else packageprefix=${prefix} fi dnl Set PACKAGE DATA & DOC DIR packagedatadir=share packagedocdir=doc/${PACKAGE} dnl Set PACKAGE DIRs in config.h. packagepixmapsdir=share/pixmaps/${PACKAGE} packageicondir=share/icons/hicolor/scalable/apps/ packagehelpdir=share/gnome/help/${PACKAGE} packagemenudir=share/applications dnl Subst PACKAGE_DATA_DIR. NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}" AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR) PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}" AC_SUBST(PACKAGE_DATA_DIR) dnl Subst PACKAGE_DOC_DIR. NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}" AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR) PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}" AC_SUBST(PACKAGE_DOC_DIR) dnl Subst PACKAGE_PIXMAPS_DIR. NO_PREFIX_PACKAGE_PIXMAPS_DIR="${packagepixmapsdir}" AC_SUBST(NO_PREFIX_PACKAGE_PIXMAPS_DIR) PACKAGE_PIXMAPS_DIR="${packageprefix}/${packagepixmapsdir}" AC_SUBST(PACKAGE_PIXMAPS_DIR) dnl Subst PACKAGE_ICON_DIR. NO_PREFIX_PACKAGE_ICON_DIR="${packageicondir}" AC_SUBST(NO_PREFIX_PACKAGE_ICON_DIR) PACKAGE_ICON_DIR="${packageprefix}/${packageicondir}" AC_SUBST(PACKAGE_ICON_DIR) dnl Subst PACKAGE_HELP_DIR. NO_PREFIX_PACKAGE_HELP_DIR="${packagehelpdir}" AC_SUBST(NO_PREFIX_PACKAGE_HELP_DIR) PACKAGE_HELP_DIR="${packageprefix}/${packagehelpdir}" AC_SUBST(PACKAGE_HELP_DIR) dnl Subst PACKAGE_MENU_DIR. NO_PREFIX_PACKAGE_MENU_DIR="${packagemenudir}" AC_SUBST(NO_PREFIX_PACKAGE_MENU_DIR) PACKAGE_MENU_DIR="${packageprefix}/${packagemenudir}" AC_SUBST(PACKAGE_MENU_DIR) dnl AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}") dnl AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}") dnl AC_DEFINE_UNQUOTED(PACKAGE_PIXMAPS_DIR, "${packageprefix}/${packagepixmapsdir}") dnl AC_DEFINE_UNQUOTED(PACKAGE_HELP_DIR, "${packageprefix}/${packagehelpdir}") dnl AC_DEFINE_UNQUOTED(PACKAGE_MENU_DIR, "${packageprefix}/${packagemenudir}") dnl AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}") AC_DEFINE([PACKAGE_DATA_DIR], [share], [Package data dir]) AC_DEFINE([PACKAGE_DOC_DIR], [doc], [Package doc dir]) AC_DEFINE([PACKAGE_HELP_DIR], [doc], [Help]) AC_DEFINE([PACKAGE_MENU_DIR], [], [Menu]) AC_DEFINE([PACKAGE_ICON_DIR], [icons], [Icons]) AC_DEFINE([PACKAGE_SRC_DIR], [src], [Source]) AC_CONFIG_FILES([ Makefile po/Makefile.in src/Makefile icons/Makefile test/Makefile org.nongnu.lingot.desktop ]) AC_OUTPUT lingot-1.0.1/THANKS0000644000175000017500000000052013320113677010641 00000000000000 Thanks to: Niv Sardi (debian package, maintenance and man page). Nicolas Boulenguez (debian package, feedback and code contributions). Matthew Blissett (logo design). Graciano Carrillo (maintenance). Karel Volný (beta testing). All the translators (run 'grep -e ^\"Last-Translator: po/*.po'). lingot-1.0.1/icons/0000755000175000017500000000000013320113727011120 500000000000000lingot-1.0.1/icons/Makefile.am0000644000175000017500000000052413320113677013101 00000000000000## Process this file with automake to produce Makefile.in ## Created by Anjuta - will be overwritten ## If you don't want it to overwrite it, ## Please disable it in the Anjuta project configuration lingot_iconsdir = $(prefix)/@NO_PREFIX_PACKAGE_ICON_DIR@ lingot_icons_DATA = \ org.nongnu.lingot.svg EXTRA_DIST = $(lingot_icons_DATA) lingot-1.0.1/icons/org.nongnu.lingot.svg0000644000175000017500000005256413320113677015166 00000000000000 image/svg+xml Lingot Icon 02/19/2007 Matthew Blissett <tehblunderbuss@gmail.com> GPL 2.0 http://www.nongnu.org/lingot/ http://download.savannah.gnu.org/releases/lingot/lingot-0.7.1.tar.gz The Lingot Development Team This icon was made using all GPL/Public Domain components. Inkscape <http://inkscape.org> Musical note by Nicu Buculei <http://openclipart.org/clipart//recreation/music/musical_note_nicu_bucule_01.svg> Font is admin's handfont2 <http://openfontlibrary.org/?ccm=/media/files/admin/3> lingot-1.0.1/build-aux/0000755000175000017500000000000013320113727011677 500000000000000lingot-1.0.1/build-aux/gitlog-to-changelog0000755000175000017500000003644313320113677015415 00000000000000eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' & eval 'exec perl -wS "$0" $argv:q' if 0; # Convert git log output to ChangeLog format. my $VERSION = '2016-03-22 21:49'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. # Copyright (C) 2008-2017 Free Software Foundation, Inc. # This program 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 3 of the License, or # (at your option) any later version. # This program 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 this program. If not, see . # Written by Jim Meyering use strict; use warnings; use Getopt::Long; use POSIX qw(strftime); (my $ME = $0) =~ s|.*/||; # use File::Coda; # http://meyering.net/code/Coda/ END { defined fileno STDOUT or return; close STDOUT and return; warn "$ME: failed to close standard output: $!\n"; $? ||= 1; } sub usage ($) { my ($exit_code) = @_; my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); if ($exit_code != 0) { print $STREAM "Try '$ME --help' for more information.\n"; } else { print $STREAM < ChangeLog $ME -- -n 5 foo > last-5-commits-to-branch-foo SPECIAL SYNTAX: The following types of strings are interpreted specially when they appear at the beginning of a log message line. They are not copied to the output. Copyright-paperwork-exempt: Yes Append the "(tiny change)" notation to the usual "date name email" ChangeLog header to mark a change that does not require a copyright assignment. Co-authored-by: Joe User List the specified name and email address on a second ChangeLog header, denoting a co-author. Signed-off-by: Joe User These lines are simply elided. In a FILE specified via --amend, comment lines (starting with "#") are ignored. FILE must consist of pairs where SHA is a 40-byte SHA1 (alone on a line) referring to a commit in the current project, and CODE refers to one or more consecutive lines of Perl code. Pairs must be separated by one or more blank line. Here is sample input for use with --amend=FILE, from coreutils: 3a169f4c5d9159283548178668d2fae6fced3030 # fix typo in title: s/all tile types/all file types/ 1379ed974f1fa39b12e2ffab18b3f7a607082202 # Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself. # Change the author to be Paul. Note the escaped "@": s,Jim .*>,Paul Eggert , EOF } exit $exit_code; } # If the string $S is a well-behaved file name, simply return it. # If it contains white space, quotes, etc., quote it, and return the new string. sub shell_quote($) { my ($s) = @_; if ($s =~ m![^\w+/.,-]!) { # Convert each single quote to '\'' $s =~ s/\'/\'\\\'\'/g; # Then single quote the string. $s = "'$s'"; } return $s; } sub quoted_cmd(@) { return join (' ', map {shell_quote $_} @_); } # Parse file F. # Comment lines (starting with "#") are ignored. # F must consist of pairs where SHA is a 40-byte SHA1 # (alone on a line) referring to a commit in the current project, and # CODE refers to one or more consecutive lines of Perl code. # Pairs must be separated by one or more blank line. sub parse_amend_file($) { my ($f) = @_; open F, '<', $f or die "$ME: $f: failed to open for reading: $!\n"; my $fail; my $h = {}; my $in_code = 0; my $sha; while (defined (my $line = )) { $line =~ /^\#/ and next; chomp $line; $line eq '' and $in_code = 0, next; if (!$in_code) { $line =~ /^([0-9a-fA-F]{40})$/ or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"), $fail = 1, next; $sha = lc $1; $in_code = 1; exists $h->{$sha} and (warn "$ME: $f:$.: duplicate SHA1\n"), $fail = 1, next; } else { $h->{$sha} ||= ''; $h->{$sha} .= "$line\n"; } } close F; $fail and exit 1; return $h; } # git_dir_option $SRCDIR # # From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR # is undef). Return as a list (0 or 1 element). sub git_dir_option($) { my ($srcdir) = @_; my @res = (); if (defined $srcdir) { my $qdir = shell_quote $srcdir; my $cmd = "cd $qdir && git rev-parse --show-toplevel"; my $qcmd = shell_quote $cmd; my $git_dir = qx($cmd); defined $git_dir or die "$ME: cannot run $qcmd: $!\n"; $? == 0 or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"; chomp $git_dir; push @res, "--git-dir=$git_dir/.git"; } @res; } { my $since_date; my $until_date; my $format_string = '%s%n%b%n'; my $amend_file; my $append_dot = 0; my $cluster = 1; my $ignore_matching; my $ignore_line; my $strip_tab = 0; my $strip_cherry_pick = 0; my $srcdir; GetOptions ( help => sub { usage 0 }, version => sub { print "$ME version $VERSION\n"; exit }, 'since=s' => \$since_date, 'until=s' => \$until_date, 'format=s' => \$format_string, 'amend=s' => \$amend_file, 'append-dot' => \$append_dot, 'cluster!' => \$cluster, 'ignore-matching=s' => \$ignore_matching, 'ignore-line=s' => \$ignore_line, 'strip-tab' => \$strip_tab, 'strip-cherry-pick' => \$strip_cherry_pick, 'srcdir=s' => \$srcdir, ) or usage 1; defined $since_date and unshift @ARGV, "--since=$since_date"; defined $until_date and unshift @ARGV, "--until=$until_date"; # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/) # that makes a correction in the log or attribution of that commit. my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {}; my @cmd = ('git', git_dir_option $srcdir, qw(log --log-size), '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); open PIPE, '-|', @cmd or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n" . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); my $prev_multi_paragraph; my $prev_date_line = ''; my @prev_coauthors = (); my @skipshas = (); while (1) { defined (my $in = ) or last; $in =~ /^log size (\d+)$/ or die "$ME:$.: Invalid line (expected log size):\n$in"; my $log_nbytes = $1; my $log; my $n_read = read PIPE, $log, $log_nbytes; $n_read == $log_nbytes or die "$ME:$.: unexpected EOF\n"; # Extract leading hash. my ($sha, $rest) = split ':', $log, 2; defined $sha or die "$ME:$.: malformed log entry\n"; $sha =~ /^[0-9a-fA-F]{40}$/ or die "$ME:$.: invalid SHA1: $sha\n"; my $skipflag = 0; if (@skipshas) { foreach(@skipshas) { if ($sha =~ /^$_/) { $skipflag = $_; last; } } } # If this commit's log requires any transformation, do it now. my $code = $amend_code->{$sha}; if (defined $code) { eval 'use Safe'; my $s = new Safe; # Put the unpreprocessed entry into "$_". $_ = $rest; # Let $code operate on it, safely. my $r = $s->reval("$code") or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n"; # Note that we've used this entry. delete $amend_code->{$sha}; # Update $rest upon success. $rest = $_; } # Remove lines inserted by "git cherry-pick". if ($strip_cherry_pick) { $rest =~ s/^\s*Conflicts:\n.*//sm; $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; } my @line = split /[ \t]*\n/, $rest; my $author_line = shift @line; defined $author_line or die "$ME:$.: unexpected EOF\n"; $author_line =~ /^(\d+) (.*>)$/ or die "$ME:$.: Invalid line " . "(expected date/author/email):\n$author_line\n"; # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog # `(tiny change)' annotation. my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line) ? ' (tiny change)' : ''); my $date_line = sprintf "%s %s$tiny\n", strftime ("%Y-%m-%d", localtime ($1)), $2; my @coauthors = grep /^Co-authored-by:.*$/, @line; # Omit meta-data lines we've already interpreted. @line = grep !/^(?:Signed-off-by:[ ].*>$ |Co-authored-by:[ ] |Copyright-paperwork-exempt:[ ] |Tiny-change:[ ] )/x, @line; # Remove leading and trailing blank lines. if (@line) { while ($line[0] =~ /^\s*$/) { shift @line; } while ($line[$#line] =~ /^\s*$/) { pop @line; } } # Handle Emacs gitmerge.el "skipped" commits. # Yes, this should be controlled by an option. So sue me. if ( grep /^(; )?Merge from /, @line ) { my $found = 0; foreach (@line) { if (grep /^The following commit.*skipped:$/, $_) { $found = 1; ## Reset at each merge to reduce chance of false matches. @skipshas = (); next; } if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/) { push ( @skipshas, $1 ); } } } # Ignore commits that match the --ignore-matching pattern, if specified. if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/) { $skipflag = 1; } elsif ($skipflag) { ## Perhaps only warn if a pattern matches more than once? warn "$ME: warning: skipping $sha due to $skipflag\n"; } if (! $skipflag) { if (defined $ignore_line && @line) { @line = grep ! /$ignore_line/, @line; while ($line[$#line] =~ /^\s*$/) { pop @line; } } # Record whether there are two or more paragraphs. my $multi_paragraph = grep /^\s*$/, @line; # Format 'Co-authored-by: A U Thor ' lines in # standard multi-author ChangeLog format. for (@coauthors) { s/^Co-authored-by:\s*/\t /; s/\s*/ or warn "$ME: warning: missing email address for " . substr ($_, 5) . "\n"; } # If clustering of commit messages has been disabled, if this header # would be different from the previous date/name/etc. header, # or if this or the previous entry consists of two or more paragraphs, # then print the header. if ( ! $cluster || $date_line ne $prev_date_line || "@coauthors" ne "@prev_coauthors" || $multi_paragraph || $prev_multi_paragraph) { $prev_date_line eq '' or print "\n"; print $date_line; @coauthors and print join ("\n", @coauthors), "\n"; } $prev_date_line = $date_line; @prev_coauthors = @coauthors; $prev_multi_paragraph = $multi_paragraph; # If there were any lines if (@line == 0) { warn "$ME: warning: empty commit message:\n $date_line\n"; } else { if ($append_dot) { # If the first line of the message has enough room, then if (length $line[0] < 72) { # append a dot if there is no other punctuation or blank # at the end. $line[0] =~ /[[:punct:]\s]$/ or $line[0] .= '.'; } } # Remove one additional leading TAB from each line. $strip_tab and map { s/^\t// } @line; # Prefix each non-empty line with a TAB. @line = map { length $_ ? "\t$_" : '' } @line; print "\n", join ("\n", @line), "\n"; } } defined ($in = ) or last; $in ne "\n" and die "$ME:$.: unexpected line:\n$in"; } close PIPE or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n"; # FIXME-someday: include $PROCESS_STATUS in the diagnostic # Complain about any unused entry in the --amend=F specified file. my $fail = 0; foreach my $sha (keys %$amend_code) { warn "$ME:$amend_file: unused entry: $sha\n"; $fail = 1; } exit $fail; } # Local Variables: # mode: perl # indent-tabs-mode: nil # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "my $VERSION = '" # time-stamp-format: "%:y-%02m-%02d %02H:%02M" # time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: lingot-1.0.1/bootstrap0000755000175000017500000000014013320113677011667 00000000000000#!/bin/sh mkdir -p m4 libtoolize intltoolize aclocal autoheader autoconf automake --add-missing lingot-1.0.1/ChangeLog0000644000175000017500000010134513320113730011475 000000000000002018-07-07 Iban Cereijo Lingot 1.0.1 Fixed problems in the tarball regarding the unit tests. 2018-07-06 Iban Cereijo Preparing release 1.0.0 Makefile: added lingot-resources.c to CLEANFILES 2018-07-05 Iban Cereijo Checking for glib-compile-resources in the configure script. Added bootstrap script. Updated i18n. Glade files are now bundled in GResources. Minor graphic updates. Smaller sleeping time for ALSA, in case we have small buffers. Removed compilation warnings by avoiding rendering to off-screen surfaces. The performance is good and we make less use of dynamic memory. More compliant with libcairo and GTK+ workflow. Removed XMP icon. Updated icon properties. 2018-07-04 Iban Cereijo Renamed pixmaps -> icons and installing in /usr/share/icons/hicolor/ instead of /usr/share/pixmaps, as recommended by the AppStream guidelines in Debian. Added 'check' target to Makefile to pass unit tests. Fixed distcheck target. 2018-07-03 Iban Cereijo Fixed compilation with PulseAudio disabled. 2018-07-03 Iban Cereijo Fixed appdata file. Renamed: lingot.desktop -> org.nongnu.lingot.desktop lingot.appdata.xml -> org.nongnu.lingot.appdata.xml 2018-07-02 Iban Cereijo Added appdata into the dist tarball. Added GNome AppData from file created by Ankur Sinha. 2018-07-01 Iban Cereijo Applied suggestions by Nicolas Boulenguez: removed unused files. 2018-06-30 Iban Cereijo lingot-audio-alsa: non-blocking IO and default buffer size for sv-54209 lingot-audio-alsa: trying non-blocking read for bug sv-54209 Updated NEWS and i18n files. lingot-audio-alsa: fixing slow read from HW devices (bug sv-54209) Updated version number to 1.0.0b1. 2018-06-28 Iban Cereijo Merge pull request #10 from ibancg/patches-nicolas-03 Patches nicolas 03 Revert "Insert lingot_core_[start|stop] into lingot_core_[new|destroy]." This reverts commit 7ebeb306cb9950c71e72214d23d69787f8b6a661. Revert "Separate chebychev filter stuff from memory allocation (new and destroy)." This reverts commit f322ed7c7f04c096bd81e8ecb5ce1262ae324d9b. 2018-06-13 Iban Cereijo Generate ChangeLog from git history. 2018-06-12 Iban Cereijo Corrections after the merge Merge branch 'master' into patches-nicolas-03 2018-06-12 Nicolas Boulenguez Fix various warnings. * Fix two missing #include "lingot-io-config.h". * Remove unused variables. * Make unused but required parameters explicit. * Mark some variables as unsigned, disambiguing some comparisons. Many more should be unsigned, avoiding such risks and implicit conversions. * Style: const static -> static const. * Add some const qualifiers. Fix position of some const qualifiers. const foo * bla: the referenced aera is read-only. foo * const bla: bla always referenc the same writable aera. Really compile with -Wall, add -Wextra. CXXFLAGS affects C++, not C. Remove unneeded LIBFFTW use outside lingot-fft.[ch]. Improve comments for scale allocation. Separate chebychev filter stuff from memory allocation (new and destroy). 2018-06-12 Nicolas Boulenguez Insert lingot_core_[start|stop] into lingot_core_[new|destroy]. These procedures were always called together. This simplifies the interface without changing the behaviour. Remove this block from _stop as it has no use right before _destroy. int spd_size = core->conf.fft_size / 2; memset(core->SPL, 0, spd_size * sizeof(FLT)); core->freq = 0.0; 2018-06-12 Iban Cereijo Updated i18n and added script for generating Changelog * ES and GL translations updated. * Removed other fuzzy translations. * Small corrections. Updated i18n messages. 2018-06-11 Iban Cereijo Extracted load/save operations to lingot-io-config.{c,h} Some other simplifications. Fixing some parameters not being persisted. Merge branch 'master' of github.com:ibancg/lingot Some simplifications. No need to check not null before free() Avoiding some hard-coded values Fixes SIGSEGV 2018-06-10 Iban Cereijo Revert "Applied patches from Nocilas Boulenguez (after converting them to unix format)." This reverts commit f14452c1ffcbfff0a48f62a79aabb22a85d311e0. Fixing unit tests. 2018-06-10 Nicolas Boulenguez Install less documentation, clean more files. INSTALL is of not useful outside the source tree. intltool-*.in were probably installed by error. (is src/lingot-logo.xpm useful?) intltool-*.in and po/Makefile.in.in may be removed by distclean. DISTCLEANFILES only considers files, not directories. In README, tell the user to create m4/, else intltoolize fails. 2018-06-10 Nicolas Boulenguez Declare some parameters const. Avoid dynamic allocation for type LingotConfig. Avoid dynamic allocation for type LingotFFTPlan. 2018-06-10 Nicolas Boulenguez Avoid dynamic allocation for type LingotScale. The pointer type was freed outside lingot-config-scale.c, so the patch should probably be checked. A NULL test is replaced with a readable enumeration. 2018-06-10 Nicolas Boulenguez Avoid dynamic allocation for type LingotCore. Avoid dynamic allocation for type LingotGauge. Avoid dynamic allocation for type LingotFilter. Remove unused _ names for audio handler and audio system properties structs. Document -c option in manual page. 2018-06-10 Iban Cereijo Remove trailing carriage return characters. 2018-06-10 Jairo Chapela-Martínez Applied patches from Nocilas Boulenguez (after converting them to unix format). 2018-06-09 Iban Cereijo Fixes combo boxes formatting drop list at 6 columns. Improved docstrings, code formatting and added unit tests. Fixed wrong frequency/note when setting min/max freqs via GUI. Removed unnecessary runtime messages. 2018-06-08 Iban Cereijo Updated README, with autotools sequence Removed unnecessary files from VCS Removing unnecessary filed from the VCS Updated README file. Changed names in copyright notices. More corrections regarding conditional compilation of audio modules. Fixed compilation when we disable some audio systems. Removed compilation warnings. 2018-06-07 Iban Cereijo Updated copyright notices. Updated NEWS, Changelog and THANKS files. Removing unnecessary files from VCS. Removing unnecessary files from the VCS. Ignoring and removing files from repository. Updating rest of the GUI to GTK+ 3.10 2018-06-06 Iban Cereijo Adapting autotools and main UI window to Gtk 3.1 2018-06-05 Iban Cereijo Merge pull request #2 from ibancg/patches-nicolas Patches nicolas 2018-06-05 Nicolas Boulenguez Add a minimal manual page 2018-06-04 Nicolas Boulenguez Be more strict with optional audio systems. Ensure unselected components are never called by not compiling them. Stop the program with an assertion if the audio_system is invalid or unset when calling a lingot_audio_ routine other than _new. Check overflow in audio system list. Avoid dynamic allocation for sample rates. Allocate read buffer on the stack instead of the heap. In pulseaudio, remove a duplicate computation of size_in_bytes. Avoid dynamic allocation for LingotAudioHandler. Use audio->audio_system==-1 instead of audio==NULL. Update autotool stuff. Autoconf documentation recommends the m4 subdirectory. Intltool documentation recommends DISTCLEANFILES. Avoid dynamic allocation for LingotAudioSystemProperties. This patch simplifies the code and fixes a memory leak (the structs themselves were never deallocated). Description: add GenericName to desktop file Also add keywords. Bug-Debian: https://bugs.debian.org/841756 Author: Petter Reinholdtsen Author: Nicolas Boulenguez Allow compilation with -format-security 2017-02-11 Iban Cereijo Merge pull request #1 from trebmuh/patch-1 Adds a French menu item comment 2017-02-11 Olivier Humbert Adds a French menu item comment 2017-02-10 Iban Cereijo Merge branch 'master' of github.com:ibancg/lingot 2017-02-10 Ibán Cereijo Updated i18n Spanish translation. Fixed SIGABRT when selecting FFT size 256. Fixed i18n issues: default scale strings (among others) are now translatable. Fixed SIGSEGV when introducing empty string editing scale. Fixed several vulnerabilities using sprintf, using snprintf instead (patch by Hamid Zamani). 2013-10-22 Ibán Cereijo Updated i18n Spanish translation. 2013-10-17 Ibán Cereijo Fixed SIGABRT when selecting FFT size 256. Fixed i18n issues: default scale strings (among others) are now translatable. 2013-07-04 Ibán Cereijo Fixed SIGSEGV when introducing empty string editing scale. 2013-07-03 Ibán Cereijo Fixed several vulnerabilities using sprintf, using snprintf instead. 2013-04-12 Ibán Cereijo Added tag 0.9.2b8 for changeset dc8ff59bcf49 Tagging 0.9.2b8 Added tag 0.9.2b8 for changeset f7533d828f93 2013-03-14 Ibán Cereijo Making maximum frequency combobox entry focusable. Updating copyright statement. 2013-03-13 Ibán Cereijo Making input device combobox entry editable. 2013-03-07 Ibán Cereijo Made some config options obsolete. Moving some config parameters to internal config options. Removed old code. Improving layout. 2013-03-06 Ibán Cereijo Added octave combo. Improved tooltips. Making some config options deprecated. 2013-03-03 Ibán Cereijo Removing unused code. 2013-03-02 Ibán Cereijo Using "optimize internal parameters" check button. Removing old code. 2013-02-13 Ibán Cereijo Changed lingot_config parameter specs. Using CUnit. Fixed bug in lingot_config_scale_get_closest_note 2013-02-12 Ibán Cereijo Modifying tests. Fixed bug in lingot-core (frequencies_related function). Implementing frequency range controls. Fixed problem in scale::closest_index (now encapsulated in lingot_config_scale). 2013-02-11 Ibán Cereijo Populating frequency response combos. Implementing minimum_frequency and maximum_frequency items. 2013-02-09 Ibán Cereijo Small changes before modifying the GUI. 2013-02-07 Ibán Cereijo More robust to little/big endian changes. Supported float sample formats with ALSA and PulseAudio. OSS support can be now enabled from the configuration script. Supported float sample formats in ALSA. Made OSS code conditional. Organized code in lingot-audio module. Dev commit: detected sound wrap problem. 2013-02-06 Ibán Cereijo Dev commit imlpementing the PulseAudio sample rate estimator. 2013-02-05 Ibán Cereijo Default audio system is now configurable. Passing pa_buffer_attr to PulseAudio. Adding checks to configure. 2013-02-04 Ibán Cereijo Using 44100 Hz as the default frequency again. Recovered final iteration over the whole temporal buffer (optional). better audio buffers sizing up. 2013-02-02 Ibán Cereijo Added tag 0.9.2b7 for changeset 6a94e99da837 Updated translations. Added tag 0.9.2b7 for changeset 8965bc764429 New Czech translation and typo fixed by Karel Voln?. Added tag 0.9.2b7 for changeset 26c16f50a9de New beta version. Trying final NR iteration over the windowed FFT-sized temporal buffer instead of the whole temporal buffer. Good response. Recovered some old signal processing functions for comparison purposes. 2013-01-29 Ibán Cereijo Added tag 0.9.2b6 for changeset b42c5ce0fdda Improved frequency locker and tuned parameters. Changed default sample frequency to 48000. 2013-01-28 Ibán Cereijo Removing obsolete parameters. 2013-01-27 Ibán Cereijo Fixed compilation problems when disabling some components in configure script. Implementing frequency locker. Implementing frequency locker. 2013-01-24 Ibán Cereijo TODO on tolerance. Fixed bug reading FFT size. Implemented median filter for noise. Added a maximum frequency parameter. 2013-01-23 Ibán Cereijo Removing obsolete code. Replaced moving average filter using lingot_filter module. Using cairo_clip to bound the spectrum drawing area. 2013-01-22 Ibán Cereijo cairo drawing optimized. Using background cairo surfaces. Optimizing spectrum drawing. 2013-01-21 Ibán Cereijo Migration to libcairo almost finished. 2013-01-17 Ibán Cereijo Fixed aspect ratio for the main window. Starting to write the spectrum with vector graphics. 2013-01-16 Ibán Cereijo Populating FFT combo. Configuring resize properties. 2013-01-14 Ibán Cereijo First version running with gtk-3.0. Changed gauge design. 2013-01-13 Ibán Cereijo Adding functions to LingotConfigScale. 2013-01-12 Ibán Cereijo Migrating drawing to libcairo. Converted GUI to GTK+ 2.24 (GtkBuilder format). 2013-01-11 Ibán Cereijo Migrating to GTK+ 2.24 as a transition to GTK+3 2013-01-10 Ibán Cereijo Modified frequency finding algorithm. Suppressed warnings. 2013-01-08 Ibán Cereijo Modified LingotComplex to make it compatible with fftw_complex. Started implementing (second) Quinn's FFT-bin interpolator. 2013-01-07 Ibán Cereijo Implemented moving average filter for computing noise level. Implemented moving average filter for computing noise level. Added some 'const'. 2013-01-06 Ibán Cereijo Updated copyright year. Adding unit tests. Removed unused variables in lingot-config. Reading double parameters instead of float from config files. Adding unit tests. 2012-01-02 Ibán Cereijo Fixed #35222 ChangeLog modified. Fixed #35220, #35221 2011-12-28 Ibán Cereijo Fixing bug #35183 2011-12-27 Ibán Cereijo Fixing bug #35183 2011-12-10 Ibán Cereijo Added italian translation by Stefano Cereda. 2011-12-07 Ibán Cereijo Encapsulating FFT code inside lingot-fft module. 2011-12-05 Ibán Cereijo Merge with d142716d8ed9f37aab7a17f389e82efbd5c7b4ab Minor changes to LingotComplex struct to recover the original performance in FFT computation. 2011-11-30 Ibán Cereijo Next development iteration. Added tag 0.9.2b2 for changeset 3737b685e996 minor changes Added tag 0.9.2b2 for changeset 229b50fb6fe1 Fixed SIGSEGV when there's no scale in config file (thanks to Karel Voln?). Changed some i18n msgid's. 2011-11-29 Ibán Cereijo Next development iteration. Added tag 0.9.2b1 for changeset d295ed3e157a changes after distribution check fail Added tag 0.9.2b1 for changeset 43f0b7248225 Fixed some i18n msgid's Added year of translation to translator-credits in .po files. Allowed to select JACK port. array resize. i18n 2011-11-28 Ibán Cereijo Fixed some i18n msgid's Fixed some i18n msgid's Config validation from GUI. Enhanced some error messages. Implemented task #10683: config file validation. 2011-11-25 Ibán Cereijo little optimization creating libfftw plan. Added libfftw support. The audio system combobox shows only the available options. Fixed compilation without PulseAudio problem. 2011-11-24 Ibán Cereijo Autodetection of PulseAudio sources. Added units to the config file. 2011-11-23 Ibán Cereijo removed cancel option from lingot-audio. Added PulseAudio support with simple API. Adding PulseAudio support. Added a watchdog timer for thread cancellation in lingot-audio. Added PulseAudio to autotools scripts. 2011-11-22 Ibán Cereijo Fixed potential problem in ALSA and OSS when read function captures less samples than the desired amount. 2011-11-21 Ibán Cereijo Adding PulseAudio support. Flickering avoided. Adding PulseAudio support. Adding PulseAudio support. ALSA cards autodetection. 2011-09-27 Ibán Cereijo Fixed bug #643435 in debian: error: format not a string literal and no format arguments [-Werror=format-security] Removed compilation warning [-Wunused-but-set-variable] 2011-08-22 Ibán Cereijo Merge with d83f8fa6259a033b1c4d0c20bc4fe84cfa9cfae6 Next development iteration Added tag 0.9.1 for changeset 965cb55636a4 released lingot 0.9.1 2011-08-13 Ibán Cereijo Adding configure script to the repository. Adding configure script to the repository. Adding configure script to the repository. Adding configure script to the repository. Adding configure script to the repository. Adding configure script to the repository. Adding configure script to the repository. Fixed bug #34007. Avoiding some warnings. Sgtarting implementing function for audio card autodetection. 2011-04-13 Ibán Cereijo Added 48K sample rate in OSS and ALSA. Merge with 25f0bfcc0df4787a8d2debfccaeeb2feaff00587 Added 48K sample rate in OSS and ALSA. 2011-04-11 Ibán Cereijo Removed some output messages. Fixed bug #33046 (#622038 in debian) 2011-02-22 Ibán Cereijo Adding lingot.pot in the distribution files. Adding lingot.pot in the distribution files. Next development iteration. 2011-02-21 Ibán Cereijo Added tag v0_9_0 for changeset 7b0bfde34c3f Preparing release. Preparing release. Added Galician translation. Added Spanish translation. Using the i18 _() macro for externalizing strings. Added error messages when reading config files. 2011-02-20 Ibán Cereijo Configuration file load and save options from the GUI. Added copyright section. Applied a blur filter on background image. 2011-02-19 Ibán Cereijo The mainframe is now created using libglade. 2011-02-18 Ibán Cereijo Renamed lingot-error to lingot-msg. Implemented the message queue as a FIFO queue. Reformatted error messages from ALSA and OSS. Removed shutdown callbacks. Fixed compilation problem when either ALSA or JACK are not present. The JACK client doesn't loose the status anymore when we press the 'Apply' button. 2011-02-17 Ibán Cereijo Improved scale validation. Moved scales code to lingot-config-scale.{c,h}. lingot-error supports now different type of messages Moved GUI files under prefix lingot-gui (including function names). Moved scales code to lingot-config-scale.{c,h}. Supported fractional format in scale note shift in the config file. Renamed 'pitch' column to 'shift' in the scale table. Added tooltips. Added DEL and INS key bindings to the scale tree view 2011-02-16 Ibán Cereijo Tooltip correction New window type: Hanning. Reactivated Hamming window. Added tooltips to the configuration dialog. The hamming window has been disabled. Implemented scale table in a different file. Updates copyright year to 2011. Removed warnings. 2011-02-15 Ibán Cereijo merge merge Merge with 315755d3d97922b6733791f1b2e6b0cc37a5cc10 Fixed bug 31532 using the patch by Ruslans Tarasovs 2010-12-11 Jairo Chapela-Martínez Updating! Added French translation. 2010-12-10 Ibán Cereijo Updated brasilian portuguese translation by Carlos Lau? 2010-11-25 Jairo Chapela-Martínez Added French translation. 2010-10-25 Ibán Cereijo Added tag v0_8_2b4 for changeset c97212da48e2 new beta version 0.8.2b4 avoiding global variables 2010-10-21 Ibán Cereijo Added tag v0_8_2b3 for changeset 3b22ab4d95c3 * Added sync between computation and read threads over the temporal buffer. * The deviation value didn't work in version 0.8.2b2. * Released Lingot 0.8.2b3. 2010-10-19 Ibán Cereijo avoiding deadlocks Adding eclipse IDE files Added tag v0_8_2b2 for changeset 77c461b4c32a upgrading beta version Added tag v0_8_2b2 for changeset 0d326f090d45 Fixed bug #31369 )https://savannah.nongnu.org/bugs/?31369 Audio API is now transparent, providing the read thread. Improved error messages from audio device issues. Added tag v0_8_2b1 for changeset a20fc71449ac 2010-10-18 Ibán Cereijo (no commit message) 2010-10-15 Ibán Cereijo added Scala project URL in the Changelog file 2010-10-14 Ibán Cereijo * Added different scales support. + Scale edition in a cell table. + Importation of Scala .scl files. + The gauge adapts its range to the scale. + The deviation control has been moved to the scale tab. * The sample rate control has been changed to a GtkComboBoxEntry. * When the sample rate is not available, the user is notified. * Corrected some minor errors opening audio devices. * Improved OSS error messages. * Minor changes in the capture tab in the config dialog. * lingot-error now supports multiple messages in the queue. * Added some macros to simulate try/catch. Used in audio handling. * The error dispatcher runs now under his own timer. 2010-03-17 Ibán Cereijo Added tag v0_8_1 for changeset c999303635a1 preparing release 0.8.1 preparing release 0.8.1 2010-03-15 Ibán Cereijo Added tag v0_8_1b2 for changeset 1928af814b49 trying to solve bug #29091 2010-03-14 Ibán Cereijo trying to solve bug #29091 added graphical controller for MIN_FREQUENCY parameter trying to solve bug #29091 added graphical controller for MIN_FREQUENCY parameter 2010-03-07 Ibán Cereijo Added tag v0_8_1b1 for changeset 2e262769e61d new version 0.8.1 beta 1 fixed SIGSEV in JACK read thread 2010-03-03 Ibán Cereijo Added tag v0_8_0 for changeset 570eabc9f1a8 preparing release 0.8.0 (no commit message) preparing release 0.8.0 removing files from repository (no commit message) 2009-06-04 convert-repo update tags 2009-06-04 Ibán Cereijo fixed some memory leaks and a SIGSEGV 2009-03-28 Ibán Cereijo preparing release preparing release preparing release 2009-03-21 Ibán Cereijo minor graphical enhancements Changes in i18n files minor graphical enhancements default sample rate set to 44100 unused code dropped config dialog is non modal now jack server mustn't be launched 2009-01-25 Ibán Cereijo some SIGSEGV fixed 2009-01-06 Ibán Cereijo SIGSEGV fixed adding jack support. config dialog redesign, using glade. adding jack support. config dialog redesign, using glade. adding jack support. config dialog redesign, using glade. adding jack support. config dialog redesign, using glade. adding jack support. config dialog redesign, using glade. adding jack support. config dialog redesign, using glade. 2009-01-05 Ibán Cereijo adding jack support. config dialog redesign, using glade. adding jack support. config dialog redesing, using glade. 2008-07-28 Ibán Cereijo updated italian translation by Stefano Cereda 2008-07-27 Ibán Cereijo Added italian translation 2008-06-24 Ibán Cereijo following recommendations of John Gustafsson about some labels deprecated configuration parameters support *** empty log message *** Added Portuguese translation by Carlos Lau? Added Polish translation by Piotr Paw?ow Change to 0.7.7b3 2008-06-21 Ibán Cereijo configuration saving fix for locales having character other than "." as the radix character (by Piotr Pawlow) update-po memory leak fix (thanks to Piotr Pawlow and Carlos Lau?) 2008-05-30 Jairo Chapela-Martínez Added Czech translation (thanks to Karel Voln?) 2008-03-06 Ibán Cereijo some corrections by John Gustafsson 2008-02-20 Ibán Cereijo Added Swedish translation by John Gustafsson 2008-01-12 Ibán Cereijo German translation by Roland Stigge 2008-01-03 Jairo Chapela-Martínez Regenerating build scripts Removing unnecessary files. Changing version number to 0.7.7b1 2007-12-27 Jairo Chapela-Martínez Fixed some strange issues in the configuration scripts 2007-12-23 Ibán Cereijo v0_7_6 v0_7_6b3 v0_7_6b2 applied patch sent by Niv Sardi: 01-lingot-menu: Pone lingot en el menu "Audio" y no en "Applications". 2007-12-22 Ibán Cereijo *** empty log message *** 2007-12-19 Ibán Cereijo fixed bug #21850 2007-12-18 Ibán Cereijo *** empty log message *** preparing translations lingot 0.7.5 ready to release 2007-12-16 Ibán Cereijo hamming window 2007-11-26 Ibán Cereijo back to version 0.7.5b3 2007-10-31 Ibán Cereijo using pango markup language for note label Using GLIB timeout API instead of deprecated GTK one. Due to this, the SIGSEGV bug at exit seem to be fixed (???) 2007-10-24 Ibán Cereijo *** empty log message *** *** empty log message *** 2007-10-23 Ibán Cereijo *** empty log message *** 2007-10-18 Ibán Cereijo *** empty log message *** 2007-10-16 Ibán Cereijo version 0.7.5 2007-10-15 Ibán Cereijo fixed cheby filter bug reduced logo *** empty log message *** 2007-09-20 Ibán Cereijo Chebyshev LP filters builtin design 2007-08-30 Ibán Cereijo lingot 0.7.5b2 2007-08-28 Jairo Chapela-Martínez First attempt on adding ALSA support. 2007-08-26 Ibán Cereijo *** empty log message *** forgot add those files from C++ to C 2007-08-23 Ibán Cereijo version 0.7.4 2007-07-02 Ibán Cereijo version 0.7.3 *** empty log message *** *** empty log message *** *** empty log message *** 2007-03-16 Jairo Chapela-Martínez 0.7.2 release, now with i18n 2007-02-26 Jairo Chapela-Martínez i18n: first attempt 2007-01-29 Jairo Chapela-Martínez *** empty log message *** 2007-01-28 Ibán Cereijo Segmentation fault bug fixed 2007-01-28 Jairo Chapela-Martínez The Makefile mistn't be distributed -- it must be generated by configure. Some minor changes. I18n Anjutized. Anjutized. locura Initial revision brau Anjutized 2006-08-28 Ibán Cereijo license 2006-08-27 Ibán Cereijo refactor 2006-08-25 Ibán Cereijo refactoring: encapsulation refactoring: encapsulation 2006-08-24 Ibán Cereijo enable quick messages using gtk timers renamed "Filter" class to "IIR" compilation under freebsd patch by Niv utf-8 renamed "Filter" class to "IIR" to avoid collision with libsndobj 2006-08-20 Jairo Chapela-Martínez Oh! My email. :) 2006-07-17 Ibán Cereijo testing gtk timeouts instead event scheduler 2006-06-12 Ibán Cereijo config.status, config.log deletion rule in Makefile.in 2006-05-01 Ibán Cereijo changed version number to 0.6.2 fixed DESTDIR problem (patch reported by Jamin W. Collins) changed copyright year to 2006 new version 0.6.2 2006-04-10 Ibán Cereijo solved seg fault bug 2006-04-07 Jairo Chapela-Martínez Successless search of the bug source. :( Increased text size for the note label. 2006-04-06 Ibán Cereijo move to gtk-2.0 and debian-compliant Makefile patch by Niv Altivanik move to gtk2.0 patch by Sardi Altivanik 2005-10-23 Ibán Cereijo added specification of the new parameter MIN_FREQUENCY 2005-10-22 Ibán Cereijo var name refactor nuevo par?metro MIN_FREQUENCY 2005-10-20 Ibán Cereijo warning solved 2005-09-07 Ibán Cereijo email address changed 2005-07-30 Ibán Cereijo debug option disabled 2005-07-29 Ibán Cereijo *** empty log message *** *** empty log message *** 2005-07-28 Ibán Cereijo *** empty log message *** *** empty log message *** peak coupling improved & more iCVS: ---------------------------------------------------------------------- peak coupling algorithm improved 2005-07-25 Ibán Cereijo lingot 0.6.1 lingot 0.6.1 english translation 2005-07-22 Ibán Cereijo Modified file names *** empty log message *** 2005-04-08 Ibán Cereijo Cambio direcci??n de correo 2005-01-28 Jairo Chapela-Martínez two lil' things in the readme files 2004-12-25 Ibán Cereijo *** empty log message *** *** empty log message *** 2004-12-13 Ibán Cereijo Traducci?n al ingl?s de los mensajes de error. 2004-12-13 Jairo Chapela-Martínez LINGOT 0.6.0 lingot-1.0.1/lingot.10000644000175000017500000000152013320113677011305 00000000000000.TH LINGOT 1 "August 11, 2006" .\" .SH NAME lingot \- accurate and easy to use musical instrument tuner .\" .SH SYNOPSIS .B lingot .RB [\| \-\c .IR config \|] .\" .SH DESCRIPTION .B lingot is a musical instrument tuner. It's accurate, easy to use, and highly configurable. Originally conceived to tune electric guitars, it can now be used to tune any instrument. .\" .SH OPTIONS Configuration is done through the graphical user interface, then saved and loaded from a configuration file. .TP .BI \-c\ file Use this configuration file rather than the default .IR ~/.lingot/lingot.conf . .\" .SH AUTHOR .B lingot was written by .B Iban Cereijo <\&ibancg@gmail.com\&> and .B Jairo Chapela <\&jairochapela@gmail.com\&>. .PP This manual page was written by .B Niv Sardi <\&xaiki+deb@cxhome.ath.cx\&> for the Debian project (but may be used by others). lingot-1.0.1/AUTHORS0000644000175000017500000000011513320113677010776 00000000000000Iban Cereijo Jairo Chapela lingot-1.0.1/Makefile.am0000644000175000017500000000261013320113677011764 00000000000000## Process this file with automake to produce Makefile.in ## Created by Anjuta - will be overwritten ## If you don't want it to overwrite it, ## Please disable it in the Anjuta project configuration SUBDIRS = po src icons test ACLOCAL_AMFLAGS = -I m4 lingotdocdir = ${docdir} lingotdoc_DATA = \ README \ COPYING \ AUTHORS \ ChangeLog \ NEWS \ THANKS DISTCLEANFILES = \ intltool-extract.in \ intltool-extract \ intltool-merge.in \ intltool-merge \ intltool-update.in \ intltool-update \ intl/* \ m4/* \ po/Makefile.in.in gnomemenudir = $(prefix)/@NO_PREFIX_PACKAGE_MENU_DIR@ gnomemenu_DATA = org.nongnu.lingot.desktop appdatadir = $(datadir)/metainfo appdata_DATA = org.nongnu.lingot.appdata.xml dist_man_MANS = lingot.1 EXTRA_DIST = \ $(lingotdoc_DATA) \ $(appdata_DATA) \ build-aux/gitlog-to-changelog \ bootstrap dist-hook: gen-ChangeLog copy-SpecFiles # Creates the ChangeLog from the git history. Extracted from GNU Hello .PHONY: gen-ChangeLog gen-ChangeLog: chmod u+w ${distdir}/ChangeLog # to pass distcheck $(top_srcdir)/build-aux/gitlog-to-changelog > $(distdir)/ChangeLog # Copy all the spec files. Of course, only one is actually used. copy-SpecFiles: $(MAKE) -C "$(srcdir)/po" "$(GETTEXT_PACKAGE).pot" cp "$(srcdir)/po/$(GETTEXT_PACKAGE).pot" "$(distdir)/po/" for specfile in *.spec; do \ if test -f $$specfile; then \ cp -p $$specfile $(distdir); \ fi \ done lingot-1.0.1/src/0000755000175000017500000000000013320113727010574 500000000000000lingot-1.0.1/src/lingot-gui-config-dialog.glade0000644000175000017500000014656413320113677016314 00000000000000 1 30 25.199999999999999 1 1 10 1 1 10 4 100 4 1 10 10 1 10 -500 500 1 10 -1 8 1 10 1 40 25 3 40 20 1 10 -90 90 27.699999999999999 0.10000000000000001 15 0.32000000000000001 0.01 True False 5 lingot configuration center-always normal True False vertical 2 True False end Default True True True Resets the built-in settings, without applying them. False False 0 gtk-apply True True True Applies the current changes to the running tuner, but doesn't modify the configuration file. Any applied changes can be rolled back pressing Cancel. True False False 1 gtk-ok True True True Applies the current changes and modifies the congifuration file. True False False 2 gtk-cancel True True True Rolls back all the previous applied changes and closes the configuration dialog. True False False 3 False True end 0 True True True False 10 10 10 10 True False 15 True Audio system 0 1 True False 15 Audio device 0 2 True False True Here you can pick the sound system. Here you can pick the sound system. True 1 1 True False True Choose the audio device if you have more than one. If you are using JACK, you can also connect Lingot to a desired source with an external JACK control application. Choose the audio device if you have more than one. If you are using JACK, you can also connect Lingot to a desired source with an external JACK control application. True True 1 2 True False 10 5 Select the audio source: 0 0 0 2 False True False Audio input settings. Select here the audio source. Capture False True False 10 True 10 10 True False 15 True Calculation rate 0 1 True False True Hz 2 1 True False Hz 2 2 True False 15 Visualization rate 0 2 True False 15 Minimum SNR 0 4 True False dB 2 4 True False 15 Adjust the following refresh rates: 0 0 0 3 True False 30 Adjust the noise level: 0 0 3 3 True True True Minimum signal-to-noise ratio to consider the captured signal as something relevant. Try to keep this level low, and raise it if you experience problems in very noisy environments. This level is depicted in the spectrum area as a yellow dotted line. Minimum signal-to-noise ratio to consider the captured signal as something relevant. Try to keep this level low, and raise it if you experience problems in very noisy environments. This level is depicted in the spectrum area as a yellow dotted line. adjustment3 on 1 1 4 True True True Number of visualizations per second of the (last) computed frequency, error and spectrum. Number of visualizations per second of the (last) computed frequency, error and spectrum. adjustment2 1 1 2 100 True True True Number of calculations of the fundamental frequency per second. Number of calculations of the fundamental frequency per second. True adjustment1 1 1 1 1 True False Quick adjustments on the dynamic response and the signal levels. Adjustments 1 False True False 10 10 10 True False 15 Temporal window 0 5 True True True This is the most recent amount of data considered for tuning. The longer it is, the more accuracy you can obtain, but also the dynamic response gets slower, regarding you are considering older parts of the signal. Also, if you raise this parameter, the computational cost increases. The size of the buffer, in samples (depending on the effective sample rate), must be greater than or equal to the FFT buffer size. This is the most recent amount of data considered for tuning. The longer it is, the more accuracy you can obtain, but also the dynamic response gets slower, regarding you are considering older parts of the signal. Also, if you raise this parameter, the computational cost increases. The size of the buffer, in samples (depending on the effective sample rate), must be greater than or equal to the FFT buffer size. 1 False False adjustment5 3 1 5 True False seconds 2 5 True False samples 2 4 True False 15 FFT size 0 4 True False True The FFT buffer gives Lingot a first look to the spectrum. Higher values can help Lingot to hook up the correct peak, but it&apos;s also computationally more expensive. Don&apos;t use high values here unless you need to tune high frequencies. The FFT buffer gives Lingot a first look to the spectrum. Higher values can help Lingot to hook up the correct peak, but it's also computationally more expensive. Don't use high values here unless you need to tune high frequencies. True 256 512 1024 2048 4096 1 4 Optimize parameters automatically True True False True Leave this option ON and Lingot will optimize some parameters for you. Leave this option ON and Lingot will optimize some parameters for you. start 10 True 0 3 3 True False 15 True Minimum note 0 1 True False 15 Maximum note 0 2 True True True True True True This is the lowest frequency you want to tune in this instrument. You can put here either a frequency or select a note from the popup list. This is the lowest frequency you want to tune in this instrument. You can put here either a frequency or select a note from the popup list. 1 1 True False 4 True True 1 2 True False True Hz 2 1 True False 10 Intrument frequency range 0 0 0 3 True False Hz 2 2 2 True False Basic settings on the frequency finding algorithm. Come here to get better accuracy, frequency range or CPU usage. Settings 2 False True False True False True 10 10 10 True False False Name 0.47999998927116394 0 0 True True True Scale name, only for your information. Scale name, only for your information. True False False 1 0 4 True False cents 2 1 True True True Applies a shift in frequency to all the notes defined in the table below. Applies a shift in frequency to all the notes defined in the table below. 1 False False adjustment13 1 1 True False 10 Deviation 0 1 True False Octave 3 1 True False True Octave whose frequencies are being displayed in the table below. Change this parameter if you want to display the assigned frequencies in other octaves, but try to assign the frequencies always to the 4th octave (The 4th octave usually covers the frequencies from 261.63 Hz to 523.25 Hz). Octave whose frequencies are being displayed in the table below. Change this parameter if you want to display the assigned frequencies in other octaves, but try to assign the frequencies always to the 4th octave (The 4th octave usually covers the frequencies from 261.63 Hz to 523.25 Hz). 0 0 1 2 3 4 5 6 4 1 0 0 True False True 260 True True True True 6 never out 0 0 True False 6 vertical True False vertical 4 Insert True True True True Adds a new note to the list, just above the selected line, or appends it to the end if no line is selected. Is not possible to add a note before the reference (the first) one. You can also use the Insert key on the table beside. Adds a new note to the list, just above the selected line, or appends it to the end if no line is selected. Is not possible to add a note before the reference (the first) one. You can also use the Insert key on the table beside. False False 0 Delete True True True True Deletes the selected notes. The reference note, i.e., the first one, cannot be removed. You can also use the Delete key on the table beside. Deletes the selected notes. The reference note, i.e., the first one, cannot be removed. You can also use the Delete key on the table beside. False False 1 Import True True True True Imports the scale from an external .scl file, with the Scala project format (http://www.huygens-fokker.org/scala/) Imports the scale from an external .scl file, with the Scala project format (http://www.huygens-fokker.org/scala/) False False 2 False True 0 1 0 0 1 3 True False Lingot is an universal tuner, it can tune any instrument according to the scale you define here. Scale 3 False True True 1 button_default button_apply button_accept button_cancel 1 120 1 1 10 22050 1 50 29.199999999999999 1 1 5 1 1 10 lingot-1.0.1/src/lingot-signal.h0000644000175000017500000000316513320113677013445 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_SIGNAL_H__ #define __LINGOT_SIGNAL_H__ /* peak identification functions. */ #include "lingot-defs.h" #include "lingot-config.h" #include "lingot-complex.h" #include "lingot-core.h" FLT lingot_signal_estimate_fundamental_frequency(const FLT* snr, FLT freq, const LingotComplex* fft, unsigned int N, unsigned int n_peaks, unsigned int lowest_index, unsigned int highest_index, unsigned short peak_half_width, FLT delta_f_fft, FLT min_snr, FLT min_q, FLT min_freq, LingotCore* core, short* divisor); void lingot_signal_compute_noise_level(const FLT* spd, int N, int cbuffer_size, FLT* noise_level); // generates a Hamming window of N samples void lingot_signal_window(int N, FLT* out, window_type_t window_type); #endif /*__LINGOT_SIGNAL_H__*/ lingot-1.0.1/src/lingot-filter.c0000644000175000017500000001235513320113677013451 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "lingot-complex.h" #include "lingot-filter.h" #define max(a,b) (((a)<(b))?(b):(a)) // given each polynomial order and coefs, with optional initial status. void lingot_filter_new(LingotFilter* filter, unsigned int Na, unsigned int Nb, const FLT* a, const FLT* b) { unsigned int i; filter->N = max(Na, Nb); filter->a = malloc((filter->N + 1) * sizeof(FLT)); filter->b = malloc((filter->N + 1) * sizeof(FLT)); filter->s = malloc((filter->N + 1) * sizeof(FLT)); for (i = 0; i <= filter->N; i++) { filter->a[i] = 0.0; filter->b[i] = 0.0; filter->s[i] = 0.0; } memcpy(filter->a, a, (Na + 1) * sizeof(FLT)); memcpy(filter->b, b, (Nb + 1) * sizeof(FLT)); for (i = 0; i <= filter->N; i++) { filter->a[i] /= a[0]; // polynomial normalization. filter->b[i] /= a[0]; } } void lingot_filter_reset(LingotFilter* filter) { unsigned int i; for (i = 0; i <= filter->N; i++) { filter->s[i] = 0.0; } } void lingot_filter_destroy(LingotFilter* filter) { free(filter->a); free(filter->b); free(filter->s); } // Digital Filter Implementation II, in & out can overlap. void lingot_filter_filter(LingotFilter* filter, unsigned int n, const FLT* in, FLT* out) { FLT w, y; register unsigned int i; register int j; for (i = 0; i < n; i++) { w = in[i]; y = 0.0; for (j = filter->N - 1; j >= 0; j--) { w -= filter->a[j + 1] * filter->s[j]; y += filter->b[j + 1] * filter->s[j]; filter->s[j + 1] = filter->s[j]; } y += w * filter->b[0]; filter->s[0] = w; out[i] = y; } } // single sample filtering FLT lingot_filter_filter_sample(LingotFilter* filter, FLT in) { FLT result; lingot_filter_filter(filter, 1, &in, &result); return result; } // vector prod void lingot_filter_vector_product(int n, LingotComplex* vector, LingotComplex result) { register int i; LingotComplex aux1; result[0] = 1.0; result[1] = 0.0; for (i = 0; i < n; i++) { aux1[0] = -vector[i][0]; aux1[1] = -vector[i][1]; lingot_complex_mul_by(result, aux1); } } // Chebyshev filters void lingot_filter_cheby_design(LingotFilter* filter, unsigned int n, FLT Rp, FLT wc) { unsigned int i; // loops unsigned int k; unsigned int p; FLT a[n + 1]; FLT b[n + 1]; FLT new_a[n + 1]; FLT new_b[n + 1]; // locate poles LingotComplex pole[n]; for (i = 0; i < n; i++) { pole[i][0] = 0.0; pole[i][1] = 0.0; } FLT T = 2.0; // 2Hz FLT W = 2.0 / T * tan(M_PI * wc / T); FLT epsilon = sqrt(pow(10.0, 0.1 * Rp) - 1); FLT v0 = asinh(1 / epsilon) / n; FLT sv0 = sinh(v0); FLT cv0 = cosh(v0); FLT t; for (i = -(n - 1), k = 0; k < n; i += 2, k++) { t = M_PI * i / (2.0 * n); pole[k][0] = -sv0 * cos(t); pole[k][1] = cv0 * sin(t); } LingotComplex gain; lingot_filter_vector_product(n, pole, gain); if ((n & 1) == 0) { // even FLT f = pow(10.0, -0.05 * Rp); gain[0] *= f; gain[1] *= f; } FLT f = pow(W, n); gain[0] *= f; gain[1] *= f; for (i = 0; i < n; i++) { pole[i][0] *= W; pole[i][1] *= W; } // bilinear transform LingotComplex sp[n]; for (i = 0; i < n; i++) { sp[i][0] = (2.0 - pole[i][0] * T) / T; sp[i][1] = (0.0 - pole[i][1] * T) / T; } LingotComplex tmp1; LingotComplex aux2; lingot_filter_vector_product(n, sp, tmp1); lingot_complex_div_by(gain, tmp1); for (i = 0; i < n; i++) { tmp1[0] = (2.0 + pole[i][0] * T); tmp1[1] = (0.0 + pole[i][1] * T); aux2[0] = (2.0 - pole[i][0] * T); aux2[1] = (0.0 - pole[i][1] * T); lingot_complex_div(tmp1, aux2, pole[i]); } // compute filter coefficients from pole/zero values a[0] = 1.0; b[0] = 1.0; new_a[0] = 1.0; new_b[0] = 1.0; for (i = 1; i <= n; i++) { a[i] = 0.0; b[i] = 0.0; new_a[i] = 0.0; new_b[i] = 0.0; } if (n & 1) { // odd // first subfilter is first order a[1] = -pole[n / 2][0]; b[1] = 1.0; } // iterate over the conjugate pairs for (p = 0; p < n / 2; p++) { FLT b1 = 2.0; FLT b2 = 1.0; FLT a1 = -2.0 * pole[p][0]; FLT a2 = pole[p][0] * pole[p][0] + pole[p][1] * pole[p][1]; // 2nd order subfilter per each pair new_a[1] = a[1] + a1 * a[0]; new_b[1] = b[1] + b1 * b[0]; // poly multiplication for (i = 2; i <= n; i++) { new_a[i] = a[i] + a1 * a[i - 1] + a2 * a[i - 2]; new_b[i] = b[i] + b1 * b[i - 1] + b2 * b[i - 2]; } for (i = 1; i <= n; i++) { a[i] = new_a[i]; b[i] = new_b[i]; } } gain[0] = fabs(gain[0]); for (i = 0; i <= n; i++) { b[i] *= gain[0]; } lingot_filter_new(filter, n, n, a, b); } lingot-1.0.1/src/lingot-msg.c0000644000175000017500000000533413320113677012751 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "lingot-msg.h" #define MAX_MESSAGES 5 char message[MAX_MESSAGES][1000]; message_type_t message_type[MAX_MESSAGES]; int error_codes[MAX_MESSAGES]; int front = 0, rear = 0; pthread_mutex_t message_queue_mutex = PTHREAD_MUTEX_INITIALIZER; void lingot_msg_add_error(const char* msg) { lingot_msg_add(msg, ERROR, 0); } void lingot_msg_add_error_with_code(const char* msg, int error_code) { lingot_msg_add(msg, ERROR, error_code); } void lingot_msg_add_warning(const char* msg) { lingot_msg_add(msg, WARNING, 0); } void lingot_msg_add_info(const char* msg) { lingot_msg_add(msg, INFO, 0); } void lingot_msg_add(const char* msg, message_type_t type, int error_code) { pthread_mutex_lock(&message_queue_mutex); if (front == ((rear + 1) % MAX_MESSAGES)) { fprintf(stderr, "warning: the messages queue is full!\n"); } else { // check if the message is already in the queue int duplicated = 0; int i = front; while (i != rear) { i = (i + 1) % MAX_MESSAGES; if (!strcmp(message[i], msg)) { duplicated = 1; fprintf(stderr, "warning: duplicated message: %s\n", msg); break; } } if (!duplicated) { rear = ((rear + 1) % MAX_MESSAGES); strcpy(message[rear], msg); message_type[rear] = type; error_codes[rear] = error_code; if (type != INFO) { fprintf(stderr, "%s: %s\n", (message_type == ERROR) ? "error" : "warning", msg); } } } pthread_mutex_unlock(&message_queue_mutex); } int lingot_msg_get(char** msg, message_type_t* type, int* error_code) { int result = 0; *msg = NULL; pthread_mutex_lock(&message_queue_mutex); if (front != rear) { front = (front + 1) % MAX_MESSAGES; *msg = strdup(message[front]); *type = message_type[front]; *error_code = error_codes[front]; result = 1; } pthread_mutex_unlock(&message_queue_mutex); return result; } lingot-1.0.1/src/lingot-signal.c0000644000175000017500000002346213320113677013442 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "lingot-signal.h" #include "lingot-complex.h" /* peak identification functions. */ static int lingot_signal_is_peak(const FLT* signal, int index, unsigned short peak_half_width) { register unsigned int j; for (j = 0; j < peak_half_width; j++) { if ((signal[index + j] < signal[index + j + 1]) || (signal[index - j] < signal[index - j - 1])) { return 0; } } return 1; } //--------------------------------------------------------------------------- static FLT lingot_signal_fft_bin_interpolate_quinn2_tau(FLT x) { return (0.25 * log(3 * x * x + 6 * x + 1.0) - 0.102062072615966 * log( (x + 1.0 - 0.816496580927726) / (x + 1.0 + 0.816496580927726))); } static FLT lingot_signal_fft_bin_interpolate_quinn2(const LingotComplex y1, const LingotComplex y2, const LingotComplex y3) { FLT absy2_2 = y2[0] * y2[0] + y2[1] * y2[1]; FLT ap = (y3[0] * y2[0] + y3[1] * y2[1]) / absy2_2; FLT dp = -ap / (1.0 - ap); FLT am = (y1[0] * y2[0] + y1[1] * y2[1]) / absy2_2; FLT dm = am / (1.0 - am); return 0.5 * (dp + dm) + lingot_signal_fft_bin_interpolate_quinn2_tau(dp * dp) - lingot_signal_fft_bin_interpolate_quinn2_tau(dm * dm); } // for qsort static int lingot_signal_compare_int(const void *a, const void *b) { return (*((int*) a) < *((int*) b)) ? -1 : 1; } // Returns a factor to multiply with in order to give more importance to higher // frequency harmonics. This is to give more importance to the higher divisors // for the same selected sets. static FLT lingot_signal_frequency_penalty(FLT freq) { static const FLT f0 = 100; static const FLT f1 = 1000; static const FLT alpha0 = 0.99; static const FLT alpha1 = 1; // TODO: precompute const FLT freqPenaltyA = (alpha0 - alpha1) / (f0 - f1); const FLT freqPenaltyB = -(alpha0 * f1 - f0 * alpha1) / (f0 - f1); return freq * freqPenaltyA + freqPenaltyB; } // search the fundamental peak given the SPD and its 2nd derivative FLT lingot_signal_estimate_fundamental_frequency(const FLT* snr, FLT freq, const LingotComplex* fft, unsigned int N, unsigned int n_peaks, unsigned int lowest_index, unsigned int highest_index, unsigned short peak_half_width, FLT delta_f_fft, FLT min_snr, FLT min_q, FLT min_freq, LingotCore* core, short* divisor) { register unsigned int i, j, m; int p_index[n_peaks]; FLT magnitude[n_peaks]; #ifdef DRAW_MARKERS core->markers_size = 0; #else (void)core; // Unused parameter. #endif // at this moment there are no peaks. for (i = 0; i < n_peaks; i++) p_index[i] = -1; if (lowest_index < peak_half_width) { lowest_index = peak_half_width; } if (peak_half_width + highest_index > N) { highest_index = N - peak_half_width; } unsigned short n_found_peaks = 0; // I'll get the n_peaks maximum peaks with SNR above the required. for (i = lowest_index; i < highest_index; i++) { FLT factor = 1.0; if (freq != 0.0) { FLT f = i * delta_f_fft; if (fabs(f / freq - round(f / freq)) < 0.07) { // TODO: tune and put in conf factor = 1.5; // TODO: tune and put in conf } } FLT snri = snr[i] * factor; if ((snri > min_snr) && lingot_signal_is_peak(snr, i, peak_half_width)) { // search a place in the maximums buffer, if it doesn't exists, the // lower maximum is candidate to be replaced. m = 0; // first candidate. for (j = 0; j < n_peaks; j++) { if (p_index[j] == -1) { m = j; // there is a place. break; } // if there is no place, finds the smallest peak as a candidate // to be substituted. if (magnitude[j] < magnitude[m]) { m = j; } } if (p_index[m] == -1) { p_index[m] = i; // there is a place magnitude[m] = snri; } else if (snr[i] > snr[p_index[m]]) { p_index[m] = i; // if greater magnitude[m] = snri; } if (n_found_peaks < n_peaks) { n_found_peaks++; } } } if (n_found_peaks == 0) { return 0.0; } FLT maximum = 0.0; // search the maximum peak for (i = 0; i < n_found_peaks; i++) if ((p_index[i] != -1) && (magnitude[i] > maximum)) { maximum = magnitude[i]; } // all peaks much lower than maximum are deleted. int delete_counter = 0; for (i = 0; i < n_found_peaks; i++) { if ((p_index[i] == -1) || (magnitude[i] < maximum - 20.0)) { // TODO: conf p_index[i] = N; // there are available places in the buffer. delete_counter++; } } qsort(p_index, n_found_peaks, sizeof(int), &lingot_signal_compare_int); n_found_peaks -= delete_counter; FLT freq_interpolated[n_found_peaks]; FLT delta = 0.0; for (i = 0; i < n_found_peaks; i++) { delta = lingot_signal_fft_bin_interpolate_quinn2(fft[p_index[i] - 1], fft[p_index[i]], fft[p_index[i] + 1]); freq_interpolated[i] = delta_f_fft * (p_index[i] + delta); #ifdef DRAW_MARKERS core->markers[core->markers_size++] = p_index[i]; #endif } // maximum ratio error static const FLT ratioTol = 0.02; // TODO: tune static const short max_divisor = 4; unsigned short tone_index = 0; short div = 0; FLT groundFreq = 0.0; FLT ratios[n_found_peaks]; FLT error[n_found_peaks]; short indices_related[n_found_peaks]; unsigned short n_indices_related = 0; FLT bestQ = 0.0; short best_indices_related[n_found_peaks]; FLT bestF = 0; short bestDivisor = 1; // possible ground frequencies for (tone_index = 0; tone_index < n_found_peaks; tone_index++) { for (div = 1; div <= max_divisor; div++) { groundFreq = freq_interpolated[tone_index] / div; if (groundFreq > min_freq) { n_indices_related = 0; for (i = 0; i < n_found_peaks; i++) { ratios[i] = freq_interpolated[i] / groundFreq; error[i] = (ratios[i] - round(ratios[i])); // harmonically related frequencies if (fabs(error[i]) < ratioTol) { indices_related[n_indices_related++] = i; } } // add the penalties for short sets and high divisors // int highest_harmonic_index = n_indices_related - 1; int highest_harmonic_index = 0; FLT highest_harmonic_magnitude = 0.0; FLT q = 0.0; FLT f = 0.0; // FLT snrsum = 0.0; for (i = 0; i < n_indices_related; i++) { // add up contributions to the quality factor q += snr[p_index[indices_related[i]]] * lingot_signal_frequency_penalty(groundFreq); if (snr[p_index[indices_related[i]]] > highest_harmonic_magnitude) { highest_harmonic_index = i; highest_harmonic_magnitude = snr[p_index[indices_related[i]]]; } // snrsum += snr[p_index[indices_related[i]]]; // short myDivisor = round( // freq_interpolated[indices_related[i]] / groundFreq); // f += snr[p_index[indices_related[i]]] // * freq_interpolated[indices_related[i]] / myDivisor; } f = freq_interpolated[indices_related[highest_harmonic_index]]; // f /= snrsum; // printf(">>>>>>>>>< f = %f\n", f); // printf( // "tone = %i, divisor = %i, gf = %f, q = %f, n = %i, f = %f, ", // tone, divisor, groundFreq, q, n_indices_related, f); // for (i = 0; i < n_indices_related; i++) { // printf("%f ", freq_interpolated[indices_related[i]]); // } // printf("\n"); if (q > bestQ) { bestQ = q; memcpy(best_indices_related, indices_related, n_indices_related * sizeof(short)); bestDivisor = round(f / groundFreq); bestF = f; #ifdef DRAW_MARKERS core->markers_size2 = 0; for (i = 0; i < n_indices_related; i++) { core->markers2[core->markers_size2++] = p_index[indices_related[i]]; } #endif // printf("%d\n", n_indices_related); } } else { break; } } } // printf("BEST selected f = %f, f* = %f, div = %i, q = %f, n = %i, ", // bestF / bestDivisor, bestDivisor, bestF, bestQ, // best_n_indices_related); // for (i = 0; i < best_n_indices_related; i++) { // printf("%f ", freq_interpolated[best_indices_related[i]]); // } // printf("\n"); if ((bestF != 0.0) && (bestQ < min_q)) { bestF = 0.0; // printf("q < mq!!\n"); } #ifdef DRAW_MARKERS if (bestF == 0.0) { core->markers_size2 = 0; } #endif *divisor = bestDivisor; return bestF; } void lingot_signal_compute_noise_level(const FLT* spd, int N, int cbuffer_size, FLT* noise_level) { // low pass IIR filter. const FLT c = 0.1; const FLT filter_a[] = { 1.0, c - 1.0 }; const FLT filter_b[] = { c }; static char initialized = 0; static LingotFilter filter; if (! initialized) { initialized = 1; lingot_filter_new(&filter, 1, 0, filter_a, filter_b); } lingot_filter_reset(&filter); lingot_filter_filter(&filter, cbuffer_size, spd, noise_level); lingot_filter_filter(&filter, N, spd, noise_level); } //--------------------------------------------------------------------------- // generates a N-samples window void lingot_signal_window(int N, FLT* out, window_type_t window_type) { register int i; switch (window_type) { case HANNING: for (i = 0; i < N; i++) out[i] = 0.5 * (1 - cos((2.0 * M_PI * i) / (N - 1))); break; case HAMMING: for (i = 0; i < N; i++) out[i] = 0.53836 - 0.46164 * cos((2.0 * M_PI * i) / (N - 1)); break; default: break; } } lingot-1.0.1/src/lingot-io-config.h0000644000175000017500000000617713320113677014050 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_IO_CONFIG_H__ #define __LINGOT_IO_CONFIG_H__ #include "lingot-config.h" // configuration parameter identifier typedef enum LingotConfigParameterId { LINGOT_PARAMETER_ID_AUDIO_SYSTEM, // LINGOT_PARAMETER_ID_AUDIO_DEV, // LINGOT_PARAMETER_ID_AUDIO_DEV_ALSA, // LINGOT_PARAMETER_ID_AUDIO_DEV_JACK, // LINGOT_PARAMETER_ID_AUDIO_DEV_PULSEAUDIO, // LINGOT_PARAMETER_ID_ROOT_FREQUENCY_ERROR, // LINGOT_PARAMETER_ID_FFT_SIZE, // LINGOT_PARAMETER_ID_TEMPORAL_WINDOW, // LINGOT_PARAMETER_ID_MIN_SNR, // LINGOT_PARAMETER_ID_CALCULATION_RATE, // LINGOT_PARAMETER_ID_VISUALIZATION_RATE, // LINGOT_PARAMETER_ID_MINIMUM_FREQUENCY, // LINGOT_PARAMETER_ID_MAXIMUM_FREQUENCY, // // ------- obsolete --------- LINGOT_PARAMETER_ID_MIN_FREQUENCY, // LINGOT_PARAMETER_ID_GAIN, // LINGOT_PARAMETER_ID_NOISE_THRESHOLD, // LINGOT_PARAMETER_ID_SAMPLE_RATE, // LINGOT_PARAMETER_ID_OVERSAMPLING, // LINGOT_PARAMETER_ID_DFT_NUMBER, // LINGOT_PARAMETER_ID_DFT_SIZE, // LINGOT_PARAMETER_ID_PEAK_ORDER, // LINGOT_PARAMETER_ID_PEAK_NUMBER, // LINGOT_PARAMETER_ID_PEAK_HALF_WIDTH, // LINGOT_PARAMETER_ID_PEAK_REJECTION_RELATION, // } LingotConfigParameterId; // configuration parameter type typedef enum LingotConfigParameterType { LINGOT_PARAMETER_TYPE_STRING, LINGOT_PARAMETER_TYPE_INTEGER, LINGOT_PARAMETER_TYPE_FLOAT, LINGOT_PARAMETER_TYPE_AUDIO_SYSTEM } LingotConfigParameterType; typedef struct _LingotConfigParameterSpec LingotConfigParameterSpec; // configuration parameter specification (id, type, minimum and maximum allowed values, ...) struct _LingotConfigParameterSpec { LingotConfigParameterId id; LingotConfigParameterType type; const char* name; const char* units; int deprecated; unsigned int str_max_len; int int_min; int int_max; double float_min; double float_max; }; // converts an audio_system_t to a string const char* audio_system_t_to_str(audio_system_t audio_system); // converts a string to an audio_system_t audio_system_t str_to_audio_system_t(char* audio_system); void lingot_io_config_create_parameter_specs(); LingotConfigParameterSpec lingot_io_config_get_parameter_spec(LingotConfigParameterId id); void lingot_io_config_save(LingotConfig*, const char* filename); int lingot_io_config_load(LingotConfig*, const char* filename); #endif // __LINGOT_IO_CONFIG_H__ lingot-1.0.1/src/lingot-i18n.h0000644000175000017500000000223113320113677012740 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef LINGOTI18N_H_ #define LINGOTI18N_H_ #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef ENABLE_NLS #undef _ # define _(String) (const char*) gettext (String) #else # define _(String) (String) #endif #endif /*LINGOTI18N_H_*/ lingot-1.0.1/src/lingot-gauge.h0000644000175000017500000000242013320113677013251 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_GAUGE_H__ #define __LINGOT_GAUGE_H__ #include "lingot-defs.h" #include "lingot-filter.h" /* * Implements the dynamic behaviour of the gauge with a digital filter. */ typedef struct { LingotFilter filter; FLT position; } LingotGauge;; void lingot_gauge_new(LingotGauge*, FLT); void lingot_gauge_destroy(LingotGauge*); void lingot_gauge_compute(LingotGauge*, FLT); #endif /*__LINGOT_GAUGE_H__*/ lingot-1.0.1/src/lingot-io-config.c0000644000175000017500000004562713320113677014046 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include "lingot-io-config.h" #include "lingot-config-scale.h" #include "lingot-msg.h" #include "lingot-i18n.h" #define N_MAX_OPTIONS 30 LingotConfigParameterSpec parameters[N_MAX_OPTIONS]; unsigned int parameters_count = 0; const char* audio_systems[] = { "OSS", "ALSA", "JACK", "PulseAudio"}; // converts an audio_system_t to a string const char* audio_system_t_to_str(audio_system_t audio_system) { assert (0 <= audio_system); assert (audio_system * sizeof (char*) < sizeof (audio_systems)); return audio_systems[audio_system]; } // converts a string to an audio_system_t audio_system_t str_to_audio_system_t(char* audio_system) { audio_system_t result = -1; int i; for (i = 0; i * sizeof (char*) < sizeof (audio_systems); i++) { if (!strcmp(audio_system, audio_systems[i])) { result = i; break; } } return result; } //---------------------------------------------------------------------------- static void lingot_config_add_string_parameter_spec(LingotConfigParameterId id, const char* name, unsigned int max_len, int deprecated) { parameters[id].id = id; parameters[id].type = LINGOT_PARAMETER_TYPE_STRING; parameters[id].name = name; parameters[id].units = NULL; parameters[id].deprecated = deprecated; parameters[id].str_max_len = max_len; parameters_count++; } static void lingot_config_add_integer_parameter_spec(LingotConfigParameterId id, const char* name, const char* units, int min, int max, int deprecated) { parameters[id].id = id; parameters[id].type = LINGOT_PARAMETER_TYPE_INTEGER; parameters[id].name = name; parameters[id].units = units; parameters[id].deprecated = deprecated; parameters[id].int_min = min; parameters[id].int_max = max; parameters_count++; } static void lingot_config_add_double_parameter_spec(LingotConfigParameterId id, const char* name, const char* units, double min, double max, int deprecated) { parameters[id].id = id; parameters[id].type = LINGOT_PARAMETER_TYPE_FLOAT; parameters[id].name = name; parameters[id].units = units; parameters[id].deprecated = deprecated; parameters[id].float_min = min; parameters[id].float_max = max; parameters_count++; } void lingot_io_config_create_parameter_specs() { int i = 0; for (i = 0; i < N_MAX_OPTIONS; i++) { parameters[i].id = -1; parameters[i].type = -1; parameters[i].name = NULL; parameters[i].units = NULL; parameters[i].deprecated = 0; } parameters[LINGOT_PARAMETER_ID_AUDIO_SYSTEM].id = LINGOT_PARAMETER_ID_AUDIO_SYSTEM; parameters[LINGOT_PARAMETER_ID_AUDIO_SYSTEM].type = LINGOT_PARAMETER_TYPE_AUDIO_SYSTEM; parameters[LINGOT_PARAMETER_ID_AUDIO_SYSTEM].name = "AUDIO_SYSTEM"; parameters[LINGOT_PARAMETER_ID_AUDIO_SYSTEM].units = NULL; parameters[LINGOT_PARAMETER_ID_AUDIO_SYSTEM].deprecated = 0; parameters_count++; lingot_config_add_string_parameter_spec(LINGOT_PARAMETER_ID_AUDIO_DEV, "AUDIO_DEV", 512, 0); lingot_config_add_string_parameter_spec(LINGOT_PARAMETER_ID_AUDIO_DEV_ALSA, "AUDIO_DEV_ALSA", 512, 0); lingot_config_add_string_parameter_spec(LINGOT_PARAMETER_ID_AUDIO_DEV_JACK, "AUDIO_DEV_JACK", 512, 0); lingot_config_add_string_parameter_spec( LINGOT_PARAMETER_ID_AUDIO_DEV_PULSEAUDIO, "AUDIO_DEV_PULSEAUDIO", 512, 0); lingot_config_add_double_parameter_spec(LINGOT_PARAMETER_ID_MIN_SNR, "MIN_SNR", "dB", 0.0, 40.0, 0); lingot_config_add_double_parameter_spec( LINGOT_PARAMETER_ID_ROOT_FREQUENCY_ERROR, "ROOT_FREQUENCY_ERROR", "cents", -500.0, 500.0, 0); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_FFT_SIZE, "FFT_SIZE", "samples", 256, 4096, 0); lingot_config_add_double_parameter_spec(LINGOT_PARAMETER_ID_TEMPORAL_WINDOW, "TEMPORAL_WINDOW", "seconds", 0.0, 15.00, 0); lingot_config_add_double_parameter_spec( LINGOT_PARAMETER_ID_CALCULATION_RATE, "CALCULATION_RATE", "Hz", 1.0, 30.00, 0); lingot_config_add_double_parameter_spec( LINGOT_PARAMETER_ID_VISUALIZATION_RATE, "VISUALIZATION_RATE", "Hz", 1.0, 40.00, 0); lingot_config_add_double_parameter_spec( LINGOT_PARAMETER_ID_MINIMUM_FREQUENCY, "MINIMUM_FREQUENCY", "Hz", 0.0, 22050.0, 0); lingot_config_add_double_parameter_spec( LINGOT_PARAMETER_ID_MAXIMUM_FREQUENCY, "MAXIMUM_FREQUENCY", "Hz", 0.0, 22050.0, 0); // ----------- obsolete ----------- lingot_config_add_double_parameter_spec(LINGOT_PARAMETER_ID_GAIN, "GAIN", "dB", -90.0, 90.0, 1); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_PEAK_ORDER, "PEAK_ORDER", NULL, 0, 10, 1); lingot_config_add_double_parameter_spec(LINGOT_PARAMETER_ID_MIN_FREQUENCY, "MIN_FREQUENCY", "Hz", 0.0, 22050.0, 1); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_SAMPLE_RATE, "SAMPLE_RATE", "Hz", 100, 200000, 1); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_OVERSAMPLING, "OVERSAMPLING", NULL, 1, 120, 1); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_PEAK_NUMBER, "PEAK_NUMBER", "samples", 1, 10, 1); lingot_config_add_integer_parameter_spec( LINGOT_PARAMETER_ID_PEAK_HALF_WIDTH, "PEAK_HALF_WIDTH", "samples", 1, 5, 1); lingot_config_add_double_parameter_spec( LINGOT_PARAMETER_ID_PEAK_REJECTION_RELATION, "PEAK_REJECTION_RELATION", "dB", 0.0, 100.0, 1); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_DFT_NUMBER, "DFT_NUMBER", "DFTs", 0, 10, 1); lingot_config_add_integer_parameter_spec(LINGOT_PARAMETER_ID_DFT_SIZE, "DFT_SIZE", "samples", 4, 100, 1); lingot_config_add_double_parameter_spec(LINGOT_PARAMETER_ID_NOISE_THRESHOLD, "NOISE_THRESHOLD", "dB", 0.0, 40.0, 1); } LingotConfigParameterSpec lingot_io_config_get_parameter_spec( LingotConfigParameterId id) { return parameters[(int) id]; } //---------------------------------------------------------------------------- // internal parameters mapped to each token in the config file. static void lingot_config_map_parameters(LingotConfig* config, void* params[]) { typedef struct { int id; void* value; } pair_t; pair_t c_params[] = { // { .id = LINGOT_PARAMETER_ID_AUDIO_SYSTEM, .value = &config->audio_system }, // { .id = LINGOT_PARAMETER_ID_AUDIO_DEV, .value = &config->audio_dev[AUDIO_SYSTEM_OSS] }, // { .id = LINGOT_PARAMETER_ID_AUDIO_DEV_ALSA, .value = &config->audio_dev[AUDIO_SYSTEM_ALSA] }, // { .id = LINGOT_PARAMETER_ID_AUDIO_DEV_JACK, .value = &config->audio_dev[AUDIO_SYSTEM_JACK] }, // { .id = LINGOT_PARAMETER_ID_AUDIO_DEV_PULSEAUDIO, .value = &config->audio_dev[AUDIO_SYSTEM_PULSEAUDIO] }, // { .id = LINGOT_PARAMETER_ID_ROOT_FREQUENCY_ERROR, .value = &config->root_frequency_error }, // { .id = LINGOT_PARAMETER_ID_FFT_SIZE, .value = &config->fft_size }, // { .id = LINGOT_PARAMETER_ID_TEMPORAL_WINDOW, .value = &config->temporal_window }, // { .id = LINGOT_PARAMETER_ID_MIN_SNR, .value = &config->min_overall_SNR }, // { .id = LINGOT_PARAMETER_ID_CALCULATION_RATE, .value = &config->calculation_rate }, // { .id = LINGOT_PARAMETER_ID_VISUALIZATION_RATE, .value = &config->visualization_rate }, // { .id = LINGOT_PARAMETER_ID_MINIMUM_FREQUENCY, .value = &config->min_frequency }, // { .id = LINGOT_PARAMETER_ID_MAXIMUM_FREQUENCY, .value = &config->max_frequency }, // { .id = -1, .value = NULL }, // null terminated }; unsigned int i = 0; for (i = 0; i < parameters_count; i++) { params[i] = NULL; } for (i = 0; c_params[i].id >= 0; i++) { params[c_params[i].id] = c_params[i].value; } } void lingot_io_config_save(LingotConfig* config, const char* filename) { unsigned int i; FILE* fp; char* lc_all; void* params[N_MAX_OPTIONS]; // parameter pointer array. void* param = NULL; char buff[512]; lingot_config_map_parameters(config, params); lc_all = setlocale(LC_ALL, NULL); // duplicate the string, as the next call to setlocale will destroy it if (lc_all) lc_all = strdup(lc_all); setlocale(LC_ALL, "C"); if ((fp = fopen(filename, "w")) == NULL) { char buff[512]; snprintf(buff, sizeof(buff), "error saving config file %s ", filename); perror(buff); return; } fprintf(fp, "# Config file automatically created by lingot %s\n\n", VERSION); for (i = 0; i < parameters_count; i++) { if (!parameters[i].deprecated) { param = params[i]; fprintf(fp, "%s = ", parameters[i].name); switch (parameters[i].type) { case LINGOT_PARAMETER_TYPE_STRING: fprintf(fp, "%s", (char*) param); break; case LINGOT_PARAMETER_TYPE_INTEGER: fprintf(fp, "%d", *((unsigned int*) param)); break; case LINGOT_PARAMETER_TYPE_FLOAT: fprintf(fp, "%0.3f", *((FLT*) param)); break; case LINGOT_PARAMETER_TYPE_AUDIO_SYSTEM: fprintf(fp, "%s", audio_system_t_to_str(*((audio_system_t*) param))); break; } if (parameters[i].units != NULL) { fprintf(fp, " # %s", parameters[i].units); } fprintf(fp, "\n"); } } fprintf(fp, "\n"); fprintf(fp, "SCALE = {\n"); fprintf(fp, "NAME = %s\n", config->scale.name); fprintf(fp, "BASE_FREQUENCY = %f\n", config->scale.base_frequency); fprintf(fp, "NOTE_COUNT = %d\n", config->scale.notes); fprintf(fp, "NOTES = {\n"); for (i = 0; i < config->scale.notes; i++) { lingot_config_scale_format_shift(buff, config->scale.offset_cents[i], config->scale.offset_ratios[0][i], config->scale.offset_ratios[1][i]); fprintf(fp, "%s\t%s\n", config->scale.note_name[i], buff); } fprintf(fp, "}\n"), fprintf(fp, "}\n"), fclose(fp); if (lc_all) { setlocale(LC_ALL, lc_all); free(lc_all); } } //---------------------------------------------------------------------------- typedef enum { rs_not_yet, rs_reading, rs_done } reading_scale_step_t; int lingot_io_config_load(LingotConfig* config, const char* filename) { FILE* fp; int line; unsigned int option_index; char* char_buffer_pointer; static const char* delim = " \t=\n"; static const char* delim2 = " \t\n"; void* params[N_MAX_OPTIONS]; // parameter pointer array. void* param = NULL; reading_scale_step_t reading_scale = rs_not_yet; char* nl; int parse_errors = 0; int scale_errors = 0; LingotScale scale; // restore default values for non specified parameters lingot_config_restore_default_values(config); config->optimize_internal_parameters = 0; lingot_config_map_parameters(config, params); static const unsigned int max_line_size = 1024; char char_buffer[max_line_size]; if ((fp = fopen(filename, "r")) == NULL) { snprintf(char_buffer, max_line_size, "error opening config file %s, assuming default values ", filename); perror(char_buffer); return 0; } line = 0; for (;;) { line++; if (!fgets(char_buffer, max_line_size, fp)) { break; } if (char_buffer[0] == '#') { continue; } // tokens into the line. char_buffer_pointer = strtok(char_buffer, delim); if (!char_buffer_pointer) { continue; // blank line. } if (reading_scale == rs_not_yet && !strcmp(char_buffer_pointer, "SCALE")) { reading_scale = rs_reading; lingot_config_scale_new(&scale); continue; } if (reading_scale == rs_reading) { if (!strcmp(char_buffer_pointer, "NAME")) { char_buffer_pointer += 4; while (1) { nl = strchr(delim, *char_buffer_pointer); if (!nl) break; char_buffer_pointer++; } nl = strrchr(char_buffer_pointer, '\r'); if (nl) *nl = '\0'; nl = strrchr(char_buffer_pointer, '\n'); if (nl) *nl = '\0'; scale.name = strdup(char_buffer_pointer); continue; } if (!strcmp(char_buffer_pointer, "BASE_FREQUENCY")) { char_buffer_pointer = strtok(NULL, delim); sscanf(char_buffer_pointer, "%lg", &scale.base_frequency); continue; } if (!strcmp(char_buffer_pointer, "NOTE_COUNT")) { char_buffer_pointer = strtok(NULL, delim); sscanf(char_buffer_pointer, "%hu", &scale.notes); lingot_config_scale_allocate(&scale, scale.notes); continue; } if (!strcmp(char_buffer_pointer, "NOTES")) { int i = 0; for (i = 0; i < scale.notes; i++) { line++; if (!fgets(char_buffer, max_line_size, fp)) { scale_errors = 1; fprintf(stderr, "error at line %i: error reading the scale\n", line); break; } // tokens into the line. char_buffer_pointer = strtok(char_buffer, delim2); if (char_buffer_pointer == NULL) { scale_errors = 1; fprintf(stderr, "error at line %i: error reading the scale\n", line); break; } scale.note_name[i] = strdup(char_buffer_pointer); char_buffer_pointer = strtok(NULL, delim2); if (char_buffer_pointer == NULL) { scale_errors = 1; fprintf(stderr, "error at line %i: error reading the scale\n", line); break; } if (!lingot_config_scale_parse_shift(char_buffer_pointer, &scale.offset_cents[i], &scale.offset_ratios[0][i], &scale.offset_ratios[1][i])) { scale_errors = 1; } else { if ((scale.offset_cents[i] < 0) || (scale.offset_cents[i] >= 1200)) { scale_errors = 1; fprintf(stderr, "error at line %i: the notes in the scale must be equal or higher than 1/1 (0 cents) and lower than 2/1 (1200 cents)\n", line); } if (i == 0) { if (scale.offset_cents[i] != 0.0) { scale_errors = 1; fprintf(stderr, "error at line %i: the first note in the scale must be 1/1 (0 cents shift)\n", line); } } else if (scale.offset_cents[i] <= scale.offset_cents[i - 1]) { scale_errors = 1; fprintf(stderr, "error at line %i: the notes in the scale must be well ordered\n", line); } } } line++; if (!fgets(char_buffer, max_line_size, fp)) break; continue; } if (!strcmp(char_buffer_pointer, "}")) { reading_scale = rs_done; continue; } } for (option_index = 0; option_index < parameters_count; option_index++) { if (!strcmp(char_buffer_pointer, parameters[option_index].name)) { break; // found token. } } if (option_index == parameters_count) { fprintf(stderr, "warning: parse error at line %i: unknown keyword %s\n", line, char_buffer_pointer); parse_errors = 1; continue; } if (parameters[option_index].deprecated) { fprintf(stdout, "warning: deprecated option %s\n", char_buffer_pointer); } param = params[option_index]; if (param != NULL) { // take the attribute value. char_buffer_pointer = strtok(NULL, delim); if (!char_buffer_pointer) { fprintf(stderr, "warning: parse error at line %i: value expected\n", line); parse_errors = 1; continue; } int int_value; double double_value; audio_system_t audio_system_value; // assign the value to the parameter. switch (parameters[option_index].type) { case LINGOT_PARAMETER_TYPE_STRING: if (strlen(char_buffer_pointer) < parameters[option_index].str_max_len) { snprintf(((char*) param), 512, "%s", char_buffer_pointer); } else { fprintf(stderr, "error: parse error at line %i, '%s = %s': identifier too long (maximum length %d characters), assuming default value '%s'\n", line, parameters[option_index].name, char_buffer_pointer, parameters[option_index].str_max_len, ((char*) param)); parse_errors = 1; } break; case LINGOT_PARAMETER_TYPE_INTEGER: sscanf(char_buffer_pointer, "%d", &int_value); // TODO: generalize validation? if (parameters[option_index].id == LINGOT_PARAMETER_ID_FFT_SIZE) { if ((int_value != 256) && (int_value != 512) && (int_value != 1024) && (int_value != 2048) && (int_value != 4096)) { fprintf(stderr, "error: parse error at line %i, '%s = %s': invalid value (allowed values are 256, 512, 1024, 2048 and 4096), assuming default value %i\n", line, parameters[option_index].name, char_buffer_pointer, *((unsigned int*) param)); parse_errors = 1; } else { *((unsigned int*) param) = int_value; } } else { if ((int_value >= parameters[option_index].int_min) && (int_value <= parameters[option_index].int_max)) { *((unsigned int*) param) = int_value; } else { fprintf(stderr, "error: parse error at line %i, '%s = %s': out of bounds (minimum %i, maximum %i), assuming default value %i\n", line, parameters[option_index].name, char_buffer_pointer, parameters[option_index].int_min, parameters[option_index].int_max, *((unsigned int*) param)); parse_errors = 1; } } break; case LINGOT_PARAMETER_TYPE_FLOAT: sscanf(char_buffer_pointer, "%lf", &double_value); if ((double_value >= parameters[option_index].float_min) && (double_value <= parameters[option_index].float_max)) { *((FLT*) param) = double_value; } else { fprintf(stderr, "error: parse error at line %i, '%s = %s': out of bounds (minimum %0.3f, maximum %0.3f), assuming default value %0.3f\n", line, parameters[option_index].name, char_buffer_pointer, parameters[option_index].float_min, parameters[option_index].float_max, *((FLT*) param)); parse_errors = 1; } break; case LINGOT_PARAMETER_TYPE_AUDIO_SYSTEM: audio_system_value = str_to_audio_system_t(char_buffer_pointer); if (audio_system_value != (audio_system_t) -1) { *((audio_system_t*) param) = audio_system_value; } else { char buff[250]; snprintf(buff, sizeof(buff), _( "Error parsing the configuration file, line %i: unrecognized audio system, assuming default value.\n"), line); lingot_msg_add_warning(buff); parse_errors = 1; } break; } } } fclose(fp); if (reading_scale != rs_not_yet) { if (!scale_errors) { lingot_config_scale_new(&config->scale); lingot_config_scale_copy(&config->scale, &scale); } lingot_config_scale_destroy(&scale); } if (parse_errors || scale_errors) { lingot_msg_add_warning( _( "The configuration file contains errors, and hence some default values have been chosen. The problem will be fixed once you have accepted the settings in the configuration dialog.")); } lingot_config_update_internal_params(config); return 1; } lingot-1.0.1/src/lingot-audio-oss.c0000644000175000017500000001072213320113677014063 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef OSS #include "lingot-msg.h" #include "lingot-defs.h" #include "lingot-audio-oss.h" #include "lingot-i18n.h" #include #include #include #include #include #include #include #include #include #include void lingot_audio_oss_new(LingotAudioHandler* audio, const char* device, int sample_rate) { int channels = 1; # ifdef AFMT_S16_NE int format = AFMT_S16_NE; # else int format = AFMT_S16_LE; # endif char error_message[100]; const char* exception; audio->audio_system = AUDIO_SYSTEM_OSS; audio->dsp = open(device, O_RDONLY); if (sample_rate >= 44100) { audio->read_buffer_size_samples = 1024; } else if (sample_rate >= 22050) { audio->read_buffer_size_samples = 512; } else { audio->read_buffer_size_samples = 256; } strcpy(audio->device, device); try { if (audio->dsp < 0) { snprintf(error_message, sizeof(error_message), _("Cannot open audio device '%s'.\n%s"), device, strerror(errno)); throw(error_message); } //if (ioctl(audio->dsp, SOUND_PCM_READ_CHANNELS, &channels) < 0) if (ioctl(audio->dsp, SNDCTL_DSP_CHANNELS, &channels) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Error setting number of channels."), strerror(errno)); throw(error_message); } // sample size //if (ioctl(audio->dsp, SOUND_PCM_SETFMT, &format) < 0) if (ioctl(audio->dsp, SNDCTL_DSP_SETFMT, &format) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Error setting bits per sample."), strerror(errno)); throw(error_message); } int fragment_size = 1; int DMA_buffer_size = 512; int param = 0; for (param = 0; fragment_size < DMA_buffer_size; param++) fragment_size <<= 1; param |= 0x00ff0000; if (ioctl(audio->dsp, SNDCTL_DSP_SETFRAGMENT, ¶m) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Error setting DMA buffer size."), strerror(errno)); throw(error_message); } if (ioctl(audio->dsp, SNDCTL_DSP_SPEED, &sample_rate) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Error setting sample rate."), strerror(errno)); throw(error_message); } audio->real_sample_rate = sample_rate; audio->bytes_per_sample = 2; }catch { lingot_msg_add_error_with_code(exception, errno); close(audio->dsp); audio->audio_system = -1; } } void lingot_audio_oss_destroy(LingotAudioHandler* audio) { if (audio->audio_system == AUDIO_SYSTEM_OSS) { if (audio->dsp >= 0) { close(audio->dsp); audio->dsp = -1; } } } int lingot_audio_oss_read(LingotAudioHandler* audio) { int samples_read = -1; char buffer [audio->read_buffer_size_samples * audio->bytes_per_sample]; int bytes_read = read(audio->dsp, buffer, sizeof (buffer)); if (bytes_read < 0) { char buff[512]; snprintf(buff, sizeof(buff), "%s\n%s", _("Read from audio interface failed."), strerror(errno)); lingot_msg_add_error(buff); } else { samples_read = bytes_read / audio->bytes_per_sample; // float point conversion int i; const int16_t* read_buffer = (int16_t*) buffer; for (i = 0; i < samples_read; i++) { audio->flt_read_buffer[i] = read_buffer[i]; } } return samples_read; } int lingot_audio_oss_get_audio_system_properties( LingotAudioSystemProperties* result) { // TODO result->forced_sample_rate = 0; result->n_devices = 0; result->devices = NULL; result->n_sample_rates = 5; result->sample_rates[0] = 8000; result->sample_rates[1] = 11025; result->sample_rates[2] = 22050; result->sample_rates[3] = 44100; result->sample_rates[4] = 48000; return 0; } #endif lingot-1.0.1/src/lingot-fft.h0000644000175000017500000000343213320113677012744 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LINGOT_FFT_H_ #define _LINGOT_FFT_H_ /* Fourier transforms. */ #include "lingot-defs.h" #ifdef LIBFFTW # include #endif # include "lingot-complex.h" typedef struct { int n; FLT* in; #ifdef LIBFFTW fftw_plan fftwplan; #else // phase factor table, for FFT optimization. LingotComplex* wn; #endif LingotComplex* fft_out; // complex signal in freq. } LingotFFTPlan; void lingot_fft_plan_create(LingotFFTPlan*, FLT* in, int n); void lingot_fft_plan_destroy(LingotFFTPlan*); // Full Spectral Power Distribution (SPD) esteem. void lingot_fft_compute_dft_and_spd(LingotFFTPlan*, FLT* out, int n_out); // Spectral Power Distribution (SPD) evaluation at a given frequency. void lingot_fft_spd_eval(FLT* in, int N1, FLT wi, FLT dw, FLT* out, int N2); // Evaluates first and second SPD derivatives at frequency w. void lingot_fft_spd_diffs_eval(const FLT* in, int N, FLT w, FLT* out_d0, FLT* out_d1, FLT* out_d2); #endif lingot-1.0.1/src/lingot-msg.h0000644000175000017500000000301313320113677012746 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_MESSAGES_H__ #define __LINGOT_MESSAGES_H__ // asynchronous message handling // message types typedef enum message_type_t { ERROR = 0, WARNING = 1, INFO = 2 } message_type_t; // add messages to the queue void lingot_msg_add(const char* message, message_type_t type, int error_code); void lingot_msg_add_error(const char* message); void lingot_msg_add_error_with_code(const char* message, int error_code); void lingot_msg_add_warning(const char* message); void lingot_msg_add_info(const char* message); // gets a message from the queue, it returns 0 if no messages are available int lingot_msg_get(char** msg, message_type_t* type, int* error_code); #endif lingot-1.0.1/src/lingot-fft.c0000644000175000017500000001171613320113677012743 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "lingot-fft.h" #include "lingot-config.h" #ifndef LIBFFTW #include "lingot-complex.h" #endif /* DTFT functions. */ void lingot_fft_plan_create(LingotFFTPlan* result, FLT* in, int n) { result->n = n; result->in = in; #ifdef LIBFFTW result->fft_out = fftw_malloc(n * sizeof(fftw_complex)); memset(result->fft_out, 0, n * sizeof(fftw_complex)); result->fftwplan = fftw_plan_dft_r2c_1d(n, in, result->fft_out, FFTW_ESTIMATE); #else FLT alpha; unsigned int i; // twiddle factors result->wn = (LingotComplex*) malloc((n >> 1) * sizeof(LingotComplex)); for (i = 0; i < (n >> 1); i++) { alpha = -2.0 * i * M_PI / n; result->wn[i][0] = cos(alpha); result->wn[i][1] = sin(alpha); } result->fft_out = malloc(n * sizeof(LingotComplex)); // complex signal in freq domain. memset(result->fft_out, 0, n * sizeof(LingotComplex)); #endif } void lingot_fft_plan_destroy(LingotFFTPlan* plan) { #ifdef LIBFFTW fftw_destroy_plan(plan->fftwplan); fftw_free(plan->fft_out); #else free(plan->fft_out); free(plan->wn); #endif } #ifndef LIBFFTW void _lingot_fft_fft(FLT* in, LingotComplex* out, LingotComplex* wn, unsigned long int N, unsigned long int offset, unsigned long int d1, unsigned long int step) { LingotComplex X1, X2; unsigned long int Np2 = (N >> 1); // N/2 register unsigned long int a, b, c, q; if (N == 2) { // butterfly for N = 2; X1[0] = in[offset]; X1[1] = 0.0; X2[0] = in[offset + step]; X2[1] = 0.0; lingot_complex_add(X1, X2, out[d1]); lingot_complex_sub(X1, X2, out[d1 + Np2]); return; } _lingot_fft_fft(in, out, wn, Np2, offset, d1, step << 1); _lingot_fft_fft(in, out, wn, Np2, offset + step, d1 + Np2, step << 1); for (q = 0, c = 0; q < (N >> 1); q++, c += step) { a = q + d1; b = a + Np2; X1[0] = out[a][0]; X1[1] = out[a][1]; lingot_complex_mul(out[b], wn[c], X2); lingot_complex_add(X1, X2, out[a]); lingot_complex_sub(X1, X2, out[b]); } } void lingot_fft_fft(LingotFFTPlan* plan) { _lingot_fft_fft(plan->in, plan->fft_out, plan->wn, plan->n, 0, 0, 1); } #endif void lingot_fft_compute_dft_and_spd(LingotFFTPlan* plan, FLT* out, int n_out) { int i; double _1_N2 = 1.0 / (plan->n * plan->n); # ifdef LIBFFTW // transformation. fftw_execute(plan->fftwplan); # else // transformation. lingot_fft_fft(plan); #endif // esteem of SPD from FFT. (normalized squared module) for (i = 0; i < n_out; i++) { out[i] = (plan->fft_out[i][0] * plan->fft_out[i][0] + plan->fft_out[i][1] * plan->fft_out[i][1]) * _1_N2; } } /* Spectral Power Distribution esteem, selectively in frequency, by DFT. transforms signal in of N1 samples from frequency wi, with sample separation of dw rads, storing the result on buffer out with N2 samples. */ void lingot_fft_spd_eval(FLT* in, int N1, FLT wi, FLT dw, FLT* out, int N2) { FLT Xr, Xi; FLT wn; const FLT N1_2 = N1 * N1; int i, n; for (i = 0; i < N2; i++) { Xr = 0.0; Xi = 0.0; for (n = 0; n < N1; n++) { // O(n1*n2) :( wn = (wi + dw * i) * n; Xr = Xr + cos(wn) * in[n]; Xi = Xi - sin(wn) * in[n]; } out[i] = (Xr * Xr + Xi * Xi) / N1_2; // normalized squared module. } } void lingot_fft_spd_diffs_eval(const FLT* in, int N, FLT w, FLT* out_d0, FLT* out_d1, FLT* out_d2) { FLT x_cos_wn; FLT x_sin_wn; const FLT N2 = N * N; int n; FLT SUM_x_sin_wn = 0.0; FLT SUM_x_cos_wn = 0.0; FLT SUM_x_n_sin_wn = 0.0; FLT SUM_x_n_cos_wn = 0.0; FLT SUM_x_n2_sin_wn = 0.0; FLT SUM_x_n2_cos_wn = 0.0; for (n = 0; n < N; n++) { x_cos_wn = in[n] * cos(w * n); x_sin_wn = in[n] * sin(w * n); SUM_x_sin_wn += x_sin_wn; SUM_x_cos_wn += x_cos_wn; SUM_x_n_sin_wn += x_sin_wn * n; SUM_x_n_cos_wn += x_cos_wn * n; SUM_x_n2_sin_wn += x_sin_wn * n * n; SUM_x_n2_cos_wn += x_cos_wn * n * n; } FLT N_2 = N * N; *out_d0 = (SUM_x_cos_wn * SUM_x_cos_wn + SUM_x_sin_wn * SUM_x_sin_wn) / N2; *out_d1 = 2.0 * (SUM_x_sin_wn * SUM_x_n_cos_wn - SUM_x_cos_wn * SUM_x_n_sin_wn) / N_2; *out_d2 = 2.0 * (SUM_x_n_cos_wn * SUM_x_n_cos_wn - SUM_x_sin_wn * SUM_x_n2_sin_wn + SUM_x_n_sin_wn * SUM_x_n_sin_wn - SUM_x_cos_wn * SUM_x_n2_cos_wn) / N_2; } lingot-1.0.1/src/lingot-audio.c0000644000175000017500000002220513320113677013260 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include "lingot-defs.h" #include "lingot-audio.h" #include "lingot-core.h" #include "lingot-audio-oss.h" #include "lingot-audio-alsa.h" #include "lingot-audio-jack.h" #include "lingot-audio-pulseaudio.h" #include "lingot-i18n.h" #include "lingot-msg.h" void lingot_audio_new(LingotAudioHandler* result, audio_system_t audio_system, const char* device, int sample_rate, LingotAudioProcessCallback process_callback, void *process_callback_arg) { # if !defined(OSS) && !defined(ALSA) && !defined(JACK) && !defined(PULSEAUDIO) # error "No audio system has been defined" # endif switch (audio_system) { # ifdef OSS case AUDIO_SYSTEM_OSS: lingot_audio_oss_new(result, device, sample_rate); # else lingot_msg_add_error( _("The application has not been built with OSS support")); result->audio_system = -1; # endif break; case AUDIO_SYSTEM_ALSA: # ifdef ALSA lingot_audio_alsa_new(result, device, sample_rate); # else lingot_msg_add_error( _("The application has not been built with ALSA support")); result->audio_system = -1; # endif break; case AUDIO_SYSTEM_JACK: # ifdef JACK lingot_audio_jack_new(result, device); # else lingot_msg_add_error( _("The application has not been built with JACK support")); result->audio_system = -1; # endif break; # ifdef PULSEAUDIO case AUDIO_SYSTEM_PULSEAUDIO: lingot_audio_pulseaudio_new(result, device, sample_rate); # else lingot_msg_add_error( _("The application has not been built with PULSEAUDIO support")); result->audio_system = -1; # endif break; default: assert (0); } if (result->audio_system != -1 ) { // audio source read in floating point format. result->flt_read_buffer = malloc( result->read_buffer_size_samples * sizeof(FLT)); memset(result->flt_read_buffer, 0, result->read_buffer_size_samples * sizeof(FLT)); result->process_callback = process_callback; result->process_callback_arg = process_callback_arg; result->interrupted = 0; result->running = 0; } } void lingot_audio_destroy(LingotAudioHandler* audio) { switch (audio->audio_system) { # ifdef OSS case AUDIO_SYSTEM_OSS: lingot_audio_oss_destroy(audio); break; # endif # ifdef ALSA case AUDIO_SYSTEM_ALSA: lingot_audio_alsa_destroy(audio); break; # endif # ifdef JACK case AUDIO_SYSTEM_JACK: lingot_audio_jack_destroy(audio); break; # endif # ifdef PULSEAUDIO case AUDIO_SYSTEM_PULSEAUDIO: lingot_audio_pulseaudio_destroy(audio); break; # endif default: assert (0); } if (audio->flt_read_buffer != 0x0) { free(audio->flt_read_buffer); audio->flt_read_buffer = 0x0; } audio->audio_system = -1; } int lingot_audio_read(LingotAudioHandler* audio) { int samples_read = -1; switch (audio->audio_system) { # ifdef OSS case AUDIO_SYSTEM_OSS: samples_read = lingot_audio_oss_read(audio); break; # endif # ifdef ALSA case AUDIO_SYSTEM_ALSA: samples_read = lingot_audio_alsa_read(audio); break; # endif # ifdef PULSEAUDIO case AUDIO_SYSTEM_PULSEAUDIO: samples_read = lingot_audio_pulseaudio_read(audio); break; # endif default: assert (0); } //# define RATE_ESTIMATOR # ifdef RATE_ESTIMATOR static double samplerate_estimator = 0.0; static unsigned long read_samples = 0; static double elapsed_time = 0.0; struct timeval tdiff, t_abs; static struct timeval t_abs_old = { .tv_sec = 0, .tv_usec = 0 }; static FILE* fid = 0x0; if (fid == 0x0) { fid = fopen("/tmp/dump.txt", "w"); } gettimeofday(&t_abs, NULL ); if ((t_abs_old.tv_sec != 0) || (t_abs_old.tv_usec != 0)) { int i; for (i = 0; i < samples_read; i++) { fprintf(fid, "%f ", audio->flt_read_buffer[i]); // printf("%f ", audio->flt_read_buffer[i]); } // printf("\n"); timersub(&t_abs, &t_abs_old, &tdiff); read_samples = samples_read; elapsed_time = tdiff.tv_sec + 1e-6 * tdiff.tv_usec; static const double c = 0.9; samplerate_estimator = c * samplerate_estimator + (1 - c) * (read_samples / elapsed_time); // printf("estimated sample rate %f (read %i samples in %f seconds)\n", // samplerate_estimator, read_samples, elapsed_time); } t_abs_old = t_abs; # endif return samples_read; } int lingot_audio_get_audio_system_properties( LingotAudioSystemProperties* properties, audio_system_t audio_system) { switch (audio_system) { # ifdef OSS case AUDIO_SYSTEM_OSS: return lingot_audio_oss_get_audio_system_properties(properties); # endif # ifdef ALSA case AUDIO_SYSTEM_ALSA: return lingot_audio_alsa_get_audio_system_properties(properties); # endif # ifdef JACK case AUDIO_SYSTEM_JACK: return lingot_audio_jack_get_audio_system_properties(properties); # endif # ifdef PULSEAUDIO case AUDIO_SYSTEM_PULSEAUDIO: return lingot_audio_pulseaudio_get_audio_system_properties(properties); # endif default: assert (0); } return -1; } void lingot_audio_audio_system_properties_destroy( LingotAudioSystemProperties* properties) { int i; if (properties->devices != NULL) { for (i = 0; i < properties->n_devices; i++) { if (properties->devices[i] != NULL ) { free(properties->devices[i]); } } free(properties->devices); } } void lingot_audio_run_reading_thread(LingotAudioHandler* audio) { int samples_read = 0; while (audio->running) { // process new data block. samples_read = lingot_audio_read(audio); if (samples_read < 0) { audio->running = 0; audio->interrupted = 1; } else { audio->process_callback(audio->flt_read_buffer, samples_read, audio->process_callback_arg); } } pthread_mutex_lock(&audio->thread_input_read_mutex); pthread_cond_broadcast(&audio->thread_input_read_cond); pthread_mutex_unlock(&audio->thread_input_read_mutex); } int lingot_audio_start(LingotAudioHandler* audio) { int result = 0; switch (audio->audio_system) { case AUDIO_SYSTEM_JACK: # ifdef JACK result = lingot_audio_jack_start(audio); # else assert (0); # endif break; default: pthread_attr_init(&audio->thread_input_read_attr); // detached thread. // pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); pthread_mutex_init(&audio->thread_input_read_mutex, NULL ); pthread_cond_init(&audio->thread_input_read_cond, NULL ); pthread_attr_init(&audio->thread_input_read_attr); pthread_create(&audio->thread_input_read, &audio->thread_input_read_attr, (void* (*)(void*)) lingot_audio_run_reading_thread, audio); break; } if (result == 0) { audio->running = 1; } return result; } // function invoked when the audio thread must be cancelled void lingot_audio_cancel(LingotAudioHandler* audio) { // TODO: avoid fprintf(stderr, "warning: canceling audio thread\n"); switch (audio->audio_system) { # ifdef PULSEAUDIO case AUDIO_SYSTEM_PULSEAUDIO: lingot_audio_pulseaudio_cancel(audio); break; # endif default: break; } } void lingot_audio_stop(LingotAudioHandler* audio) { void* thread_result; int result; struct timeval tout, tout_abs; struct timespec tout_tspec; gettimeofday(&tout_abs, NULL ); tout.tv_sec = 0; tout.tv_usec = 500000; if (audio->running == 1) { audio->running = 0; switch (audio->audio_system) { case AUDIO_SYSTEM_JACK: # ifdef JACK lingot_audio_jack_stop(audio); # else assert (0); # endif break; // case AUDIO_SYSTEM_PULSEAUDIO: // pthread_join(audio->thread_input_read, &thread_result); // pthread_attr_destroy(&audio->thread_input_read_attr); // pthread_mutex_destroy(&audio->thread_input_read_mutex); // pthread_cond_destroy(&audio->thread_input_read_cond); // break; default: timeradd(&tout, &tout_abs, &tout_abs); tout_tspec.tv_sec = tout_abs.tv_sec; tout_tspec.tv_nsec = 1000 * tout_abs.tv_usec; // watchdog timer pthread_mutex_lock(&audio->thread_input_read_mutex); result = pthread_cond_timedwait(&audio->thread_input_read_cond, &audio->thread_input_read_mutex, &tout_tspec); pthread_mutex_unlock(&audio->thread_input_read_mutex); if (result == ETIMEDOUT) { pthread_cancel(audio->thread_input_read); lingot_audio_cancel(audio); } else { pthread_join(audio->thread_input_read, &thread_result); } pthread_attr_destroy(&audio->thread_input_read_attr); pthread_mutex_destroy(&audio->thread_input_read_mutex); pthread_cond_destroy(&audio->thread_input_read_cond); break; } } } lingot-1.0.1/src/lingot-gui-config-dialog-scale.c0000644000175000017500000005317513320113677016542 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "lingot-gui-config-dialog.h" #include "lingot-gui-config-dialog-scale.h" #include "lingot-msg.h" #include "lingot-i18n.h" enum { COLUMN_NAME = 0, COLUMN_SHIFT = 1, COLUMN_FREQUENCY = 2, NUM_COLUMNS = 3 }; void lingot_gui_config_dialog_scale_callback_change_deviation(GtkWidget *widget, LingotConfigDialog *dialog) { (void)widget; // Unused parameter. gtk_widget_queue_draw(GTK_WIDGET(dialog->scale_treeview)); } void lingot_gui_config_dialog_scale_callback_change_octave(GtkWidget *widget, LingotConfigDialog *dialog) { (void)widget; // Unused parameter. gtk_widget_queue_draw(GTK_WIDGET(dialog->scale_treeview)); } void lingot_gui_config_dialog_scale_tree_add_row_tree(gpointer data, GtkTreeView *treeview) { (void)data; // Unused parameter. GtkTreeModel *model; GtkTreeStore *model_store; GtkTreeIter iter1, iter2; gdouble freq; model = gtk_tree_view_get_model(treeview); model_store = (GtkTreeStore *) model; GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); if (gtk_tree_selection_count_selected_rows(selection) == 0) { gtk_tree_store_append(model_store, &iter2, NULL); } else { GList *list = gtk_tree_selection_get_selected_rows(selection, &model); int ipath = atoi(gtk_tree_path_to_string(list->data)); GString *fixed_path = g_string_new(""); g_string_printf(fixed_path, "%d", ipath); GtkTreePath *path = gtk_tree_path_new_from_string(fixed_path->str); g_string_free(fixed_path, TRUE); gboolean valid = FALSE; if (path) { if (gtk_tree_model_get_iter(model, &iter1, path)) { // get iter from specified path valid = TRUE; } else { // invalid path // g_error("Error!!!\n"); // TODO } gtk_tree_path_free(path); } else { // g_error("Error!!!\n"); // TODO } g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL); g_list_free(list); if (!valid) return; if (ipath == 0) { lingot_msg_add_warning( _("You cannot insert before the reference note.")); return; } // g_free(path_str); gtk_tree_store_insert_before(model_store, &iter2, NULL, &iter1); } gtk_tree_model_get_iter_first(model, &iter1); gtk_tree_model_get(model, &iter1, COLUMN_FREQUENCY, &freq, -1); gtk_tree_store_set(model_store, &iter2, COLUMN_NAME, "?", COLUMN_SHIFT, "1/1", COLUMN_FREQUENCY, freq, -1); } void lingot_gui_config_dialog_scale_tree_remove_selected_items(gpointer data, GtkTreeView *treeview) { (void)data; // Unused parameter. GtkTreeStore *store; GtkTreeModel *model; GtkTreeIter iter; GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); if (gtk_tree_selection_count_selected_rows(selection) == 0) return; GList *list = gtk_tree_selection_get_selected_rows(selection, &model); store = GTK_TREE_STORE(model); int nRemoved = 0; while (list) { int ipath = atoi(gtk_tree_path_to_string(list->data)); ipath -= nRemoved; GString *fixed_path = g_string_new(""); g_string_printf(fixed_path, "%d", ipath); GtkTreePath *path = gtk_tree_path_new_from_string(fixed_path->str); g_string_free(fixed_path, TRUE); if (path) { if (ipath != 0) { if (gtk_tree_model_get_iter(model, &iter, path)) { // get iter from specified path gtk_tree_store_remove(store, &iter); // remove item nRemoved++; } else { // invalid path // g_error("Error!!!\n"); // TODO } } gtk_tree_path_free(path); } else { // g_error("Error!!!\n"); // TODO } list = list->next; } g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL); g_list_free(list); } void lingot_gui_config_dialog_scale_tree_cell_edited_callback( GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer user_data) { (void)path_string; // Unused parameter. GtkTreeView *treeview; GtkTreeModel *model; GtkTreeStore *model_store; GtkTreeIter iter, iter2; GtkCellRenderer *renderer; char* shift_char; char* stored_shift_char; gdouble freq, stored_freq, base_freq, stored_shift; double shift_cents; short int shift_numerator, shift_denominator; gdouble shiftf2, freq2; char* char_pointer; char buff[512]; const char* delim = " \t\n"; LingotConfigDialog* config_dialog = (LingotConfigDialog*) user_data; int index; treeview = config_dialog->scale_treeview; model_store = (GtkTreeStore *) gtk_tree_view_get_model(treeview); GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); if (gtk_tree_selection_count_selected_rows(selection) != 1) return; GList *list = gtk_tree_selection_get_selected_rows(selection, &model); // model_store = GTK_TREE_STORE ( model ); int ipath = atoi(gtk_tree_path_to_string(list->data)); GString *fixed_path = g_string_new(""); g_string_printf(fixed_path, "%d", ipath); GtkTreePath *path = gtk_tree_path_new_from_string(fixed_path->str); g_string_free(fixed_path, TRUE); gboolean valid = FALSE; if (path) { if (gtk_tree_model_get_iter(model, &iter, path)) { // get iter from specified path valid = TRUE; } else { // invalid path // g_error("Error!!!\n"); // TODO } gtk_tree_path_free(path); } else { // g_error("Error!!!\n"); // TODO } g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL); g_list_free(list); if (!valid) return; renderer = &cell->parent; guint column_number = GPOINTER_TO_UINT( g_object_get_data( G_OBJECT(renderer), "my_column_num")); switch (column_number) { case COLUMN_NAME: { if (strchr(new_text, ' ') || strchr(new_text, '\t')) { lingot_msg_add_warning( _("Do not use space characters for the note names.")); } else if (strchr(new_text, '\n') || strchr(new_text, '{') || strchr(new_text, '}')) { lingot_msg_add_warning(_("The name contains illegal characters.")); } else { char_pointer = strtok(new_text, delim); gtk_tree_store_set(model_store, &iter, COLUMN_NAME, (char_pointer == NULL) ? "?" : new_text, -1); } } break; case COLUMN_SHIFT: { lingot_config_scale_parse_shift(new_text, &shift_cents, &shift_numerator, &shift_denominator); // TODO: full validation if ((ipath == 0) && (fabs(shift_cents - 0.0) > 1e-10)) { lingot_msg_add_warning( _("You cannot change the first shift, it must be 1/1.")); break; } if (isnan(shift_cents) || (shift_cents <= 0.0 - 1e-10) || (shift_cents > 1200.0)) { lingot_msg_add_warning( _( "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1.")); break; } gtk_tree_model_get(model, &iter, COLUMN_SHIFT, &stored_shift_char, COLUMN_FREQUENCY, &stored_freq, -1); lingot_config_scale_parse_shift(stored_shift_char, &stored_shift, NULL, NULL); free(stored_shift_char); lingot_config_scale_format_shift(buff, shift_cents, shift_numerator, shift_denominator); gtk_tree_store_set(model_store, &iter, COLUMN_SHIFT, buff, COLUMN_FREQUENCY, stored_freq * pow(2.0, (shift_cents - stored_shift) / 1200.0), -1); } break; case COLUMN_FREQUENCY: { if (!strcmp(new_text, _("mid-A"))) { freq = MID_A_FREQUENCY; } else if (!strcmp(new_text, _("mid-C"))) { freq = MID_C_FREQUENCY; } else { sscanf(new_text, "%lg", &freq); // TODO: validation } gtk_tree_model_get(model, &iter, COLUMN_SHIFT, &shift_char, COLUMN_FREQUENCY, &stored_freq, -1); lingot_config_scale_parse_shift(shift_char, &shift_cents, NULL, NULL); free(shift_char); freq *= pow(2.0, -gtk_spin_button_get_value(config_dialog->root_frequency_error) / 1200.0 - (gtk_combo_box_get_active( GTK_COMBO_BOX(config_dialog->octave)) - 4)); base_freq = freq * pow(2.0, -shift_cents / 1200.0); gtk_tree_model_get_iter_first(model, &iter2); index = 0; do { gtk_tree_model_get(model, &iter2, COLUMN_SHIFT, &shift_char, -1); lingot_config_scale_parse_shift(shift_char, &shiftf2, NULL, NULL); free(shift_char); freq2 = base_freq * pow(2.0, shiftf2 / 1200.0); gtk_tree_store_set(model_store, &iter2, COLUMN_FREQUENCY, (index == ipath) ? freq : freq2, -1); index++; } while (gtk_tree_model_iter_next(model, &iter2)); //gtk_spin_button_set_value(config_dialog->root_frequency_error, 0.0); } break; } } void lingot_gui_config_dialog_scale_tree_frequency_cell_data_function( GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { (void)col; // Unused parameter. gdouble freq; gchar buf[20]; LingotConfigDialog* config_dialog = (LingotConfigDialog*) user_data; gtk_tree_model_get(model, iter, COLUMN_FREQUENCY, &freq, -1); freq *= pow(2.0, gtk_spin_button_get_value(config_dialog->root_frequency_error) / 1200.0 + (gtk_combo_box_get_active( GTK_COMBO_BOX(config_dialog->octave)) - 4)); if (fabs(freq - MID_A_FREQUENCY) < 1e-3) { g_object_set(renderer, "text", _("mid-A"), NULL); } else if (fabs(freq - MID_C_FREQUENCY) < 1e-3) { g_object_set(renderer, "text", _("mid-C"), NULL); } else { g_snprintf(buf, sizeof(buf), "%.4f", freq); g_object_set(renderer, "text", buf, NULL); } } void lingot_gui_config_dialog_scale_tree_add_column( LingotConfigDialog* config_dialog) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkTreeView *treeview = config_dialog->scale_treeview; column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, _("Name")); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_tree_view_column_set_attributes(column, renderer, "text", COLUMN_NAME, NULL); g_object_set(renderer, "editable", TRUE, NULL); g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(COLUMN_NAME)); g_signal_connect(renderer, "edited", (GCallback ) lingot_gui_config_dialog_scale_tree_cell_edited_callback, config_dialog); gtk_tree_view_append_column(treeview, column); column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, _("Shift")); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_tree_view_column_set_attributes(column, renderer, "text", COLUMN_SHIFT, NULL); g_object_set(renderer, "editable", TRUE, NULL); g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(COLUMN_SHIFT)); // gtk_tree_view_column_set_cell_data_func(column, renderer, // lingot_config_dialog_scale_tree_shift_cell_data_function, NULL, // NULL); g_signal_connect(renderer, "edited", (GCallback ) lingot_gui_config_dialog_scale_tree_cell_edited_callback, config_dialog); gtk_tree_view_append_column(treeview, column); column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, _("Frequency [Hz]")); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_tree_view_column_set_attributes(column, renderer, "text", COLUMN_FREQUENCY, NULL); g_object_set(renderer, "editable", TRUE, NULL); g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(COLUMN_FREQUENCY)); gtk_tree_view_column_set_cell_data_func(column, renderer, lingot_gui_config_dialog_scale_tree_frequency_cell_data_function, config_dialog, NULL); g_signal_connect(renderer, "edited", (GCallback ) lingot_gui_config_dialog_scale_tree_cell_edited_callback, config_dialog); gtk_tree_view_append_column(treeview, column); } int lingot_gui_config_dialog_scale_validate(const LingotConfigDialog* dialog, const LingotScale* scale) { (void)scale; // Unused parameter. GtkTreeIter iter, iter2; GtkTreeModel* model = gtk_tree_view_get_model(dialog->scale_treeview); char* name; char* name2; char* shift_char; gdouble shift, last_shift; int empty_names = 0; gtk_tree_model_get_iter_first(model, &iter); last_shift = -1.0; // TODO: full validation int row1 = 0; do { gtk_tree_model_get(model, &iter, COLUMN_NAME, &name, COLUMN_SHIFT, &shift_char, -1); lingot_config_scale_parse_shift(shift_char, &shift, NULL, NULL); free(shift_char); if (!strcmp(name, "") || !strcmp(name, "?")) { empty_names = 1; } gtk_tree_model_get_iter_first(model, &iter2); int row2 = 0; do { gtk_tree_model_get(model, &iter2, COLUMN_NAME, &name2, -1); if ((row1 != row2) && !strcmp(name, name2)) { lingot_msg_add_error(_("There are notes with the same name")); // TODO: select the conflictive line free(name); free(name2); return 0; } free(name2); row2++; } while (gtk_tree_model_iter_next(model, &iter2)); free(name); if (shift < last_shift) { lingot_msg_add_error( _("There are invalid values in the scale: the notes should be ordered by frequency / shift")); // TODO: select the conflictive line return 0; } if (shift >= 1200.0) { lingot_msg_add_error( _("There are invalid values in the scale: all the notes should be in the same octave")); return 0; } last_shift = shift; row1++; } while (gtk_tree_model_iter_next(model, &iter)); if (empty_names) { lingot_msg_add_warning(_("There are notes without name")); return 0; } return 1; } void lingot_gui_config_dialog_scale_gui_to_data(const LingotConfigDialog* dialog, LingotScale* scale) { GtkTreeIter iter; GtkTreeModel* model = gtk_tree_view_get_model(dialog->scale_treeview); gdouble freq, shift; short int shift_num, shift_den; char* shift_char; gchar* name; int i = 0; int rows = gtk_tree_model_iter_n_children(model, NULL); gtk_tree_model_get_iter_first(model, &iter); gtk_tree_model_get(model, &iter, COLUMN_FREQUENCY, &freq, -1); scale->name = strdup(gtk_entry_get_text(dialog->scale_name)); scale->base_frequency = freq; lingot_config_scale_allocate(scale, rows); do { gtk_tree_model_get(model, &iter, COLUMN_NAME, &name, COLUMN_SHIFT, &shift_char, -1); lingot_config_scale_parse_shift(shift_char, &shift, &shift_num, &shift_den); free(shift_char); scale->note_name[i] = name; scale->offset_cents[i] = shift; scale->offset_ratios[0][i] = shift_num; scale->offset_ratios[1][i] = shift_den; i++; } while (gtk_tree_model_iter_next(model, &iter)); } void lingot_gui_config_dialog_scale_data_to_gui(LingotConfigDialog* dialog, const LingotScale* scale) { gtk_entry_set_text(dialog->scale_name, scale->name); GtkTreeStore* store = (GtkTreeStore *) gtk_tree_view_get_model( dialog->scale_treeview); gtk_tree_store_clear(store); GtkTreeIter iter2; char buff[512]; int i; for (i = 0; i < scale->notes; i++) { gtk_tree_store_append(store, &iter2, NULL); FLT freq = scale->base_frequency * pow(2.0, scale->offset_cents[i] / 1200.0); lingot_config_scale_format_shift(buff, scale->offset_cents[i], scale->offset_ratios[0][i], scale->offset_ratios[1][i]); gtk_tree_store_set(store, &iter2, COLUMN_NAME, scale->note_name[i], COLUMN_SHIFT, buff, COLUMN_FREQUENCY, freq, -1); } } void lingot_gui_config_dialog_import_scl(gpointer data, LingotConfigDialog* config_dialog) { (void)data; // Unused parameter. GtkWidget * dialog = gtk_file_chooser_dialog_new(_("Open Scale File"), GTK_WINDOW(config_dialog->win), GTK_FILE_CHOOSER_ACTION_OPEN, "_Cancel", GTK_RESPONSE_CANCEL, "_Open", GTK_RESPONSE_ACCEPT, NULL); GtkFileFilter *filefilter; filefilter = gtk_file_filter_new(); static gchar* filechooser_last_folder = NULL; gtk_file_filter_set_name(filefilter, (const gchar *) _("Scala files")); gtk_file_filter_add_pattern(filefilter, "*.scl"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filefilter); if (filechooser_last_folder != NULL) { gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), filechooser_last_folder); } if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char *filename; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); if (filechooser_last_folder != NULL) { free(filechooser_last_folder); filechooser_last_folder = NULL; } if (gtk_file_chooser_get_current_folder( GTK_FILE_CHOOSER(dialog)) != NULL) { filechooser_last_folder = strdup( gtk_file_chooser_get_current_folder( GTK_FILE_CHOOSER(dialog))); } // TODO LingotScale scale; lingot_config_scale_new(&scale); if (lingot_config_scale_load_scl(&scale, filename)) { lingot_gui_config_dialog_scale_data_to_gui(config_dialog, &scale); } lingot_config_scale_destroy(&scale); g_free(filename); } gtk_widget_destroy(dialog); //g_free(filefilter); } gint lingot_gui_config_dialog_scale_key_press_cb(GtkWidget *widget, GdkEventKey *kevent, gpointer data) { (void)widget; // Unused parameter. LingotConfigDialog* dialog = (LingotConfigDialog*) data; if (kevent->type == GDK_KEY_PRESS) { if (kevent->keyval == 0xffff) { g_signal_emit_by_name(G_OBJECT(dialog->button_scale_del), "clicked", NULL); } else if (kevent->keyval == 0xff63) { g_signal_emit_by_name(G_OBJECT(dialog->button_scale_add), "clicked", NULL); } } return TRUE; } gint lingot_gui_config_dialog_scale_tree_view_column_get_index( GtkTreeViewColumn *column) { GtkTreeView *tree = GTK_TREE_VIEW( gtk_tree_view_column_get_tree_view(column)); GList *cols = gtk_tree_view_get_columns(tree); int counter = 0; while (cols != NULL) { if (column == GTK_TREE_VIEW_COLUMN(cols->data)) { g_list_free(cols); return counter; } cols = cols->next; counter++; } g_list_free(cols); return -1; } gboolean lingot_gui_config_dialog_scale_table_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) { (void)keyboard_mode; // Unused parameter. (void)user_data; // Unused parameter. GtkTreePath* path; GtkTreeViewColumn* col; gint cx, cy; gtk_tree_view_get_path_at_pos((GtkTreeView*) widget, x, y, &path, &col, &cx, &cy); gint column_index = lingot_gui_config_dialog_scale_tree_view_column_get_index(col); switch (column_index) { case COLUMN_NAME: gtk_tooltip_set_text(tooltip, _( "Note identifier, free text that will be displayed in the main window when tuning close to the given note. Don't use space characters here.")); break; case COLUMN_SHIFT: gtk_tooltip_set_text(tooltip, _( "Shift. You can define it as a deviation in cents from the reference note (the first one), or as a frequency ratio, like '3/2' or '5/4'. All the values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all the notes must be in the same octave), and they must be well ordered.")); break; case COLUMN_FREQUENCY: { char buff[600]; snprintf(buff, sizeof(buff), _( "Frequency. You can enter here the absolute frequency for a given note as a reference, and all the other frequencies will shift according to the deviations specified in the 'Shift' column. You can either use an absolute numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those keywords are normally reserved for the 4th octave (try to assign frequencies only to the 4th octave)."), _("mid-C"), _("mid-A")); gtk_tooltip_set_text(tooltip, buff); } break; } return TRUE; } void lingot_gui_config_dialog_scale_show(LingotConfigDialog* dialog, GtkBuilder* builder) { dialog->scale_name = GTK_ENTRY( gtk_builder_get_object(builder, "scale_name")); GtkWidget* scroll = GTK_WIDGET( gtk_builder_get_object(builder, "scrolledwindow1")); /* crea el modelo del arbol */ GtkTreeStore *model_store = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE); GtkTreeModel* model = GTK_TREE_MODEL(model_store); /* crea un nuevo widget gtktreeview */ dialog->scale_treeview = GTK_TREE_VIEW(gtk_tree_view_new()); /* agrega columnas al modelo del arbol */ lingot_gui_config_dialog_scale_tree_add_column(dialog); /* asocia el modelo al gtkteeview */ gtk_tree_view_set_model(dialog->scale_treeview, model); gtk_tree_selection_set_mode( gtk_tree_view_get_selection(dialog->scale_treeview), GTK_SELECTION_MULTIPLE); g_object_unref(G_OBJECT(model)); gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(dialog->scale_treeview)); dialog->button_scale_del = GTK_BUTTON( gtk_builder_get_object(builder, "button_scale_del")); dialog->button_scale_add = GTK_BUTTON( gtk_builder_get_object(builder, "button_scale_add")); GtkButton* button_import = GTK_BUTTON( gtk_builder_get_object(builder, "button_scale_import")); g_signal_connect(G_OBJECT(dialog->scale_treeview), "key_press_event", G_CALLBACK(lingot_gui_config_dialog_scale_key_press_cb), dialog); g_signal_connect(G_OBJECT(dialog->button_scale_add), "clicked", G_CALLBACK( lingot_gui_config_dialog_scale_tree_add_row_tree), dialog->scale_treeview); g_signal_connect(G_OBJECT(dialog->button_scale_del), "clicked", G_CALLBACK( lingot_gui_config_dialog_scale_tree_remove_selected_items), dialog->scale_treeview); g_signal_connect(G_OBJECT(button_import), "clicked", G_CALLBACK( lingot_gui_config_dialog_import_scl), dialog); gtk_widget_set_has_tooltip(GTK_WIDGET(dialog->scale_treeview), TRUE); g_signal_connect(G_OBJECT(dialog->scale_treeview), "query-tooltip", (GCallback ) lingot_gui_config_dialog_scale_table_query_tooltip, NULL); } lingot-1.0.1/src/lingot-config.h0000644000175000017500000000630013320113677013427 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_CONFIG_H__ #define __LINGOT_CONFIG_H__ #include "lingot-defs.h" #include "lingot-config-scale.h" typedef enum audio_system_t { AUDIO_SYSTEM_OSS = 0, AUDIO_SYSTEM_ALSA = 1, AUDIO_SYSTEM_JACK = 2, AUDIO_SYSTEM_PULSEAUDIO = 3 } audio_system_t; typedef enum window_type_t { NONE = 0, // HANNING = 1, // HAMMING = 2 } window_type_t; // Configuration struct. Determines the tuner behaviour. // Some parameters are internal only. typedef struct { audio_system_t audio_system; char audio_dev[4][512]; int sample_rate; // hardware sample rate. unsigned int oversampling; // oversampling factor. FLT root_frequency_error; // deviation of the above root frequency. FLT min_frequency; // minimum frequency of the instrument. FLT max_frequency; // maximum frequency of the instrument. int optimize_internal_parameters; FLT internal_min_frequency; // minimum valid frequency. FLT internal_max_frequency; // maximum frequency we want to tune. unsigned int fft_size; // number of samples of the FFT. FLT calculation_rate; FLT visualization_rate; FLT temporal_window; // duration in seconds of the temporal window. // samples stored in the temporal window (internal parameter). unsigned int temporal_buffer_size; // minimum SNR required for the overall set of peaks and for each peak FLT min_overall_SNR; // dB FLT min_SNR; // dB window_type_t window_type; // frequency finding algorithm configuration //------------------------------------------- unsigned int peak_number; // number of maximum peaks considered. // number of adjacent samples needed to consider a peak. unsigned int peak_half_width; // max iterations for Newton-Raphson algorithm. unsigned int max_nr_iter; //---------------------------------------------------------------------------- // gauge rest value. (gauge contemplates [-0.5, 0.5]) FLT gauge_rest_value; //---------------------------------------------------------------------------- LingotScale scale; } LingotConfig; void lingot_config_new(LingotConfig*); void lingot_config_destroy(LingotConfig*); void lingot_config_copy(LingotConfig* dst, const LingotConfig* src); // back to default configuration. void lingot_config_restore_default_values(LingotConfig*); // derivate internal parameters from external ones. void lingot_config_update_internal_params(LingotConfig*); #endif // __LINGOT_CONFIG_H__ lingot-1.0.1/src/lingot-audio-alsa.c0000644000175000017500000002531713320113677014205 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef ALSA #include #include #include "lingot-defs.h" #include "lingot-audio-alsa.h" #include "lingot-i18n.h" #include "lingot-msg.h" snd_pcm_format_t sample_format = SND_PCM_FORMAT_FLOAT; static const unsigned int channels = 1; void lingot_audio_alsa_new(LingotAudioHandler* audio, const char* device, int sample_rate) { const char* exception; snd_pcm_hw_params_t* hw_params = NULL; int err; char error_message[1000]; audio->audio_system = AUDIO_SYSTEM_ALSA; if (sample_rate >= 44100) { audio->read_buffer_size_samples = 1024; } else if (sample_rate >= 22050) { audio->read_buffer_size_samples = 512; } else { audio->read_buffer_size_samples = 256; } // ALSA allocates some mem to load its config file when we call // snd_card_next. Now that we're done getting the info, let's tell ALSA // to unload the info and free up that mem snd_config_update_free_global(); audio->capture_handle = NULL; try { if ((err = snd_pcm_open(&audio->capture_handle, device, SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) { snprintf(error_message, sizeof(error_message), _("Cannot open audio device '%s'.\n%s"), device, snd_strerror(err)); throw(error_message); } strcpy(audio->device, device); if ((err = snd_pcm_hw_params_malloc(&hw_params)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot initialize hardware parameter structure."), snd_strerror(err)); throw(error_message); } if ((err = snd_pcm_hw_params_any(audio->capture_handle, hw_params)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot initialize hardware parameter structure."), snd_strerror(err)); throw(error_message); } if ((err = snd_pcm_hw_params_set_access(audio->capture_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot set access type."), snd_strerror(err)); throw(error_message); } if ((err = snd_pcm_hw_params_set_format(audio->capture_handle, hw_params, sample_format)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot set sample format."), snd_strerror(err)); throw(error_message); } unsigned int rate = sample_rate; if ((err = snd_pcm_hw_params_set_rate_near(audio->capture_handle, hw_params, &rate, 0)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot set sample rate."), snd_strerror(err)); throw(error_message); } audio->real_sample_rate = rate; if ((err = snd_pcm_hw_params_set_channels(audio->capture_handle, hw_params, channels)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot set channel number."), snd_strerror(err)); throw(error_message); } if ((err = snd_pcm_hw_params(audio->capture_handle, hw_params)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot set parameters."), snd_strerror(err)); throw(error_message); } if ((err = snd_pcm_prepare(audio->capture_handle)) < 0) { snprintf(error_message, sizeof(error_message), "%s\n%s", _("Cannot prepare audio interface for use."), snd_strerror(err)); throw(error_message); } audio->bytes_per_sample = snd_pcm_format_size(sample_format, 1); }catch { if (audio->capture_handle != NULL) snd_pcm_close(audio->capture_handle); audio->audio_system = -1; lingot_msg_add_error_with_code(exception, -err); } if (hw_params != NULL) snd_pcm_hw_params_free(hw_params); } void lingot_audio_alsa_destroy(LingotAudioHandler* audio) { if (audio->audio_system == AUDIO_SYSTEM_ALSA) { snd_pcm_close(audio->capture_handle); } } int lingot_audio_alsa_read(LingotAudioHandler* audio) { int samples_read = -1; char buffer [channels * audio->read_buffer_size_samples * audio->bytes_per_sample]; samples_read = snd_pcm_readi(audio->capture_handle, buffer, audio->read_buffer_size_samples); if (samples_read == -EAGAIN) { usleep(200); // TODO: size up samples_read = 0; } else { if (samples_read < 0) { char buff[250]; snprintf(buff, sizeof(buff), "%s\n%s", _("Read from audio interface failed."), snd_strerror(samples_read)); lingot_msg_add_error_with_code(buff, -samples_read); } else { int i; // float point conversion switch (sample_format) { case SND_PCM_FORMAT_S16: { int16_t* read_buffer = (int16_t*) buffer; for (i = 0; i < samples_read; i++) { audio->flt_read_buffer[i] = read_buffer[i]; } break; } case SND_PCM_FORMAT_FLOAT: { float* read_buffer = (float*) buffer; for (i = 0; i < samples_read; i++) { audio->flt_read_buffer[i] = read_buffer[i] * FLT_SAMPLE_SCALE; } break; } case SND_PCM_FORMAT_FLOAT64: { double* read_buffer = (double*) buffer; for (i = 0; i < samples_read; i++) { audio->flt_read_buffer[i] = read_buffer[i] * FLT_SAMPLE_SCALE; } break; } default: break; } } } return samples_read; } int lingot_audio_alsa_get_audio_system_properties( LingotAudioSystemProperties* result) { result->forced_sample_rate = 0; result->n_devices = 0; result->devices = NULL; result->n_sample_rates = 5; result->sample_rates[0] = 8000; result->sample_rates[1] = 11025; result->sample_rates[2] = 22050; result->sample_rates[3] = 44100; result->sample_rates[4] = 48000; int status; int card_index = -1; char* card_shortname = NULL; const char* exception; char error_message[1000]; char device_name[512]; int device_index = -1; int subdevice_count, subdevice_index; snd_ctl_t *card_handler; snd_pcm_info_t *pcm_info; // linked list struct for storing the capture device names struct device_name_node_t { char* name; struct device_name_node_t* next; }; struct device_name_node_t* device_names_first = (struct device_name_node_t*) malloc( sizeof(struct device_name_node_t)); struct device_name_node_t* device_names_last = device_names_first; // the first record is the default device char buff[512]; snprintf(buff, sizeof(buff), "%s ", _("Default Device")); device_names_first->name = strdup(buff); device_names_first->next = NULL; try { result->n_devices = 1; try { for (;;) { if ((status = snd_card_next(&card_index)) < 0) { snprintf(error_message, sizeof(error_message), "warning: cannot determine card number: %s", snd_strerror(status)); throw(error_message); } if (card_index < 0) { if (result->n_devices == 0) { snprintf(error_message, sizeof(error_message), "warning: no sound cards detected"); throw(error_message); } break; } if ((status = snd_card_get_name(card_index, &card_shortname)) < 0) { snprintf(error_message, sizeof(error_message), "warning: cannot determine card short name: %s", snd_strerror(status)); throw(error_message); } sprintf(device_name, "hw:%i", card_index); if ((status = snd_ctl_open(&card_handler, device_name, 0)) < 0) { snprintf(error_message, sizeof(error_message), "warning: can't open card %i: %s\n", card_index, snd_strerror(status)); throw(error_message); } for (device_index = -1;;) { if ((status = snd_ctl_pcm_next_device(card_handler, &device_index)) < 0) { snprintf(error_message, sizeof(error_message), "warning: can't get next PCM device: %s\n", snd_strerror(status)); throw(error_message); } if (device_index < 0) break; snd_pcm_info_malloc(&pcm_info); memset(pcm_info, 0, snd_pcm_info_sizeof()); snd_pcm_info_set_device(pcm_info, device_index); // only search for capture devices snd_pcm_info_set_stream(pcm_info, SND_PCM_STREAM_CAPTURE); subdevice_index = -1; subdevice_count = 1; while (++subdevice_index < subdevice_count) { snd_pcm_info_set_subdevice(pcm_info, subdevice_index); if ((status = snd_ctl_pcm_info(card_handler, pcm_info)) < 0) { fprintf(stderr, "warning: can't get info for subdevice hw:%i,%i,%i: %s\n", card_index, device_index, subdevice_index, snd_strerror(status)); continue; } if (!subdevice_index) { subdevice_count = snd_pcm_info_get_subdevices_count( pcm_info); } if (subdevice_count > 1) { snprintf(device_name, sizeof(device_name), "%s ", card_shortname, card_index, device_index, subdevice_index); } else { snprintf(device_name, sizeof(device_name), "%s ", card_shortname, card_index, device_index); } result->n_devices++; struct device_name_node_t* new_name_node = (struct device_name_node_t*) malloc( sizeof(struct device_name_node_t*)); new_name_node->name = strdup(device_name); new_name_node->next = NULL; if (device_names_first == NULL) { device_names_first = new_name_node; } else { device_names_last->next = new_name_node; } device_names_last = new_name_node; } snd_pcm_info_free(pcm_info); } snd_ctl_close(card_handler); } }catch { result->n_devices = 1; throw(exception); } // copy the device names list result->devices = (char**) malloc(result->n_devices * sizeof(char*)); struct device_name_node_t* name_node_current = device_names_first; for (device_index = 0; device_index < result->n_devices; device_index++) { result->devices[device_index] = name_node_current->name; name_node_current = name_node_current->next; } } catch { fprintf(stderr, "%s", exception); } // dispose the device names list struct device_name_node_t* name_node_current; for (name_node_current = device_names_first; name_node_current != NULL;) { struct device_name_node_t* name_node_previous = name_node_current; name_node_current = name_node_current->next; free(name_node_previous); } return 0; } #endif lingot-1.0.1/src/lingot-config-scale.c0000644000175000017500000002177013320113677014517 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include "lingot-config-scale.h" #include "lingot-i18n.h" #include "lingot-msg.h" void lingot_config_scale_new(LingotScale* scale) { scale->name = NULL; scale->notes = 0; scale->note_name = NULL; scale->offset_cents = NULL; scale->offset_ratios[0] = NULL; scale->offset_ratios[1] = NULL; scale->base_frequency = 0.0; } void lingot_config_scale_allocate(LingotScale* scale, unsigned short int notes) { scale->notes = notes; scale->note_name = malloc(notes * sizeof(char*)); unsigned int i = 0; for (i = 0; i < notes; i++) { scale->note_name[i] = NULL; } scale->offset_cents = malloc(notes * sizeof(FLT)); scale->offset_ratios[0] = malloc(notes * sizeof(short int)); scale->offset_ratios[1] = malloc(notes * sizeof(short int)); } void lingot_config_scale_destroy(LingotScale* scale) { unsigned short int i; for (i = 0; i < scale->notes; i++) { free(scale->note_name[i]); } free(scale->offset_cents); free(scale->offset_ratios[0]); free(scale->offset_ratios[1]); free(scale->note_name); free(scale->name); scale->name = NULL; scale->notes = 0; scale->note_name = NULL; scale->offset_cents = NULL; scale->offset_ratios[0] = NULL; scale->offset_ratios[1] = NULL; scale->base_frequency = 0.0; } void lingot_config_scale_restore_default_values(LingotScale* scale) { unsigned short int i; const char* tone_string[] = { _("C"), _("C#"), _("D"), _("D#"), _("E"), _("F"), _("F#"), _("G"), _("G#"), _("A"), _("A#"), _("B"), }; lingot_config_scale_destroy(scale); // default 12 tones equal-tempered scale hard-coded scale->name = strdup(_("Default equal-tempered scale")); lingot_config_scale_allocate(scale, 12); scale->base_frequency = MID_C_FREQUENCY; scale->note_name[0] = strdup(tone_string[0]); scale->offset_cents[0] = 0.0; scale->offset_ratios[0][0] = 1; scale->offset_ratios[1][0] = 1; // 1/1 for (i = 1; i < scale->notes; i++) { scale->note_name[i] = strdup(tone_string[i]); scale->offset_cents[i] = 100.0 * i; scale->offset_ratios[0][i] = -1; // not used scale->offset_ratios[1][i] = -1; // not used } } void lingot_config_scale_copy(LingotScale* dst, const LingotScale* src) { unsigned short int i; lingot_config_scale_destroy(dst); *dst = *src; dst->name = strdup(src->name); lingot_config_scale_allocate(dst, dst->notes); for (i = 0; i < dst->notes; i++) { dst->note_name[i] = strdup(src->note_name[i]); dst->offset_cents[i] = src->offset_cents[i]; dst->offset_ratios[0][i] = src->offset_ratios[0][i]; dst->offset_ratios[1][i] = src->offset_ratios[1][i]; } } int lingot_config_scale_get_octave(const LingotScale* scale, int index) { return (index < 0) ? ((index + 1) / scale->notes) - 1 : index / scale->notes; } int lingot_config_scale_get_note_index(const LingotScale* scale, int index) { int r = index % scale->notes; return r < 0 ? r + scale->notes : r; } FLT lingot_config_scale_get_absolute_offset(const LingotScale* scale, int index) { return lingot_config_scale_get_octave(scale, index) * 1200.0 + scale->offset_cents[lingot_config_scale_get_note_index(scale, index)]; } FLT lingot_config_scale_get_frequency(const LingotScale* scale, int index) { return scale->base_frequency * pow(2.0, lingot_config_scale_get_absolute_offset(scale, index) / 1200.0); } int lingot_config_scale_get_closest_note_index(const LingotScale* scale, FLT freq, FLT deviation, FLT* error_cents) { short note_index = 0; short int index; FLT offset = 1200.0 * log2(freq / scale->base_frequency) - deviation; int octave = 0; octave = floor(offset / 1200); offset = fmod(offset, 1200.0); if (offset < 0.0) { offset += 1200.0; } index = floor(scale->notes * offset / 1200.0); // TODO: bisection?, avoid loop? FLT pitch_inf; FLT pitch_sup; int n = 0; for (;;) { n++; pitch_inf = scale->offset_cents[index]; pitch_sup = ((index + 1) < scale->notes) ? scale->offset_cents[index + 1] : 1200.0; if (offset > pitch_sup) { index++; continue; } if (offset < pitch_inf) { index--; continue; } break; }; if (fabs(offset - pitch_inf) < fabs(offset - pitch_sup)) { note_index = index; *error_cents = offset - pitch_inf; } else { note_index = index + 1; *error_cents = offset - pitch_sup; } if (note_index == scale->notes) { note_index = 0; octave++; } note_index += octave * scale->notes; return note_index; } int lingot_config_scale_parse_shift(char* char_buffer, double* cents, short int* numerator, short int* denominator) { static const char* delim = "/"; char* char_buffer_pointer1 = strtok(char_buffer, delim); char* char_buffer_pointer2 = strtok(NULL, delim); short int num, den; int result = 1; if (numerator != NULL) { *numerator = -1; } if (denominator != NULL) { *denominator = -1; } int n = 0; if (!char_buffer_pointer2) { if (!char_buffer_pointer1) { result = 0; } else { n = sscanf(char_buffer_pointer1, "%lf", cents); if (!n) { result = 0; } } } else { n = sscanf(char_buffer_pointer1, "%hd", &num); if (!n) { result = 0; } else { n = sscanf(char_buffer_pointer2, "%hd", &den); if (!n) { result = 0; } else { *cents = 1200.0 * log2(1.0 * num / den); if (numerator != NULL) { *numerator = num; } if (denominator != NULL) { *denominator = den; } } } } if (!result) { *numerator = 1; *denominator = 1; *cents = 0.0; } return result; } void lingot_config_scale_format_shift(char* char_buffer, double cents, short int numerator, short int denominator) { if (numerator < 0) { sprintf(char_buffer, "%0.4lf", cents); } else { sprintf(char_buffer, "%hd/%hd", numerator, denominator); } } int lingot_config_scale_load_scl(LingotScale* scale, char* filename) { FILE* fp; int i; char* char_buffer_pointer1; char* nl; static const char* delim = " \t\n"; int result = 1; int line = 0; const char* error_format_msg = _("incorrect format"); const char* error_note_number_msg = _("note number mismatch"); const char* exception; # define MAX_LINE_SIZE 1000 char char_buffer[MAX_LINE_SIZE]; if ((fp = fopen(filename, "r")) == NULL) { char buff[1000]; snprintf(buff, sizeof(buff), "%s\n%s", _("Error opening scale file."), strerror(errno)); lingot_msg_add_error(buff); return 0; } scale->base_frequency = MID_C_FREQUENCY; try { line++; if (!fgets(char_buffer, MAX_LINE_SIZE, fp)) { throw(error_format_msg); } if (strchr(char_buffer, '!') != char_buffer) { throw(error_format_msg); } line++; if (!fgets(char_buffer, MAX_LINE_SIZE, fp)) { throw(error_format_msg); } line++; if (!fgets(char_buffer, MAX_LINE_SIZE, fp)) { throw(error_format_msg); } nl = strrchr(char_buffer, '\r'); if (nl) *nl = '\0'; nl = strrchr(char_buffer, '\n'); if (nl) *nl = '\0'; scale->name = strdup(char_buffer); line++; if (!fgets(char_buffer, MAX_LINE_SIZE, fp)) { throw(error_format_msg); } sscanf(char_buffer, "%hu", &scale->notes); line++; if (!fgets(char_buffer, MAX_LINE_SIZE, fp)) { throw(error_format_msg); } lingot_config_scale_allocate(scale, scale->notes); scale->note_name[0] = strdup("1"); scale->offset_cents[0] = 0.0; scale->offset_ratios[0][0] = 1; scale->offset_ratios[1][0] = 1; // 1/1 for (i = 1; i < scale->notes; i++) { line++; if (!fgets(char_buffer, MAX_LINE_SIZE, fp)) { throw(error_note_number_msg); } char_buffer_pointer1 = strtok(char_buffer, delim); if (char_buffer_pointer1 == NULL) { throw(error_note_number_msg); } int r = lingot_config_scale_parse_shift(char_buffer_pointer1, &scale->offset_cents[i], &scale->offset_ratios[0][i], &scale->offset_ratios[1][i]); if (!r) { throw(error_format_msg); } else { if (scale->offset_cents[i] <= scale->offset_cents[i - 1]) { throw(_("the notes must be well ordered")); } } sprintf(char_buffer, "%d", i + 1); scale->note_name[i] = strdup(char_buffer); } } catch { result = 0; char buff[1000]; snprintf(buff, sizeof(buff), "%s, line %i: %s", _("Error opening scale file"), line, exception); lingot_msg_add_error(buff); } fclose(fp); # undef MAX_LINE_SIZE return result; } lingot-1.0.1/src/lingot-audio-pulseaudio.c0000644000175000017500000002366713320113677015445 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef PULSEAUDIO #include #include #include "lingot-defs.h" #include "lingot-audio-pulseaudio.h" #include "lingot-i18n.h" #include "lingot-msg.h" #include static int num_channels = 1; static pa_sample_spec ss; void lingot_audio_pulseaudio_new(LingotAudioHandler* audio, const char* device, int sample_rate) { audio->pa_client = 0; strcpy(audio->device, ""); // sample_rate = 44100; audio->real_sample_rate = sample_rate; audio->audio_system = AUDIO_SYSTEM_PULSEAUDIO; if (sample_rate >= 44100) { audio->read_buffer_size_samples = 2048; } else if (sample_rate >= 22050) { audio->read_buffer_size_samples = 1024; } else { audio->read_buffer_size_samples = 512; } int error; // ss.format = PA_SAMPLE_S16NE; ss.format = PA_SAMPLE_FLOAT32; // TODO: config? ss.channels = num_channels; ss.rate = sample_rate; // printf("sr %i, real sr %i, format = %i\n", ss.rate, audio->real_sample_rate, ss.format); audio->bytes_per_sample = pa_sample_size(&ss); pa_buffer_attr buff; buff.maxlength = -1; buff.fragsize = num_channels * audio->read_buffer_size_samples * audio->bytes_per_sample; const char* device_name = device; if (!strcmp(device_name, "default") || !strcmp(device_name, "")) { device_name = NULL; } audio->pa_client = pa_simple_new(NULL, // Use the default server. "Lingot", // Our application's name. PA_STREAM_RECORD, // device_name, // "Lingot record thread", // Description of our stream. &ss, // sample format. NULL, // Use default channel map &buff, // &error); if (!audio->pa_client) { char buff[512]; snprintf(buff, sizeof(buff), "%s\n%s", _("Error creating PulseAudio client."), pa_strerror(error)); lingot_msg_add_error_with_code(buff, error); audio->audio_system = -1; } } void lingot_audio_pulseaudio_destroy(LingotAudioHandler* audio) { if (audio->audio_system == AUDIO_SYSTEM_PULSEAUDIO) { if (audio->pa_client != 0x0) { pa_simple_free(audio->pa_client); audio->pa_client = 0x0; } } } int lingot_audio_pulseaudio_read(LingotAudioHandler* audio) { int samples_read = -1; int error; char buffer[num_channels * audio->read_buffer_size_samples * audio->bytes_per_sample]; int result = pa_simple_read(audio->pa_client, buffer, sizeof(buffer), &error); // printf("result = %i\n", result); if (result < 0) { char buff[512]; snprintf(buff, sizeof(buff), "%s\n%s", _("Read from audio interface failed."), pa_strerror(error)); lingot_msg_add_error_with_code(buff, error); } else { samples_read = audio->read_buffer_size_samples; int i; switch (ss.format) { case PA_SAMPLE_S16LE: { int16_t* read_buffer = (int16_t*) buffer; for (i = 0; i < samples_read; i++) { audio->flt_read_buffer[i] = read_buffer[i]; } break; } case PA_SAMPLE_FLOAT32: { float* read_buffer = (float*) buffer; for (i = 0; i < samples_read; i++) { audio->flt_read_buffer[i] = read_buffer[i] * FLT_SAMPLE_SCALE; } break; } default: break; } } return samples_read; } void lingot_audio_pulseaudio_cancel(LingotAudioHandler* audio) { // warning: memory leak? // TODO: avoid it by using the async API audio->pa_client = 0x0; } // linked list struct for storing the capture device names struct device_name_node_t { char* name; struct device_name_node_t* next; }; static pa_context *context = NULL; static pa_mainloop_api *mainloop_api = NULL; static pa_proplist *proplist = NULL; static void lingot_audio_pulseaudio_mainloop_quit(int ret); static void lingot_audio_pulseaudio_context_drain_complete(pa_context *c, void *userdata); static void lingot_audio_pulseaudio_drain(); static void lingot_audio_pulseaudio_get_source_info_callback(pa_context *c, const pa_source_info *i, int is_last, void *userdata); static void lingot_audio_pulseaudio_context_state_callback(pa_context *c, void *userdata); int lingot_audio_pulseaudio_get_audio_system_properties( LingotAudioSystemProperties* properties) { properties->forced_sample_rate = 0; properties->n_devices = 0; properties->devices = NULL; properties->n_sample_rates = 5; properties->sample_rates[0] = 8000; properties->sample_rates[1] = 11025; properties->sample_rates[2] = 22050; properties->sample_rates[3] = 44100; properties->sample_rates[4] = 48000; // TODO struct device_name_node_t* device_names_first = (struct device_name_node_t*) malloc( sizeof(struct device_name_node_t)); struct device_name_node_t* device_names_last = device_names_first; // the first record is the default source char buff[512]; snprintf(buff, sizeof(buff), "%s ", _("Default Source")); device_names_first->name = strdup(buff); device_names_first->next = NULL; context = NULL; mainloop_api = NULL; proplist = NULL; pa_mainloop *m = NULL; int ret = 1; char *server = NULL; int fail = 0; proplist = pa_proplist_new(); if (!(m = pa_mainloop_new())) { fprintf(stderr, "PulseAudio: pa_mainloop_new() failed.\n"); } else { mainloop_api = pa_mainloop_get_api(m); // //!pa_assert_se(pa_signal_init(mainloop_api) == 0); // pa_signal_new(SIGINT, exit_signal_callback, NULL); // pa_signal_new(SIGTERM, exit_signal_callback, NULL); // pa_disable_sigpipe(); if (!(context = pa_context_new_with_proplist(mainloop_api, NULL, proplist))) { fprintf(stderr, "PulseAudio: pa_context_new() failed.\n"); } else { pa_context_set_state_callback(context, lingot_audio_pulseaudio_context_state_callback, &device_names_last); if (pa_context_connect(context, server, 0, NULL) < 0) { fprintf(stderr, "PulseAudio: pa_context_connect() failed: %s", pa_strerror(pa_context_errno(context))); } else if (pa_mainloop_run(m, &ret) < 0) { fprintf(stderr, "PulseAudio: pa_mainloop_run() failed."); } } } if (context) pa_context_unref(context); if (m) { // pa_signal_done(); pa_mainloop_free(m); } pa_xfree(server); if (proplist) pa_proplist_free(proplist); int device_index; if (!fail) { struct device_name_node_t* name_node_current; for (name_node_current = device_names_first; name_node_current != NULL; name_node_current = name_node_current->next) { properties->n_devices++; } // copy the device names list properties->devices = (char**) malloc( properties->n_devices * sizeof(char*)); name_node_current = device_names_first; for (device_index = 0; device_index < properties->n_devices; device_index++) { properties->devices[device_index] = name_node_current->name; name_node_current = name_node_current->next; } } else { fprintf(stderr, "PulseAudio: cannot obtain device information from server\n"); } // dispose the device names list struct device_name_node_t* name_node_current; for (name_node_current = device_names_first; name_node_current != NULL;) { struct device_name_node_t* name_node_previous = name_node_current; name_node_current = name_node_current->next; free(name_node_previous); } return 0; } static void lingot_audio_pulseaudio_mainloop_quit(int ret) { mainloop_api->quit(mainloop_api, ret); } static void lingot_audio_pulseaudio_context_drain_complete(pa_context *c, void *userdata) { (void)userdata; // Unused parameter. pa_context_disconnect(c); } static void lingot_audio_pulseaudio_drain() { pa_operation *o; if (!(o = pa_context_drain(context, lingot_audio_pulseaudio_context_drain_complete, NULL))) pa_context_disconnect(context); else pa_operation_unref(o); } static void lingot_audio_pulseaudio_get_source_info_callback(pa_context *c, const pa_source_info *i, int is_last, void *userdata) { if (is_last < 0) { fprintf(stderr, "PulseAudio: failed to get source information: %s", pa_strerror(pa_context_errno(c))); lingot_audio_pulseaudio_mainloop_quit(1); return; } if (is_last) { lingot_audio_pulseaudio_drain(); return; } struct device_name_node_t** device_names_last = (struct device_name_node_t**) userdata; char buff[512]; snprintf(buff, sizeof(buff), "%s <%s>", i->description, i->name); // printf("%s <%s>\n", i->description, i->name); // printf("\tmonitor of: %s\n", i->monitor_of_sink_name); // printf("\t%i channels, rate %i, format %i\n", i->sample_spec.channels, // i->sample_spec.rate, i->sample_spec.format); // printf("\tlags %i\n", i->flags); struct device_name_node_t* new_name_node = (struct device_name_node_t*) malloc( sizeof(struct device_name_node_t*)); new_name_node->name = strdup(buff); new_name_node->next = NULL; (*device_names_last)->next = new_name_node; *device_names_last = new_name_node; } static void lingot_audio_pulseaudio_context_state_callback(pa_context *c, void *userdata) { switch (pa_context_get_state(c)) { case PA_CONTEXT_CONNECTING: case PA_CONTEXT_AUTHORIZING: case PA_CONTEXT_SETTING_NAME: break; case PA_CONTEXT_READY: pa_operation_unref( pa_context_get_source_info_list(c, lingot_audio_pulseaudio_get_source_info_callback, userdata)); break; case PA_CONTEXT_TERMINATED: lingot_audio_pulseaudio_mainloop_quit(0); break; case PA_CONTEXT_FAILED: default: fprintf(stderr, "PulseAudio: connection failure: %s\n", pa_strerror(pa_context_errno(c))); lingot_audio_pulseaudio_mainloop_quit(1); break; } } #endif lingot-1.0.1/src/lingot-core.h0000644000175000017500000000507113320113677013116 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_CORE_H__ #define __LINGOT_CORE_H__ #include #include "lingot-defs.h" #include "lingot-complex.h" #include "lingot-filter.h" #include "lingot-config.h" #include "lingot-audio.h" #include "lingot-fft.h" typedef struct { // -- shared data -- FLT freq; // computed analog frequency. FLT* SPL; // visual portion of FFT. // -- shared data -- LingotAudioHandler audio; // audio handler. FLT* flt_read_buffer; FLT* temporal_buffer; // sample memory. // precomputed hamming windows FLT* hamming_window_temporal; FLT* hamming_window_fft; // windowed signals FLT* windowed_temporal_buffer; FLT* windowed_fft_buffer; // spectral power distribution esteem. FLT* spd_fft; FLT* noise_level; LingotFFTPlan fftplan; LingotFilter antialiasing_filter; // antialiasing filter for decimation. int running; LingotConfig conf; // configuration structure pthread_t thread_computation; pthread_attr_t thread_computation_attr; pthread_cond_t thread_computation_cond; pthread_mutex_t thread_computation_mutex; pthread_mutex_t temporal_buffer_mutex; # ifdef DRAW_MARKERS int markers[20]; int markers2[20]; short markers_size; short markers_size2; # endif } LingotCore; //---------------------------------------------------------------- void lingot_core_new(LingotCore*, LingotConfig*); void lingot_core_destroy(LingotCore*); // start process void lingot_core_start(LingotCore*); // stop process void lingot_core_stop(LingotCore*); // tells whether the two frequencies are harmonically related, giving the // multipliers to the ground frequency int lingot_core_frequencies_related(FLT freq1, FLT freq2, FLT minFrequency, FLT* mulFreq1ToFreq, FLT* mulFreq2ToFreq); #endif //__LINGOT_CORE_H__ lingot-1.0.1/src/lingot-filter.h0000644000175000017500000000336113320113677013453 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_FILTER_H__ #define __LINGOT_FILTER_H__ #include #include #include "lingot-defs.h" /* digital filtering implementation. */ typedef struct { FLT* a; FLT* b; // coefs FLT* s; // status unsigned int N; } LingotFilter; void lingot_filter_new(LingotFilter*, unsigned int Na, unsigned int Nb, const FLT* a, const FLT* b); void lingot_filter_reset(LingotFilter* filter); /** * Design a Chebyshev type I low pass filter with Rp dB of pass band ripple * with cutoff pi*wc radians. */ void lingot_filter_cheby_design(LingotFilter*, unsigned int order, FLT Rp, FLT wc); void lingot_filter_destroy(LingotFilter*); // Digital Filter Implementation II, in & out can overlap. Vector filtering void lingot_filter_filter(LingotFilter*, unsigned int n, const FLT* in, FLT* out); // sample filtering FLT lingot_filter_filter_sample(LingotFilter*, FLT in); #endif lingot-1.0.1/src/lingot-gui-mainframe.c0000644000175000017500000011721413320113677014705 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include "lingot-defs.h" #include "lingot-config.h" #include "lingot-gui-mainframe.h" #include "lingot-gui-config-dialog.h" #include "lingot-gauge.h" #include "lingot-i18n.h" #include "lingot-io-config.h" #include "lingot-msg.h" static void lingot_gui_mainframe_draw_gauge_background(cairo_t *cr, const LingotMainFrame* frame); static void lingot_gui_mainframe_draw_spectrum_background(cairo_t *cr, const LingotMainFrame* frame); void lingot_gui_mainframe_draw_gauge(cairo_t *cr, const LingotMainFrame*); void lingot_gui_mainframe_draw_spectrum(cairo_t *cr, const LingotMainFrame*); void lingot_gui_mainframe_draw_labels(const LingotMainFrame*); // sizes static int gauge_size_x = 0; static int gauge_size_y = 0; static int spectrum_size_x = 0; static int spectrum_size_y = 0; static FLT spectrum_bottom_margin; static FLT spectrum_top_margin; static FLT spectrum_left_margin; static FLT spectrum_right_margin; static FLT spectrum_inner_x; static FLT spectrum_inner_y; static const FLT spectrum_min_db = 0; // TODO static const FLT spectrum_max_db = 52; static FLT spectrum_db_density = 0; static int labelsbox_size_x = 0; static int labelsbox_size_y = 0; static gchar* filechooser_config_last_folder = NULL; static const gdouble aspect_ratio_spectrum_visible = 1.14; static const gdouble aspect_ratio_spectrum_invisible = 2.07; // TODO: keep here? static int closest_note_index = 0; static FLT frequency = 0.0; void lingot_gui_mainframe_callback_redraw_gauge(GtkWidget *w, cairo_t *cr, const LingotMainFrame* data) { (void)w; // Unused parameter. lingot_gui_mainframe_draw_gauge(cr, data); } void lingot_gui_mainframe_callback_redraw_spectrum(GtkWidget* w, cairo_t *cr, const LingotMainFrame* frame) { (void)w; // Unused parameter. lingot_gui_mainframe_draw_spectrum(cr, frame); } void lingot_gui_mainframe_callback_destroy(GtkWidget* w, LingotMainFrame* frame) { (void)w; // Unused parameter. g_source_remove(frame->visualization_timer_uid); g_source_remove(frame->freq_computation_timer_uid); g_source_remove(frame->gauge_computation_uid); gtk_main_quit(); } void lingot_gui_mainframe_callback_about(GtkWidget* w, LingotMainFrame* frame) { (void)w; // Unused parameter. (void)frame; // Unused parameter. static const gchar* authors[] = { "Iban Cereijo ", "Jairo Chapela ", NULL }; char buff[512]; snprintf(buff, sizeof(buff), "Matthew Blissett (%s)", _("Logo design")); const gchar* artists[] = { buff, NULL }; GError *error = NULL; GtkIconTheme *icon_theme = NULL; GdkPixbuf *pixbuf = NULL; // we use the property "logo" instead of "logo-icon-name", so we can specify // here at what size we want to scale the icon in this dialog icon_theme = gtk_icon_theme_get_default (); pixbuf = gtk_icon_theme_load_icon (icon_theme, "org.nongnu.lingot", // icon name 80, // icon size 0, // flags &error); if (error) { g_warning("Couldn’t load icon: %s", error->message); g_error_free(error); } gtk_show_about_dialog(NULL, "name", "Lingot", "version", VERSION, "copyright", "\xC2\xA9 2004-2018 Iban Cereijo\n\xC2\xA9 2004-2018 Jairo Chapela", "comments", _("Accurate and easy to use musical instrument tuner"), "authors", authors, "artists", artists, "website-label", "https://www.nongnu.org/lingot/", "website", "https://www.nongnu.org/lingot/", "license-type", GTK_LICENSE_GPL_2_0, "translator-credits", _("translator-credits"), //"logo-icon-name", "org.nongnu.lingot", "logo", pixbuf, NULL); if (pixbuf) { g_object_unref(pixbuf); } } void lingot_gui_mainframe_callback_view_spectrum(GtkWidget* w, LingotMainFrame* frame) { (void)w; // Unused parameter. gboolean visible = gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM(frame->view_spectrum_item)); GtkAllocation alloc; gtk_widget_get_allocation(frame->win, &alloc); GdkGeometry hints; gdouble aspect_ratio = visible ? aspect_ratio_spectrum_visible : aspect_ratio_spectrum_invisible; hints.min_aspect = aspect_ratio; hints.max_aspect = aspect_ratio; gtk_window_set_geometry_hints(GTK_WINDOW(frame->win), frame->win, &hints, GDK_HINT_ASPECT); gtk_widget_set_visible(frame->spectrum_frame, visible); } void lingot_gui_mainframe_callback_config_dialog(GtkWidget* w, LingotMainFrame* frame) { (void)w; // Unused parameter. lingot_gui_config_dialog_show(frame, NULL); } /* timeout for gauge and labels visualization */ gboolean lingot_gui_mainframe_callback_tout_visualization(gpointer data) { unsigned int period; LingotMainFrame* frame = (LingotMainFrame*) data; period = 1000 / frame->conf.visualization_rate; frame->visualization_timer_uid = g_timeout_add(period, lingot_gui_mainframe_callback_tout_visualization, frame); gtk_widget_queue_draw(frame->gauge_area); return 0; } /* timeout for spectrum computation and display */ gboolean lingot_gui_mainframe_callback_tout_spectrum_computation_display( gpointer data) { unsigned int period; LingotMainFrame* frame = (LingotMainFrame*) data; period = 1000 / frame->conf.calculation_rate; frame->freq_computation_timer_uid = g_timeout_add(period, lingot_gui_mainframe_callback_tout_spectrum_computation_display, frame); gtk_widget_queue_draw(frame->spectrum_area); lingot_gui_mainframe_draw_labels(frame); return 0; } /* timeout for a new gauge position computation */ gboolean lingot_gui_mainframe_callback_gauge_computation(gpointer data) { unsigned int period; LingotMainFrame* frame = (LingotMainFrame*) data; period = 1000 / GAUGE_RATE; frame->gauge_computation_uid = g_timeout_add(period, lingot_gui_mainframe_callback_gauge_computation, frame); // ignore continuous component if (!frame->core.running || isnan(frame->core.freq) || (frame->core.freq <= frame->conf.internal_min_frequency)) { frequency = 0.0; lingot_gauge_compute(&frame->gauge, frame->conf.gauge_rest_value); } else { FLT error_cents; // do not use, unfiltered frequency = lingot_filter_filter_sample(&frame->freq_filter, frame->core.freq); closest_note_index = lingot_config_scale_get_closest_note_index( &frame->conf.scale, frame->core.freq, frame->conf.root_frequency_error, &error_cents); if (!isnan(error_cents)) { lingot_gauge_compute(&frame->gauge, error_cents); } } return 0; } /* timeout for dispatching the error queue */ gboolean lingot_gui_mainframe_callback_error_dispatcher(gpointer data) { unsigned int period; GtkWidget* message_dialog; LingotMainFrame* frame = (LingotMainFrame*) data; char* error_message = NULL; message_type_t message_type; int error_code; int more_messages; do { more_messages = lingot_msg_get(&error_message, &message_type, &error_code); if (more_messages) { GtkWindow* parent = GTK_WINDOW( (frame->config_dialog != NULL) ? frame->config_dialog->win : frame->win); GtkButtonsType buttonsType; char message[2000]; char* message_pointer = message; message_pointer += snprintf(message_pointer, (message - message_pointer) + sizeof(message), "%s", error_message); if (error_code == EBUSY) { message_pointer += snprintf(message_pointer, (message - message_pointer) + sizeof(message), "\n\n%s", _( "Please check that there are not other processes locking the requested device. Also, consider that some audio servers can sometimes hold the resources for a few seconds since the last time they were used. In such a case, you can try again.")); } if ((message_type == ERROR) && !frame->core.running) { buttonsType = GTK_BUTTONS_OK; message_pointer += snprintf(message_pointer, (message - message_pointer) + sizeof(message), "\n\n%s", _( "The core is not running, you must check your configuration.")); } else { buttonsType = GTK_BUTTONS_OK; } message_dialog = gtk_message_dialog_new(parent, GTK_DIALOG_DESTROY_WITH_PARENT, (message_type == ERROR) ? GTK_MESSAGE_ERROR : ((message_type == WARNING) ? GTK_MESSAGE_WARNING : GTK_MESSAGE_INFO), buttonsType, "%s", message); gtk_window_set_title(GTK_WINDOW(message_dialog), (message_type == ERROR) ? _("Error") : ((message_type == WARNING) ? _("Warning") : _("Info"))); gtk_window_set_icon(GTK_WINDOW(message_dialog), gtk_window_get_icon(GTK_WINDOW(frame->win))); gtk_dialog_run(GTK_DIALOG(message_dialog)); gtk_widget_destroy(message_dialog); free(error_message); // if ((message_type == ERROR) && !frame->core.running) { // lingot_gui_mainframe_callback_config_dialog(NULL, frame); // } } } while (more_messages); period = 1000 / ERROR_DISPATCH_RATE; frame->error_dispatcher_uid = g_timeout_add(period, lingot_gui_mainframe_callback_error_dispatcher, frame); return 0; } void lingot_gui_mainframe_callback_open_config(gpointer data, LingotMainFrame* frame) { (void)data; // Unused parameter. GtkWidget * dialog = gtk_file_chooser_dialog_new( _("Open Configuration File"), GTK_WINDOW(frame->win), GTK_FILE_CHOOSER_ACTION_OPEN, "_Cancel", GTK_RESPONSE_CANCEL, "_Open", GTK_RESPONSE_ACCEPT, NULL); GtkFileFilter *filefilter; char config_used = 0; LingotConfig config; filefilter = gtk_file_filter_new(); gtk_file_filter_set_name(filefilter, (const gchar *) _("Lingot configuration files")); gtk_file_filter_add_pattern(filefilter, "*.conf"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filefilter); gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); if (filechooser_config_last_folder != NULL) { gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), filechooser_config_last_folder); } if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char *filename; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); free(filechooser_config_last_folder); filechooser_config_last_folder = strdup( gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog))); lingot_config_new(&config); lingot_io_config_load(&config, filename); config_used = 1; g_free(filename); } gtk_widget_destroy(dialog); //g_free(filefilter); if (config_used) { lingot_gui_config_dialog_show(frame, &config); } } void lingot_gui_mainframe_callback_save_config(gpointer data, LingotMainFrame* frame) { (void)data; // Unused parameter. GtkWidget *dialog = gtk_file_chooser_dialog_new( _("Save Configuration File"), GTK_WINDOW(frame->win), GTK_FILE_CHOOSER_ACTION_SAVE, "_Cancel", GTK_RESPONSE_CANCEL, "_Save", GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE); gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), _("untitled.conf")); GtkFileFilter* filefilter = gtk_file_filter_new(); gtk_file_filter_set_name(filefilter, (const gchar *) _("Lingot configuration files")); gtk_file_filter_add_pattern(filefilter, "*.conf"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filefilter); gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE); if (filechooser_config_last_folder != NULL) { gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), filechooser_config_last_folder); } if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char *filename; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); if (filechooser_config_last_folder != NULL) free(filechooser_config_last_folder); filechooser_config_last_folder = strdup( gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog))); lingot_io_config_save(&frame->conf, filename); g_free(filename); } gtk_widget_destroy(dialog); } void lingot_gui_mainframe_color(GdkColor* color, int red, int green, int blue) { color->red = red; color->green = green; color->blue = blue; } void lingot_gui_mainframe_callback_window_resize(GtkWidget *widget, GtkAllocation *allocation, void *data) { (void)widget; // Unused parameter. (void)allocation; // Unused parameter. const LingotMainFrame* frame = (LingotMainFrame*) data; GtkAllocation req; gtk_widget_get_allocation(frame->gauge_area, &req); if ((req.width != gauge_size_x) || (req.height != gauge_size_y)) { gauge_size_x = req.width; gauge_size_y = req.height; } gtk_widget_get_allocation(frame->spectrum_area, &req); if ((req.width != spectrum_size_x) || (req.height != spectrum_size_y)) { spectrum_size_x = req.width; spectrum_size_y = req.height; } gtk_widget_get_allocation(frame->labelsbox, &req); labelsbox_size_x = req.width; labelsbox_size_y = req.height; } void lingot_gui_mainframe_create(int argc, char *argv[]) { LingotMainFrame* frame; if (filechooser_config_last_folder == NULL) { char buff[1000]; snprintf(buff, sizeof(buff), "%s/%s", getenv("HOME"), CONFIG_DIR_NAME); filechooser_config_last_folder = strdup(buff); } frame = malloc(sizeof(LingotMainFrame)); frame->config_dialog = NULL; LingotConfig* const conf = &frame->conf; lingot_config_new(conf); lingot_io_config_load(conf, CONFIG_FILE_NAME); lingot_gauge_new(&frame->gauge, conf->gauge_rest_value); // gauge in rest situation // ----- FREQUENCY FILTER CONFIGURATION ------ // low pass IIR filter. FLT freq_filter_a[] = { 1.0, -0.5 }; FLT freq_filter_b[] = { 0.5 }; lingot_filter_new(&frame->freq_filter, 1, 0, freq_filter_a, freq_filter_b); // --------------------------------------------------- gtk_init(&argc, &argv); // gtk_set_locale(); GtkBuilder* builder = gtk_builder_new(); gtk_builder_add_from_resource(builder, "/org/nongnu/lingot/lingot-gui-mainframe.glade", NULL); frame->win = GTK_WIDGET(gtk_builder_get_object(builder, "window1")); gtk_window_set_default_icon_name("org.nongnu.lingot"); gtk_window_set_icon_name(GTK_WINDOW(frame->win), "org.nongnu.lingot"); frame->gauge_area = GTK_WIDGET( gtk_builder_get_object(builder, "gauge_area")); frame->spectrum_area = GTK_WIDGET( gtk_builder_get_object(builder, "spectrum_area")); frame->freq_label = GTK_WIDGET( gtk_builder_get_object(builder, "freq_label")); frame->tone_label = GTK_WIDGET( gtk_builder_get_object(builder, "tone_label")); frame->error_label = GTK_WIDGET( gtk_builder_get_object(builder, "error_label")); frame->spectrum_frame = GTK_WIDGET( gtk_builder_get_object(builder, "spectrum_frame")); frame->view_spectrum_item = GTK_WIDGET( gtk_builder_get_object(builder, "spectrum_item")); frame->labelsbox = GTK_WIDGET(gtk_builder_get_object(builder, "labelsbox")); gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(frame->view_spectrum_item), TRUE); // show all gtk_widget_show_all(frame->win); GtkAllocation alloc; gtk_widget_get_allocation(frame->win, &alloc); GdkGeometry hints; gdouble aspect_ratio = aspect_ratio_spectrum_visible; hints.min_aspect = aspect_ratio; hints.max_aspect = aspect_ratio; gtk_window_set_geometry_hints(GTK_WINDOW(frame->win), frame->win, &hints, GDK_HINT_ASPECT); // GTK signals g_signal_connect(gtk_builder_get_object(builder, "preferences_item"), "activate", G_CALLBACK(lingot_gui_mainframe_callback_config_dialog), frame); g_signal_connect(gtk_builder_get_object(builder, "quit_item"), "activate", G_CALLBACK(lingot_gui_mainframe_callback_destroy), frame); g_signal_connect(gtk_builder_get_object(builder, "about_item"), "activate", G_CALLBACK(lingot_gui_mainframe_callback_about), frame); g_signal_connect(gtk_builder_get_object(builder, "spectrum_item"), "activate", G_CALLBACK(lingot_gui_mainframe_callback_view_spectrum), frame); g_signal_connect(gtk_builder_get_object(builder, "open_config_item"), "activate", G_CALLBACK(lingot_gui_mainframe_callback_open_config), frame); g_signal_connect(gtk_builder_get_object(builder, "save_config_item"), "activate", G_CALLBACK(lingot_gui_mainframe_callback_save_config), frame); g_signal_connect(frame->gauge_area, "draw", G_CALLBACK(lingot_gui_mainframe_callback_redraw_gauge), frame); g_signal_connect(frame->spectrum_area, "draw", G_CALLBACK(lingot_gui_mainframe_callback_redraw_spectrum), frame); g_signal_connect(frame->win, "destroy", G_CALLBACK(lingot_gui_mainframe_callback_destroy), frame); // TODO: remove g_signal_connect(frame->win, "size-allocate", G_CALLBACK(lingot_gui_mainframe_callback_window_resize), frame); GtkAccelGroup* accel_group = gtk_accel_group_new(); gtk_widget_add_accelerator( GTK_WIDGET(gtk_builder_get_object(builder, "preferences_item")), "activate", accel_group, 'p', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); gtk_window_add_accel_group(GTK_WINDOW(frame->win), accel_group); unsigned int period; period = 1000 / conf->visualization_rate; frame->visualization_timer_uid = g_timeout_add(period, lingot_gui_mainframe_callback_tout_visualization, frame); period = 1000 / conf->calculation_rate; frame->freq_computation_timer_uid = g_timeout_add(period, lingot_gui_mainframe_callback_tout_spectrum_computation_display, frame); period = 1000 / GAUGE_RATE; frame->gauge_computation_uid = g_timeout_add(period, lingot_gui_mainframe_callback_gauge_computation, frame); period = 1000 / ERROR_DISPATCH_RATE; frame->error_dispatcher_uid = g_timeout_add(period, lingot_gui_mainframe_callback_error_dispatcher, frame); lingot_core_new(&frame->core, conf); lingot_core_start(&frame->core); g_object_unref(builder); gtk_main(); } void lingot_gui_mainframe_destroy(LingotMainFrame* frame) { lingot_core_stop(&frame->core); lingot_core_destroy(&frame->core); lingot_gauge_destroy(&frame->gauge); lingot_filter_destroy(&frame->freq_filter); lingot_config_destroy(&frame->conf); if (frame->config_dialog) { lingot_gui_config_dialog_destroy(frame->config_dialog); } free(frame); } // --------------------------------------------------------------------------- static void lingot_gui_mainframe_cairo_set_source_argb(cairo_t *cr, unsigned int color) { cairo_set_source_rgba(cr, 0.00392156862745098 * ((color >> 16) & 0xff), 0.00392156862745098 * ((color >> 8) & 0xff), 0.00392156862745098 * (color & 0xff), 1.0 - 0.00392156862745098 * ((color >> 24) & 0xff)); } typedef struct { FLT x; FLT y; } point_t; static void lingot_gui_mainframe_draw_gauge_tic(cairo_t *cr, const point_t* gaugeCenter, double radius1, double radius2, double angle) { cairo_move_to(cr, gaugeCenter->x + radius1 * sin(angle), gaugeCenter->y - radius1 * cos(angle)); cairo_rel_line_to(cr, (radius2 - radius1) * sin(angle), (radius1 - radius2) * cos(angle)); cairo_stroke(cr); } static void lingot_gui_mainframe_draw_gauge_background(cairo_t *cr, const LingotMainFrame* frame) { // normalized dimensions static const FLT gauge_gaugeCenterY = 0.94; static const FLT gauge_centsBarStroke = 0.025; static const FLT gauge_centsBarRadius = 0.75; static const FLT gauge_centsBarMajorTicRadius = 0.04; static const FLT gauge_centsBarMinorTicRadius = 0.03; static const FLT gauge_centsBarMajorTicStroke = 0.03; static const FLT gauge_centsBarMinorTicStroke = 0.01; static const FLT gauge_centsTextSize = 0.09; static const FLT gauge_frequencyBarStroke = 0.025; static const FLT gauge_frequencyBarRadius = 0.78; static const FLT gauge_frequencyBarMajorTicRadius = 0.04; static const FLT gauge_okBarStroke = 0.07; static const FLT gauge_okBarRadius = 0.48; static const FLT overtureAngle = 65.0 * M_PI / 180.0; // colors static const unsigned int gauge_centsBarColor = 0x333355; static const unsigned int gauge_frequencyBarColor = 0x555533; static const unsigned int gauge_okColor = 0x99dd99; static const unsigned int gauge_koColor = 0xddaaaa; const int width = gauge_size_x; int height = gauge_size_y; // dimensions applied to the current size point_t gaugeCenter = { .x = width / 2, .y = height * gauge_gaugeCenterY }; if (width < 1.6 * height) { height = width / 1.6; gaugeCenter.y = 0.5 * (gauge_size_y - height) + height * gauge_gaugeCenterY; } const FLT centsBarRadius = height * gauge_centsBarRadius; const FLT centsBarStroke = height * gauge_centsBarStroke; const FLT centsBarMajorTicRadius = centsBarRadius - height * gauge_centsBarMajorTicRadius; const FLT centsBarMinorTicRadius = centsBarRadius - height * gauge_centsBarMinorTicRadius; const FLT centsBarMajorTicStroke = height * gauge_centsBarMajorTicStroke; const FLT centsBarMinorTicStroke = height * gauge_centsBarMinorTicStroke; const FLT centsTextSize = height * gauge_centsTextSize; const FLT frequencyBarRadius = height * gauge_frequencyBarRadius; const FLT frequencyBarMajorTicRadius = frequencyBarRadius + height * gauge_frequencyBarMajorTicRadius; const FLT frequencyBarStroke = height * gauge_frequencyBarStroke; const FLT okBarRadius = height * gauge_okBarRadius; const FLT okBarStroke = height * gauge_okBarStroke; cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_save(cr); const GdkRectangle r = { .x = 0, .y = 0, .width = gauge_size_x, .height = gauge_size_y }; gdk_cairo_rectangle(cr, &r); cairo_fill_preserve(cr); cairo_restore(cr); cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); cairo_stroke(cr); // draw ok/ko bar cairo_set_line_width(cr, okBarStroke); cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); lingot_gui_mainframe_cairo_set_source_argb(cr, gauge_koColor); cairo_arc(cr, gaugeCenter.x, gaugeCenter.y, okBarRadius, -0.5 * M_PI - overtureAngle, -0.5 * M_PI + overtureAngle); cairo_stroke(cr); lingot_gui_mainframe_cairo_set_source_argb(cr, gauge_okColor); cairo_arc(cr, gaugeCenter.x, gaugeCenter.y, okBarRadius, -0.5 * M_PI - 0.1 * overtureAngle, -0.5 * M_PI + 0.1 * overtureAngle); cairo_stroke(cr); // draw cents bar cairo_set_line_width(cr, centsBarStroke); lingot_gui_mainframe_cairo_set_source_argb(cr, gauge_centsBarColor); cairo_arc(cr, gaugeCenter.x, gaugeCenter.y, centsBarRadius, -0.5 * M_PI - 1.05 * overtureAngle, -0.5 * M_PI + 1.05 * overtureAngle); cairo_stroke(cr); // cent tics const double maxOffsetRounded = frame->conf.scale.max_offset_rounded; static const int maxMinorDivisions = 20; double centsPerMinorDivision = maxOffsetRounded / maxMinorDivisions; const double base = pow(10.0, floor(log10(centsPerMinorDivision))); double normalizedCentsPerDivision = centsPerMinorDivision / base; if (normalizedCentsPerDivision >= 6.0) { normalizedCentsPerDivision = 10.0; } else if (normalizedCentsPerDivision >= 2.5) { normalizedCentsPerDivision = 5.0; } else if (normalizedCentsPerDivision >= 1.2) { normalizedCentsPerDivision = 2.0; } else { normalizedCentsPerDivision = 1.0; } centsPerMinorDivision = normalizedCentsPerDivision * base; const double centsPerMajorDivision = 5.0 * centsPerMinorDivision; // minor tics cairo_set_line_width(cr, centsBarMinorTicStroke); int maxIndex = (int) floor(0.5 * maxOffsetRounded / centsPerMinorDivision); double angleStep = 2.0 * overtureAngle * centsPerMinorDivision / maxOffsetRounded; int index; for (index = -maxIndex; index <= maxIndex; index++) { const double angle = index * angleStep; lingot_gui_mainframe_draw_gauge_tic(cr, &gaugeCenter, centsBarMinorTicRadius, centsBarRadius, angle); } // major tics maxIndex = (int) floor(0.5 * maxOffsetRounded / centsPerMajorDivision); angleStep = 2.0 * overtureAngle * centsPerMajorDivision / maxOffsetRounded; cairo_set_line_width(cr, centsBarMajorTicStroke); for (index = -maxIndex; index <= maxIndex; index++) { double angle = index * angleStep; lingot_gui_mainframe_draw_gauge_tic(cr, &gaugeCenter, centsBarMajorTicRadius, centsBarRadius, angle); } // cents text cairo_set_line_width(cr, 1.0); double oldAngle = 0.0; cairo_save(cr); static char buff[10]; cairo_text_extents_t te; cairo_select_font_face(cr, "Helvetica", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, centsTextSize); sprintf(buff, "%s", "cent"); cairo_text_extents(cr, buff, &te); cairo_move_to(cr, gaugeCenter.x - te.width / 2 - te.x_bearing, gaugeCenter.y - 0.81 * centsBarMajorTicRadius - te.height / 2 - te.y_bearing); cairo_show_text(cr, buff); cairo_translate(cr, gaugeCenter.x, gaugeCenter.y); for (index = -maxIndex; index <= maxIndex; index++) { double angle = index * angleStep; cairo_rotate(cr, angle - oldAngle); int cents = (int) (index * centsPerMajorDivision); sprintf(buff, "%s%i", ((cents > 0) ? "+" : ""), cents); cairo_text_extents(cr, buff, &te); cairo_move_to(cr, -te.width / 2 - te.x_bearing, -0.92 * centsBarMajorTicRadius - te.height / 2 - te.y_bearing); cairo_show_text(cr, buff); oldAngle = angle; } cairo_restore(cr); cairo_stroke(cr); // draw frequency bar cairo_set_line_width(cr, frequencyBarStroke); lingot_gui_mainframe_cairo_set_source_argb(cr, gauge_frequencyBarColor); cairo_arc(cr, gaugeCenter.x, gaugeCenter.y, frequencyBarRadius, -0.5 * M_PI - 1.05 * overtureAngle, -0.5 * M_PI + 1.05 * overtureAngle); cairo_stroke(cr); // frequency tics lingot_gui_mainframe_draw_gauge_tic(cr, &gaugeCenter, frequencyBarMajorTicRadius, frequencyBarRadius, 0.0); } void lingot_gui_mainframe_draw_gauge(cairo_t *cr, const LingotMainFrame* frame) { // normalized dimensions static const FLT gauge_gaugeCenterY = 0.94; static const FLT gauge_gaugeLength = 0.85; static const FLT gauge_gaugeLengthBack = 0.08; static const FLT gauge_gaugeCenterRadius = 0.045; static const FLT gauge_gaugeStroke = 0.012; static const FLT gauge_gaugeShadowOffsetX = 0.015; static const FLT gauge_gaugeShadowOffsetY = 0.01; static const FLT overtureAngle = 65.0 * M_PI / 180.0; // colors static const unsigned int gauge_gaugeColor = 0xaa3333; static const unsigned int gauge_gaugeShadowColor = 0x88000000; const int width = gauge_size_x; int height = gauge_size_y; // dimensions applied to the current size point_t gaugeCenter = { .x = width / 2, .y = height * gauge_gaugeCenterY }; if (width < 1.6 * height) { height = width / 1.6; gaugeCenter.y = 0.5 * (gauge_size_y - height) + height * gauge_gaugeCenterY; } const point_t gaugeShadowCenter = { .x = gaugeCenter.x + height * gauge_gaugeShadowOffsetX, .y = gaugeCenter.y + height * gauge_gaugeShadowOffsetY }; const FLT gaugeLength = height * gauge_gaugeLength; const FLT gaugeLengthBack = height * gauge_gaugeLengthBack; const FLT gaugeCenterRadius = height * gauge_gaugeCenterRadius; const FLT gaugeStroke = height * gauge_gaugeStroke; lingot_gui_mainframe_draw_gauge_background(cr, frame); const double normalized_error = frame->gauge.position / frame->conf.scale.max_offset_rounded; const double angle = 2.0 * normalized_error * overtureAngle; cairo_set_line_width(cr, gaugeStroke); cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); lingot_gui_mainframe_cairo_set_source_argb(cr, gauge_gaugeShadowColor); lingot_gui_mainframe_draw_gauge_tic(cr, &gaugeShadowCenter, -gaugeLengthBack, -0.99 * gaugeCenterRadius, angle); lingot_gui_mainframe_draw_gauge_tic(cr, &gaugeShadowCenter, 0.99 * gaugeCenterRadius, gaugeLength, angle); cairo_arc(cr, gaugeShadowCenter.x, gaugeShadowCenter.y, gaugeCenterRadius, 0, 2 * M_PI); cairo_fill(cr); lingot_gui_mainframe_cairo_set_source_argb(cr, gauge_gaugeColor); lingot_gui_mainframe_draw_gauge_tic(cr, &gaugeCenter, -gaugeLengthBack, gaugeLength, angle); cairo_arc(cr, gaugeCenter.x, gaugeCenter.y, gaugeCenterRadius, 0, 2 * M_PI); cairo_fill(cr); } FLT lingot_gui_mainframe_get_signal(const LingotMainFrame* frame, int i, FLT min, FLT max) { FLT signal = frame->core.SPL[i]; if (signal < min) { signal = min; } else if (signal > max) { signal = max; } return signal - min; } FLT lingot_gui_mainframe_get_noise(const LingotMainFrame* frame, FLT min, FLT max) { FLT noise = frame->conf.min_overall_SNR; if (noise < min) { noise = min; } else if (noise > max) { noise = max; } return noise - min; } static char* lingot_gui_mainframe_format_frequency(FLT freq, char* buff) { if (freq == 0.0) { sprintf(buff, "0 Hz"); } else if (floor(freq) == freq) sprintf(buff, "%0.0f kHz", freq); else if (floor(10 * freq) == 10 * freq) { if (freq <= 1000.0) sprintf(buff, "%0.0f Hz", 1e3 * freq); else sprintf(buff, "%0.1f kHz", freq); } else { if (freq <= 100.0) sprintf(buff, "%0.0f Hz", 1e3 * freq); else sprintf(buff, "%0.2f kHz", freq); } return buff; } void lingot_gui_mainframe_draw_spectrum_background(cairo_t *cr, const LingotMainFrame* frame) { const FLT font_size = 8 + spectrum_size_y / 30; static char buff[10]; static char buff2[10]; cairo_select_font_face(cr, "Helvetica", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, font_size); sprintf(buff, "%0.0f", spectrum_min_db); sprintf(buff2, "%0.0f", spectrum_max_db); cairo_text_extents_t te; cairo_text_extents_t te2; cairo_text_extents(cr, buff, &te); cairo_text_extents(cr, buff2, &te2); if (te2.width > te.width) { te = te2; } // spectrum area margins spectrum_bottom_margin = 1.6 * te.height; spectrum_top_margin = spectrum_bottom_margin; spectrum_left_margin = te.width * 1.5; spectrum_right_margin = 0.03 * spectrum_size_x; if (spectrum_right_margin > 0.8 * spectrum_left_margin) { spectrum_right_margin = 0.8 * spectrum_left_margin; } spectrum_inner_x = spectrum_size_x - spectrum_left_margin - spectrum_right_margin; spectrum_inner_y = spectrum_size_y - spectrum_bottom_margin - spectrum_top_margin; sprintf(buff, "000 Hz"); cairo_text_extents(cr, buff, &te); // minimum grid size in pixels const int minimum_grid_width = 1.5 * te.width; const int minimum_grid_height = 3.0 * te.height; // clear all cairo_set_source_rgba(cr, 0.06, 0.2, 0.06, 1.0); GdkRectangle r = { .x = 0, .y = 0, .width = spectrum_size_x, .height = spectrum_size_y }; gdk_cairo_rectangle(cr, &r); cairo_fill(cr); cairo_set_source_rgba(cr, 0.56, 0.56, 0.56, 1.0); cairo_set_line_width(cr, 1.0); cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); cairo_move_to(cr, spectrum_left_margin, spectrum_size_y - spectrum_bottom_margin); cairo_rel_line_to(cr, spectrum_inner_x, 0); cairo_stroke(cr); // choose scale factor const FLT spectrum_max_frequency = 0.5 * frame->conf.sample_rate / frame->conf.oversampling; // scale factors (in KHz) to draw the grid. We will choose the smaller // factor that respects the minimum_grid_width static const double scales[] = { 0.01, 0.05, 0.1, 0.2, 0.5, 1, 2, 4, 11, 22, -1.0 }; int i; for (i = 0; scales[i + 1] > 0.0; i++) { if ((1e3 * scales[i] * spectrum_inner_x / spectrum_max_frequency) > minimum_grid_width) break; } FLT scale = scales[i]; FLT grid_width = 1e3 * scales[i] * spectrum_inner_x / spectrum_max_frequency; FLT freq = 0.0; FLT x; for (x = 0.0; x <= spectrum_inner_x; x += grid_width) { cairo_move_to(cr, spectrum_left_margin + x, spectrum_top_margin); cairo_rel_line_to(cr, 0, spectrum_inner_y + 3); // TODO: proportion cairo_stroke(cr); lingot_gui_mainframe_format_frequency(freq, buff); cairo_text_extents(cr, buff, &te); cairo_move_to(cr, spectrum_left_margin + x + 6 - te.width / 2 - te.x_bearing, spectrum_size_y - 0.5 * spectrum_bottom_margin - te.height / 2 - te.y_bearing); cairo_show_text(cr, buff); freq += scale; } spectrum_db_density = (spectrum_inner_y) / (spectrum_max_db - spectrum_min_db); sprintf(buff, "dB"); cairo_text_extents(cr, buff, &te); cairo_move_to(cr, spectrum_left_margin - te.x_bearing, 0.5 * spectrum_top_margin - te.height / 2 - te.y_bearing); cairo_show_text(cr, buff); // scale factors (in KHz) to draw the grid. We will choose the smallest // factor that respects the minimum_grid_width static const int db_scales[] = { 5, 10, 20, 25, 50, 75, 100, -1 }; for (i = 0; db_scales[i + 1] > 0; i++) { if ((db_scales[i] * spectrum_db_density) > minimum_grid_height) break; } const int db_scale = db_scales[i]; FLT y = 0; int i0 = ceil(spectrum_min_db / db_scale); if (spectrum_min_db < 0.0) { i0--; } int i1 = ceil(spectrum_max_db / db_scale); for (i = i0; i <= i1; i++) { y = spectrum_db_density * (i * db_scale - spectrum_min_db); if ((y < 0.0) || (y > spectrum_inner_y)) { continue; } sprintf(buff, "%d", i * db_scale); cairo_text_extents(cr, buff, &te); cairo_move_to(cr, 0.45 * spectrum_left_margin - te.width / 2 - te.x_bearing, spectrum_size_y - spectrum_bottom_margin - y - te.height / 2 - te.y_bearing); cairo_show_text(cr, buff); cairo_move_to(cr, spectrum_left_margin - 3, spectrum_size_y - spectrum_bottom_margin - y); cairo_rel_line_to(cr, spectrum_inner_x + 3, 0); cairo_stroke(cr); } } void lingot_gui_mainframe_draw_spectrum(cairo_t *cr, const LingotMainFrame* frame) { unsigned int i; lingot_gui_mainframe_draw_spectrum_background(cr, frame); // TODO: change access to frame->core.X // spectrum drawing. if (frame->core.running) { cairo_set_line_width(cr, 1.0); cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); FLT x; FLT y = -1; const unsigned int min_index = 0; const unsigned int max_index = frame->conf.fft_size / 2; FLT index_density = spectrum_inner_x / max_index; // TODO: step const unsigned int index_step = 1; static const double dashed1[] = { 5.0, 5.0 }; static int len1 = sizeof(dashed1) / sizeof(dashed1[0]); const FLT x0 = spectrum_left_margin; const FLT y0 = spectrum_size_y - spectrum_bottom_margin; FLT dydxm1 = 0; cairo_set_source_rgba(cr, 0.13, 1.0, 0.13, 1.0); cairo_translate(cr, x0, y0); cairo_rectangle(cr, 1.0, -1.0, spectrum_inner_x - 2, -(spectrum_inner_y - 2)); cairo_clip(cr); cairo_new_path(cr); // path not consumed by clip() y = -spectrum_db_density * lingot_gui_mainframe_get_signal(frame, min_index, spectrum_min_db, spectrum_max_db); // dB. cairo_move_to(cr, 0, 0); cairo_line_to(cr, 0, y); FLT yp1 = -spectrum_db_density * lingot_gui_mainframe_get_signal(frame, min_index + 1, spectrum_min_db, spectrum_max_db); FLT ym1 = y; for (i = index_step; i < max_index - 1; i += index_step) { x = index_density * i; ym1 = y; y = yp1; yp1 = -spectrum_db_density * lingot_gui_mainframe_get_signal(frame, i + 1, spectrum_min_db, spectrum_max_db); FLT dydx = (yp1 - ym1) / (2 * index_density); static const FLT dx = 0.4; FLT x1 = x - (1 - dx) * index_density; FLT x2 = x - dx * index_density; FLT y1 = ym1 + dydxm1 * dx; FLT y2 = y - dydx * dx; dydxm1 = dydx; cairo_curve_to(cr, x1, y1, x2, y2, x, y); // cairo_line_to(cr, x, y); } y = -spectrum_db_density * lingot_gui_mainframe_get_signal(frame, max_index - 1, spectrum_min_db, spectrum_max_db); // dB. cairo_line_to(cr, index_density * max_index, y); cairo_line_to(cr, index_density * max_index, 0); cairo_close_path(cr); cairo_fill_preserve(cr); // cairo_restore(cr); cairo_stroke(cr); #ifdef DRAW_MARKERS cairo_set_source_rgba(cr, 1.0, 1.0, 0.13, 1.0); cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND); cairo_set_line_width(cr, 10.0); for (i = 0; i < frame->core.markers_size2; i++) { x = index_density * frame->core.markers2[i]; y = -spectrum_db_density * lingot_gui_mainframe_get_signal(frame, frame->core.markers2[i], spectrum_min_db, spectrum_max_db); // dB. cairo_move_to(cr, x, y); cairo_rel_line_to(cr, 0, 0); cairo_stroke(cr); } cairo_set_line_width(cr, 4.0); cairo_set_source_rgba(cr, 0.13, 0.13, 1.0, 1.0); for (i = 0; i < frame->core.markers_size; i++) { x = index_density * frame->core.markers[i]; y = -spectrum_db_density * lingot_gui_mainframe_get_signal(frame, frame->core.markers[i], spectrum_min_db, spectrum_max_db); // dB. cairo_move_to(cr, x, y); cairo_rel_line_to(cr, 0, 0); cairo_stroke(cr); } cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); cairo_set_line_width(cr, 1.0); #endif if (frame->core.freq != 0.0) { cairo_set_dash(cr, dashed1, len1, 0); // fundamental frequency mark with a red vertical line. cairo_set_source_rgba(cr, 1.0, 0.13, 0.13, 1.0); cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND); cairo_set_line_width(cr, 1.0); // index of closest sample to fundamental frequency. x = index_density * frame->core.freq * frame->conf.fft_size * frame->conf.oversampling / frame->conf.sample_rate; cairo_move_to(cr, x, 0); cairo_rel_line_to(cr, 0.0, -spectrum_inner_y); cairo_stroke(cr); // i = (int) rint( // frame->core.freq * frame->conf.fft_size // * frame->conf.oversampling // / frame->conf.sample_rate); // y = -spectrum_db_density // * lingot_gui_mainframe_get_signal(frame, i, spectrum_min_db, // spectrum_max_db); // dB. // cairo_set_line_width(cr, 4.0); // cairo_move_to(cr, x, y); // cairo_rel_line_to(cr, 0, 0); // cairo_stroke(cr); cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); cairo_set_line_width(cr, 1.0); } cairo_set_dash(cr, dashed1, len1, 0); cairo_set_source_rgba(cr, 1.0, 1.0, 0.2, 1.0); y = -spectrum_db_density * lingot_gui_mainframe_get_noise(frame, spectrum_min_db, spectrum_max_db); // dB. cairo_move_to(cr, 0, y); // noise threshold drawing. for (i = min_index + index_step; i < max_index - 1; i += index_step) { x = index_density * i; y = -spectrum_db_density * lingot_gui_mainframe_get_noise(frame, spectrum_min_db, spectrum_max_db); // dB. cairo_line_to(cr, x, y); } cairo_stroke(cr); } } void lingot_gui_mainframe_draw_labels(const LingotMainFrame* frame) { char* note_string; static char error_string[30]; static char freq_string[30]; static char octave_string[30]; // draw note, error and frequency labels if (frequency == 0.0) { note_string = "---"; strcpy(error_string, "e = ---"); strcpy(freq_string, "f = ---"); strcpy(octave_string, ""); } else { note_string = frame->conf.scale.note_name[lingot_config_scale_get_note_index( &frame->conf.scale, closest_note_index)]; sprintf(error_string, "e = %+2.0f cents", frame->gauge.position); sprintf(freq_string, "f = %6.2f Hz", frequency); sprintf(octave_string, "%d", lingot_config_scale_get_octave(&frame->conf.scale, closest_note_index) + 4); } int font_size = 9 + labelsbox_size_x / 80; char* markup = g_markup_printf_escaped("%s", font_size, freq_string); gtk_label_set_markup(GTK_LABEL(frame->freq_label), markup); g_free(markup); markup = g_markup_printf_escaped("%s", font_size, error_string); gtk_label_set_markup(GTK_LABEL(frame->error_label), markup); g_free(markup); font_size = 10 + labelsbox_size_x / 22; markup = g_markup_printf_escaped( "%s%s", font_size, note_string, (int) (0.75 * font_size), octave_string); gtk_label_set_markup(GTK_LABEL(frame->tone_label), markup); g_free(markup); } void lingot_gui_mainframe_change_config(LingotMainFrame* frame, LingotConfig* conf) { lingot_core_stop(&frame->core); lingot_core_destroy(&frame->core); // dup. lingot_config_copy(&frame->conf, conf); lingot_core_new(&frame->core, &frame->conf); lingot_core_start(&frame->core); // some parameters may have changed lingot_config_copy(conf, &frame->conf); } lingot-1.0.1/src/lingot-gui-config-dialog-scale.h0000644000175000017500000000362113320113677016536 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef LINGOT_GUI_CONFIG_DIALOG_SCALE_H_ #define LINGOT_GUI_CONFIG_DIALOG_SCALE_H_ #include struct LingotConfigDialog; struct LingotScale; struct GtkBuilder; // initialize and show the components void lingot_gui_config_dialog_scale_show(LingotConfigDialog*, GtkBuilder*); // validate the information stored in the table int lingot_gui_config_dialog_scale_validate(const LingotConfigDialog* dialog, const LingotScale* scale); // copies the information stores in the table to the internal data structure void lingot_gui_config_dialog_scale_gui_to_data(const LingotConfigDialog* dialog, LingotScale* scale); // fills the table with the information carried by the structure void lingot_gui_config_dialog_scale_data_to_gui(LingotConfigDialog* dialog, const LingotScale* scale); void lingot_gui_config_dialog_scale_callback_change_deviation(GtkWidget *widget, LingotConfigDialog *dialog); void lingot_gui_config_dialog_scale_callback_change_octave(GtkWidget *widget, LingotConfigDialog *dialog); #endif /* LINGOT_GUI_CONFIG_DIALOG_SCALE_H_ */ lingot-1.0.1/src/lingot-defs.h0000644000175000017500000000373513320113677013114 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_DEFS_H__ #define __LINGOT_DEFS_H__ #include "../config.h" // floating point precission. #define FLT double #define CONFIG_DIR_NAME ".lingot/" #define DEFAULT_CONFIG_FILE_NAME "lingot.conf" extern char CONFIG_FILE_NAME[]; #define QUICK_MESSAGES #define GTK_EVENTS_RATE 20.0 #define GAUGE_RATE 60.0 #define ERROR_DISPATCH_RATE 5.0 #define MID_A_FREQUENCY 440.0 #define MID_C_FREQUENCY 261.625565 /* object forward declaration */ typedef struct _LingotMainFrame LingotMainFrame; // optionally we can use the following libraries //#define LIB_FFTW //#define LIBSNDOBJ // simple try-catch simulation, do not use throw inside loops nor nest try-catch // blocks #define try exception = 0; do #define throw(a) {exception = a;break;} #define catch while (0); if (exception != 0) // this option allows us to throw exception from loops, it contains a goto // statement, but totally controlled. It fails when trying to indent code. //#define try exception = 0;do //#define throw(a) {exception = a;goto catch_label;} //#define catch while (0);catch_label: if (exception != 0) #endif lingot-1.0.1/src/lingot.gresource.xml0000644000175000017500000000042013320113677014527 00000000000000 lingot-gui-mainframe.glade lingot-gui-config-dialog.glade lingot-1.0.1/src/Makefile.am0000644000175000017500000000273513320113677012563 00000000000000AM_CFLAGS = \ -Wall -Wextra \ $(PACKAGE_CFLAGS) $(GTK_CFLAGS) $(ALSA_CFLAGS) $(JACK_CFLAGS) \ -DLINGOT_LOCALEDIR=\""$(datadir)/locale"\" bin_PROGRAMS = lingot lingot_SOURCES = \ lingot-fft.c\ lingot-fft.h\ lingot-audio.c\ lingot-audio.h\ lingot-audio-oss.c\ lingot-audio-oss.h\ lingot-audio-alsa.c\ lingot-audio-alsa.h\ lingot-audio-jack.c\ lingot-audio-jack.h\ lingot-audio-pulseaudio.c\ lingot-audio-pulseaudio.h\ lingot-complex.h\ lingot-complex.c\ lingot-config.c\ lingot-config.h\ lingot-config-scale.c\ lingot-config-scale.h\ lingot-core.c\ lingot-core.h\ lingot-defs.h\ lingot-msg.h\ lingot-msg.c\ lingot-gui-config-dialog.c\ lingot-gui-config-dialog.h\ lingot-gui-config-dialog.glade\ lingot-gui-config-dialog-scale.c\ lingot-gui-config-dialog-scale.h\ lingot-gui-mainframe.c\ lingot-gui-mainframe.h\ lingot-gui-mainframe.glade\ lingot-gauge.c\ lingot-gauge.h\ lingot-filter.c\ lingot-filter.h\ lingot-io-config.c\ lingot-io-config.h\ lingot-signal.c\ lingot-signal.h\ lingot.c\ lingot-i18n.h\ lingot.gresource.xml nodist_lingot_SOURCES = lingot-resources.c BUILT_SOURCES = lingot-resources.c CLEANFILES = lingot-resources.c lingot-resources.c: lingot.gresource.xml $(GLIB_COMPILE_RESOURCES) ${srcdir}/lingot.gresource.xml --target=$@ --sourcedir=${srcdir} --generate-source lingot_LDFLAGS = lingot_LDADD = \ $(PACKAGE_LIBS) $(GTK_LIBS) $(ALSA_LIBS) $(JACK_LIBS) $(PULSEAUDIO_LIBS) $(GLADE_LIBS) $(LIBFFTW_LIBS) \ -lpthread lingot-1.0.1/src/lingot-gauge.c0000644000175000017500000000510213320113677013244 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lingot-gauge.h" void lingot_gauge_new(LingotGauge* gauge, FLT initial_position) { // // ----- ERROR GAUGE FILTER CONFIGURATION ----- // // dynamic model of the gauge: // // 2 // d d // --- s(t) = k (e(t) - s(t)) - q -- s(t) // 2 dt // dt // // acceleration of gauge position 's(t)' linearly depends on the difference // respect to the input stimulus 'e(t)' (destination position). Inserting // a friction coefficient 'q', the acceleration proportionally diminishes with // the velocity (typical friction in mechanics). 'k' is the adaptation // constant, and depends on the gauge mass. // // with the following derivative approximations (valid for high sample rate): // // d // -- s(t) ~= (s[n] - s[n - 1])*fs // dt // // 2 // d 2 // --- s(t) ~= (s[n] - 2*s[n - 1] + s[n - 2])*fs // 2 // dt // // we can obtain a difference equation, and implement it with an IIR digital // filter. // const FLT k = 60; // adaptation constant. const FLT q = 6; // friction coefficient. const FLT a[] = { k + GAUGE_RATE * (q + GAUGE_RATE), -GAUGE_RATE * (q + 2.0 * GAUGE_RATE), GAUGE_RATE * GAUGE_RATE }; const FLT b[] = { k }; lingot_filter_new(&gauge->filter, 2, 0, a, b); lingot_gauge_compute(gauge, initial_position); } void lingot_gauge_destroy(LingotGauge* gauge) { lingot_filter_destroy(&gauge->filter); } void lingot_gauge_compute(LingotGauge* gauge, FLT sample) { gauge->position = lingot_filter_filter_sample(&gauge->filter, sample); } lingot-1.0.1/src/lingot-core.c0000644000175000017500000005501013320113677013107 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include "lingot-fft.h" #include "lingot-signal.h" #include "lingot-core.h" #include "lingot-config.h" #include "lingot-i18n.h" #include "lingot-msg.h" int lingot_core_read_callback(FLT* read_buffer, unsigned int samples_read, void *arg); void lingot_core_run_computation_thread(LingotCore* core); unsigned int decimation_input_index = 0; void lingot_core_new(LingotCore* core, LingotConfig* conf) { char buff[1000]; lingot_config_copy(&core->conf, conf); core->running = 0; core->spd_fft = NULL; core->noise_level = NULL; core->SPL = NULL; core->flt_read_buffer = NULL; core->temporal_buffer = NULL; core->windowed_temporal_buffer = NULL; core->windowed_fft_buffer = NULL; core->hamming_window_temporal = NULL; core->hamming_window_fft = NULL; #ifdef DRAW_MARKERS core->markers_size = 0; core->markers_size2 = 0; #endif unsigned int requested_sample_rate = core->conf.sample_rate; if (core->conf.sample_rate <= 0) { core->conf.sample_rate = 0; } lingot_audio_new(&core->audio, core->conf.audio_system, core->conf.audio_dev[core->conf.audio_system], core->conf.sample_rate, (LingotAudioProcessCallback) lingot_core_read_callback, core); if (core->audio.audio_system != -1) { if (requested_sample_rate != core->audio.real_sample_rate) { core->conf.sample_rate = core->audio.real_sample_rate; lingot_config_update_internal_params(conf); // sprintf(buff, // _("The requested sample rate is not available, the real sample rate has been set to %d Hz"), // core->audio.real_sample_rate); // lingot_msg_add_warning(buff); } if (core->conf.temporal_buffer_size < core->conf.fft_size) { core->conf.temporal_window = ((double) core->conf.fft_size * core->conf.oversampling) / core->conf.sample_rate; core->conf.temporal_buffer_size = core->conf.fft_size; lingot_config_update_internal_params(conf); snprintf(buff, sizeof(buff), _( "The temporal buffer is smaller than FFT size. It has been increased to %0.3f seconds"), core->conf.temporal_window); lingot_msg_add_warning(buff); } // Since the SPD is symmetrical, we only store the 1st half. const unsigned int spd_size = (core->conf.fft_size / 2); core->spd_fft = malloc(spd_size * sizeof(FLT)); core->noise_level = malloc(spd_size * sizeof(FLT)); core->SPL = malloc(spd_size * sizeof(FLT)); memset(core->spd_fft, 0, spd_size * sizeof(FLT)); memset(core->noise_level, 0, spd_size * sizeof(FLT)); memset(core->SPL, 0, spd_size * sizeof(FLT)); // audio source read in floating point format. core->flt_read_buffer = malloc( core->audio.read_buffer_size_samples * sizeof(FLT)); memset(core->flt_read_buffer, 0, core->audio.read_buffer_size_samples * sizeof(FLT)); // stored samples. core->temporal_buffer = malloc( (core->conf.temporal_buffer_size) * sizeof(FLT)); memset(core->temporal_buffer, 0, core->conf.temporal_buffer_size * sizeof(FLT)); core->hamming_window_temporal = NULL; core->hamming_window_fft = NULL; if (core->conf.window_type != NONE) { core->hamming_window_temporal = malloc( (core->conf.temporal_buffer_size) * sizeof(FLT)); core->hamming_window_fft = malloc( (core->conf.fft_size) * sizeof(FLT)); lingot_signal_window(core->conf.temporal_buffer_size, core->hamming_window_temporal, core->conf.window_type); lingot_signal_window(core->conf.fft_size, core->hamming_window_fft, core->conf.window_type); } core->windowed_temporal_buffer = malloc( (core->conf.temporal_buffer_size) * sizeof(FLT)); memset(core->windowed_temporal_buffer, 0, core->conf.temporal_buffer_size * sizeof(FLT)); core->windowed_fft_buffer = malloc( (core->conf.fft_size) * sizeof(FLT)); memset(core->windowed_fft_buffer, 0, core->conf.fft_size * sizeof(FLT)); lingot_fft_plan_create(&core->fftplan, core->windowed_fft_buffer, core->conf.fft_size); /* * 8 order Chebyshev filters, with wc=0.9/i (normalised respect to * Pi). We take 0.9 instead of 1 to leave a 10% of safety margin, * in order to avoid aliased frequencies near to w=Pi, due to non * ideality of the filter. * * The cut frequencies wc=Pi/i, with i=1..20, correspond with the * oversampling factor, avoiding aliasing at decimation. * * Why Chebyshev filters?, for a given order, those filters yield * abrupt falls than other ones as Butterworth, making the most of * the order. Although Chebyshev filters affect more to the phase, * it doesn't matter due to the analysis is made on the signal * power distribution (only magnitude). */ lingot_filter_cheby_design(&core->antialiasing_filter, 8, 0.5, 0.9 / core->conf.oversampling); pthread_mutex_init(&core->temporal_buffer_mutex, NULL); // ------------------------------------------------------------ core->running = 1; } core->freq = 0.0; } // ----------------------------------------------------------------------- /* Deallocate resources */ void lingot_core_destroy(LingotCore* core) { if (core->audio.audio_system != -1) { lingot_fft_plan_destroy(&core->fftplan); lingot_audio_destroy(&core->audio); free(core->spd_fft); free(core->noise_level); free(core->SPL); free(core->flt_read_buffer); free(core->temporal_buffer); free(core->hamming_window_temporal); free(core->windowed_temporal_buffer); free(core->hamming_window_fft); free(core->windowed_fft_buffer); lingot_filter_destroy(&core->antialiasing_filter); pthread_mutex_destroy(&core->temporal_buffer_mutex); } } // ----------------------------------------------------------------------- // reads a new piece of signal from audio source, applies filtering and // decimation and appends it to the buffer int lingot_core_read_callback(FLT* read_buffer, unsigned int samples_read, void *arg) { unsigned int decimation_output_index; // loop variables. unsigned int decimation_output_len; FLT* decimation_in; FLT* decimation_out; LingotCore* core = (LingotCore*) arg; const LingotConfig* const conf = &core->conf; memcpy(core->flt_read_buffer, read_buffer, samples_read * sizeof(FLT)); // double omega = 2.0 * M_PI * 100.0; // double T = 1.0 / conf->sample_rate; // static double t = 0.0; // for (i = 0; i < read_buffer_size; i++) { // core->flt_read_buffer[i] = 1e4 // * (cos(omega * t) + (0.5 * rand()) / RAND_MAX); // t += T; // } // if (conf->gain_nu != 1.0) { // for (i = 0; i < read_buffer_size; i++) // core->flt_read_buffer[i] *= conf->gain_nu; // } // // just read: // // ---------------------------- // |bxxxbxxxbxxxbxxxbxxxbxxxbxxx| // ---------------------------- // // <----------------------------> samples_read // decimation_output_len = 1 + (samples_read - (decimation_input_index + 1)) / conf->oversampling; //#define DUMP #ifdef DUMP static FILE* fid0 = 0x0; if (fid0 == 0x0) { fid0 = fopen("/tmp/dump_pre_filter.txt", "w"); } for (i = 0; i < samples_read; i++) { fprintf(fid0, "%f ", core->flt_read_buffer[i]); } #endif pthread_mutex_lock(&core->temporal_buffer_mutex); /* we shift the temporal window to leave a hollow where place the new piece of data read. The buffer is actually a queue. */ if (conf->temporal_buffer_size > decimation_output_len) { memmove(core->temporal_buffer, &core->temporal_buffer[decimation_output_len], (conf->temporal_buffer_size - decimation_output_len) * sizeof(FLT)); } // // previous buffer situation: // // ------------------------------------------ // | xxxxxxxxxxxxxxxxxxxxxx | yyyyy | aaaaaaa | // ------------------------------------------ // <------> samples_read/oversampling // <---------------> fft_size // <----------------------------------------> temporal_buffer_size // // new situation: // // ------------------------------------------ // | xxxxxxxxxxxxxxxxyyyyaa | aaaaa | | // ------------------------------------------ // // decimation with low-pass filtering /* we decimate the signal and append it at the end of the buffer. */ if (conf->oversampling > 1) { decimation_in = core->flt_read_buffer; decimation_out = &core->temporal_buffer[conf->temporal_buffer_size - decimation_output_len]; // low pass filter to avoid aliasing. lingot_filter_filter(&core->antialiasing_filter, samples_read, decimation_in, decimation_in); // downsampling. for (decimation_output_index = 0; decimation_input_index < samples_read; decimation_output_index++, decimation_input_index += conf->oversampling) { decimation_out[decimation_output_index] = decimation_in[decimation_input_index]; } decimation_input_index -= samples_read; } else { memcpy( &core->temporal_buffer[conf->temporal_buffer_size - decimation_output_len], core->flt_read_buffer, decimation_output_len * sizeof(FLT)); } // // ------------------------------------------ // | xxxxxxxxxxxxxxxxyyyyaa | aaaaa | bbbbbbb | // ------------------------------------------ // pthread_mutex_unlock(&core->temporal_buffer_mutex); #ifdef DUMP static FILE* fid1 = 0x0; static FILE* fid2 = 0x0; if (fid1 == 0x0) { fid1 = fopen("/tmp/dump_post_filter.txt", "w"); fid2 = fopen("/tmp/dump_post.txt", "w"); } for (i = 0; i < samples_read; i++) { fprintf(fid1, "%f ", core->flt_read_buffer[i]); } decimation_out = &core->temporal_buffer[conf->temporal_buffer_size - decimation_output_len]; for (i = 0; i < decimation_output_len; i++) { fprintf(fid2, "%f ", decimation_out[i]); } #endif return 0; } int lingot_core_frequencies_related(FLT freq1, FLT freq2, FLT minFrequency, FLT* mulFreq1ToFreq, FLT* mulFreq2ToFreq) { int result = 0; static const FLT tol = 5e-2; // TODO: tune static const int maxDivisor = 4; if ((freq1 != 0.0) && (freq2 != 0.0)) { FLT smallFreq = freq1; FLT bigFreq = freq2; if (bigFreq < smallFreq) { smallFreq = freq2; bigFreq = freq1; } int divisor; FLT frac; FLT error = -1.0; for (divisor = 1; divisor <= maxDivisor; divisor++) { if (minFrequency * divisor > smallFreq) { break; } frac = bigFreq * divisor / smallFreq; error = fabs(frac - round(frac)); if (error < tol) { if (smallFreq == freq1) { *mulFreq1ToFreq = 1.0 / divisor; *mulFreq2ToFreq = 1.0 / round(frac); } else { *mulFreq1ToFreq = 1.0 / round(frac); *mulFreq2ToFreq = 1.0 / divisor; } result = 1; break; } } } else { *mulFreq1ToFreq = 0.0; *mulFreq2ToFreq = 0.0; } // printf("relation %f, %f = %i\n", freq1, freq2, result); return result; } static FLT lingot_core_frequency_locker(FLT freq, FLT minFrequency) { static int locked = 0; static FLT current_frequency = -1.0; static int hits_counter = 0; static int rehits_counter = 0; static int rehits_up_counter = 0; static const int nhits_to_lock = 4; static const int nhits_to_unlock = 5; static const int nhits_to_relock = 6; static const int nhits_to_relock_up = 8; FLT multiplier = 0.0; FLT multiplier2 = 0.0; static FLT old_multiplier = 0.0; static FLT old_multiplier2 = 0.0; int fail = 0; FLT result = 0.0; #ifdef DRAW_MARKERS printf("f = %f\n", freq); #endif int consistent_with_current_frequency = 0; consistent_with_current_frequency = lingot_core_frequencies_related(freq, current_frequency, minFrequency, &multiplier, &multiplier2); if (!locked) { if ((freq > 0.0) && (current_frequency == 0.0)) { consistent_with_current_frequency = 1; multiplier = 1.0; multiplier2 = 1.0; } // printf("filtering frequency %f, current %f\n", freq, current_frequency); if (consistent_with_current_frequency && (multiplier == 1.0) && (multiplier2 == 1.0)) { current_frequency = freq * multiplier; if (++hits_counter >= nhits_to_lock) { locked = 1; #ifdef DRAW_MARKERS printf("locked to frequency %f\n", current_frequency); #endif hits_counter = 0; } } else { hits_counter = 0; current_frequency = 0.0; } // result = freq; } else { // printf("c = %i, f = %f, cf = %f, multiplier = %f, multiplier2 = %f\n", // consistent_with_current_frequency, freq, current_frequency, // multiplier, multiplier2); if (consistent_with_current_frequency) { if (fabs(multiplier2 - 1.0) < 1e-5) { result = freq * multiplier; current_frequency = result; rehits_counter = 0; if (fabs(multiplier - 1.0) > 1e-5) { if (fabs(multiplier - old_multiplier) < 1e-5) { #ifdef DRAW_MARKERS printf("SEIN!!!! %f!\n", multiplier); #endif if (++rehits_up_counter >= nhits_to_relock_up) { result = freq; current_frequency = result; #ifdef DRAW_MARKERS printf("relock UP!! to %f\n\n\n", freq); #endif rehits_up_counter = 0; fail = 0; } } else { rehits_up_counter = 0; } } else { rehits_up_counter = 0; } } else { rehits_up_counter = 0; #ifdef DRAW_MARKERS printf("%f!\n", multiplier2); #endif if (fabs(multiplier2 - 0.5) < 1e-5) { hits_counter--; } fail = 1; if (freq * multiplier < minFrequency) { #ifdef DRAW_MARKERS printf("warning freq * mul = %f < min\n", freq * multiplier); #endif } else { // result = freq * multiplier; // printf("hop detected!\n"); // current_frequency = result; #ifdef DRAW_MARKERS printf("(%f == %f)?\n", multiplier2, old_multiplier2); #endif if (fabs(multiplier2 - old_multiplier2) < 1e-5) { #ifdef DRAW_MARKERS printf("match for relock, %f == %f\n", multiplier2, old_multiplier2); #endif if (++rehits_counter >= nhits_to_relock) { result = freq * multiplier; current_frequency = result; #ifdef DRAW_MARKERS printf("relock!! to %f\n", freq); #endif rehits_counter = 0; fail = 0; } } } } } else { fail = 1; } if (fail) { result = current_frequency; hits_counter++; if (hits_counter >= nhits_to_unlock) { current_frequency = 0.0; locked = 0; hits_counter = 0; #ifdef DRAW_MARKERS printf("unlocked\n"); #endif result = 0.0; } } else { hits_counter = 0; } } old_multiplier = multiplier; old_multiplier2 = multiplier2; // if (result != 0.0) // printf("result = %f\n", result); return result; } void lingot_core_compute_fundamental_fequency(LingotCore* core) { register unsigned int i, k; // loop variables. const LingotConfig* const conf = &core->conf; const FLT index2f = ((FLT) conf->sample_rate) / (conf->oversampling * conf->fft_size); // FFT resolution in Hz. // const FLT index2w = 2.0 * M_PI / conf->fft_size; // FFT resolution in rads. // const FLT f2w = 2 * M_PI * conf->oversampling / conf->sample_rate; // const FLT w2f = 1.0 / f2w; // ----------------- TRANSFORMATION TO FREQUENCY DOMAIN ---------------- pthread_mutex_lock(&core->temporal_buffer_mutex); // windowing if (conf->window_type != NONE) { for (i = 0; i < conf->fft_size; i++) { core->windowed_fft_buffer[i] = core->temporal_buffer[conf->temporal_buffer_size - conf->fft_size + i] * core->hamming_window_fft[i]; } } else { memmove(core->windowed_fft_buffer, &core->temporal_buffer[conf->temporal_buffer_size - conf->fft_size], conf->fft_size * sizeof(FLT)); } const unsigned int spd_size = (conf->fft_size / 2); // FFT lingot_fft_compute_dft_and_spd(&core->fftplan, core->spd_fft, spd_size); static const FLT minSPL = -200; for (i = 0; i < spd_size; i++) { core->SPL[i] = 10.0 * log10(core->spd_fft[i]); if (core->SPL[i] < minSPL) { core->SPL[i] = minSPL; } } FLT noise_filter_width = 150.0; // hz unsigned int noise_filter_width_samples = ceil( noise_filter_width * conf->fft_size * conf->oversampling / conf->sample_rate); lingot_signal_compute_noise_level(core->SPL, spd_size, noise_filter_width_samples, core->noise_level); for (i = 0; i < spd_size; i++) { core->SPL[i] -= core->noise_level[i]; } unsigned int lowest_index = (unsigned int) ceil( conf->internal_min_frequency * (1.0 * conf->oversampling / conf->sample_rate) * conf->fft_size); unsigned int highest_index = (unsigned int) ceil(0.95 * spd_size); short divisor = 1; FLT f0 = lingot_signal_estimate_fundamental_frequency(core->SPL, 0.5 * core->freq, core->fftplan.fft_out, spd_size, conf->peak_number, lowest_index, highest_index, conf->peak_half_width, index2f, conf->min_SNR, conf->min_overall_SNR, conf->internal_min_frequency, core, &divisor); FLT w; FLT w0 = (f0 == 0.0) ? 0.0 : 2 * M_PI * f0 * conf->oversampling / conf->sample_rate; w = w0; // int Mi = floor(w / index2w); if (w != 0.0) { // windowing if (conf->window_type != NONE) { for (i = 0; i < conf->temporal_buffer_size; i++) { core->windowed_temporal_buffer[i] = core->temporal_buffer[i] * core->hamming_window_temporal[i]; } } else { memmove(core->windowed_temporal_buffer, core->temporal_buffer, conf->temporal_buffer_size * sizeof(FLT)); } } pthread_mutex_unlock(&core->temporal_buffer_mutex); // we don't need the read buffer anymore if (w != 0.0) { // Maximum finding by Newton-Raphson // ----------------------------------- FLT wk = -1.0e5; FLT wkm1 = w; // first iterator set to the current approximation. FLT d0_SPD = 0.0; FLT d1_SPD = 0.0; FLT d2_SPD = 0.0; FLT d0_SPD_old = 0.0; // printf("NR iter: %f ", w * w2f); for (k = 0; (k < conf->max_nr_iter) && (fabs(wk - wkm1) > 1.0e-4); k++) { wk = wkm1; d0_SPD_old = d0_SPD; lingot_fft_spd_diffs_eval(core->windowed_fft_buffer, // TODO: iterate over this buffer? conf->fft_size, wk, &d0_SPD, &d1_SPD, &d2_SPD); wkm1 = wk - d1_SPD / d2_SPD; // printf(" -> (%f,%g,%g,%g)", wkm1 * w2f, d0_SPD, d1_SPD, d2_SPD); if (d0_SPD < d0_SPD_old) { // printf("!!!", d0_SPD, d0_SPD_old); wkm1 = 0.0; break; } } // printf("\n"); if (wkm1 > 0.0) { w = wkm1; // frequency in rads. wk = -1.0e5; d0_SPD = 0.0; // printf("NR2 iter: %f ", w * w2f); for (k = 0; (k <= 1) || ((k < conf->max_nr_iter) && (fabs(wk - wkm1) > 1.0e-4)); k++) { wk = wkm1; // ! we use the WHOLE temporal window for bigger precision. d0_SPD_old = d0_SPD; lingot_fft_spd_diffs_eval(core->windowed_temporal_buffer, conf->temporal_buffer_size, wk, &d0_SPD, &d1_SPD, &d2_SPD); wkm1 = wk - d1_SPD / d2_SPD; // printf(" -> (%f,%g,%g,%g)", wkm1 * w2f, d0_SPD, d1_SPD, d2_SPD); if (d0_SPD < d0_SPD_old) { // printf("!!!"); wkm1 = 0.0; break; } } // printf("\n"); if (wkm1 > 0.0) { w = wkm1; // frequency in rads. } } } FLT freq = (w == 0.0) ? 0.0 : w * conf->sample_rate / (divisor * 2.0 * M_PI * conf->oversampling); // analog frequency in Hz. // core->freq = freq; core->freq = lingot_core_frequency_locker(freq, core->conf.internal_min_frequency); // printf("-> %f\n", core->freq); } /* start running the core in another thread */ void lingot_core_start(LingotCore* core) { int audio_status = 0; decimation_input_index = 0; if (core->audio.audio_system != -1) { audio_status = lingot_audio_start(&core->audio); if (audio_status == 0) { pthread_mutex_init(&core->thread_computation_mutex, NULL); pthread_cond_init(&core->thread_computation_cond, NULL); pthread_attr_init(&core->thread_computation_attr); pthread_create(&core->thread_computation, &core->thread_computation_attr, (void* (*)(void*)) lingot_core_run_computation_thread, core); core->running = 1; } else { core->running = 0; lingot_audio_destroy(&core->audio); } } } /* stop running the core */ void lingot_core_stop(LingotCore* core) { void* thread_result; int result; struct timeval tout, tout_abs; struct timespec tout_tspec; gettimeofday(&tout_abs, NULL); tout.tv_sec = 0; tout.tv_usec = 300000; if (core->running == 1) { core->running = 0; timeradd(&tout, &tout_abs, &tout_abs); tout_tspec.tv_sec = tout_abs.tv_sec; tout_tspec.tv_nsec = 1000 * tout_abs.tv_usec; // watchdog timer pthread_mutex_lock(&core->thread_computation_mutex); result = pthread_cond_timedwait(&core->thread_computation_cond, &core->thread_computation_mutex, &tout_tspec); pthread_mutex_unlock(&core->thread_computation_mutex); if (result == ETIMEDOUT) { fprintf(stderr, "warning: cancelling computation thread\n"); pthread_cancel(core->thread_computation); } else { pthread_join(core->thread_computation, &thread_result); } pthread_attr_destroy(&core->thread_computation_attr); pthread_mutex_destroy(&core->thread_computation_mutex); pthread_cond_destroy(&core->thread_computation_cond); int spd_size = core->conf.fft_size / 2; memset(core->SPL, 0, spd_size * sizeof(FLT)); core->freq = 0.0; } if (core->audio.audio_system != -1) { lingot_audio_stop(&core->audio); } } /* run the core */ void lingot_core_run_computation_thread(LingotCore* core) { struct timeval tout, tout_abs; struct timespec tout_tspec; gettimeofday(&tout_abs, NULL); tout.tv_sec = 0; tout.tv_usec = 1e6 / core->conf.calculation_rate; while (core->running) { lingot_core_compute_fundamental_fequency(core); timeradd(&tout, &tout_abs, &tout_abs); tout_tspec.tv_sec = tout_abs.tv_sec; tout_tspec.tv_nsec = 1000 * tout_abs.tv_usec; pthread_mutex_lock(&core->thread_computation_mutex); pthread_cond_timedwait(&core->thread_computation_cond, &core->thread_computation_mutex, &tout_tspec); pthread_mutex_unlock(&core->thread_computation_mutex); if (core->audio.audio_system != -1) { const unsigned int spd_size = core->conf.fft_size / 2; if (core->audio.interrupted) { memset(core->SPL, 0, spd_size * sizeof(FLT)); core->freq = 0.0; core->running = 0; } } } pthread_mutex_lock(&core->thread_computation_mutex); pthread_cond_broadcast(&core->thread_computation_cond); pthread_mutex_unlock(&core->thread_computation_mutex); } lingot-1.0.1/src/lingot-complex.h0000644000175000017500000000340313320113677013632 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LINGOT_COMPLEX_H_ #define _LINGOT_COMPLEX_H_ #include #include "lingot-defs.h" // single ... complex arithmetic :) typedef FLT LingotComplex[2]; /** * Addition. All parameters can overlap. */ void lingot_complex_add(const LingotComplex a, const LingotComplex b, LingotComplex c); /** * Subtraction. All parameters can overlap. */ void lingot_complex_sub(const LingotComplex a, const LingotComplex b, LingotComplex c); /** * Multiplication. Parameters cannot overlap. */ void lingot_complex_mul(const LingotComplex a, const LingotComplex b, LingotComplex c); /** * Division. Parameters cannot overlap. */ void lingot_complex_div(const LingotComplex a, const LingotComplex b, LingotComplex c); /** * Computes a *= b */ void lingot_complex_mul_by(LingotComplex a, const LingotComplex b); /** * Computes a /= b */ void lingot_complex_div_by(LingotComplex a, const LingotComplex b); #endif lingot-1.0.1/src/lingot-gui-config-dialog.c0000644000175000017500000005740213320113677015452 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include "lingot-defs.h" #include "lingot-core.h" #include "lingot-config.h" #include "lingot-gui-mainframe.h" #include "lingot-gui-config-dialog.h" #include "lingot-i18n.h" #include "lingot-config.h" #include "lingot-io-config.h" #include "lingot-gui-config-dialog-scale.h" #include "lingot-msg.h" int lingot_gui_config_dialog_apply(LingotConfigDialog*); void lingot_gui_config_dialog_close(LingotConfigDialog*); void lingot_gui_config_dialog_data_to_gui(LingotConfigDialog*, const LingotConfig*); void lingot_gui_config_dialog_combo_select_value(GtkWidget* combo, int value); audio_system_t lingot_gui_config_dialog_get_audio_system(GtkComboBoxText* combo); void lingot_gui_config_dialog_set_audio_device(GtkComboBoxText* combo, const gchar* device_name); static const unsigned short frequency_combo_n_octaves = 6; static const unsigned short frequency_combo_first_octave = 1; /* button press event attention routine. */ void lingot_gui_config_dialog_callback_button_cancel(GtkButton *button, LingotConfigDialog* dialog) { (void)button; // Unused parameter. lingot_gui_config_dialog_close(dialog); } void lingot_gui_config_dialog_callback_button_ok(GtkButton *button, LingotConfigDialog* dialog) { (void)button; // Unused parameter. if (lingot_gui_config_dialog_apply(dialog)) { // dumps the current config to the config file lingot_io_config_save(&dialog->conf, CONFIG_FILE_NAME); // establish the current config as the old config, so the close rollback // will do nothing. lingot_config_copy(&dialog->conf_old, &dialog->conf); lingot_gui_config_dialog_close(dialog); } } void lingot_gui_config_dialog_callback_button_apply(GtkButton *button, LingotConfigDialog* dialog) { (void)button; // Unused parameter. if (lingot_gui_config_dialog_apply(dialog)) { lingot_gui_config_dialog_data_to_gui(dialog, &dialog->conf); } } void lingot_gui_config_dialog_callback_button_default(GtkButton *button, LingotConfigDialog* dialog) { (void)button; // Unused parameter. lingot_config_restore_default_values(&dialog->conf); lingot_gui_config_dialog_data_to_gui(dialog, &dialog->conf); gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->octave), 4); } void lingot_gui_config_dialog_callback_cancel(GtkWidget *widget, LingotConfigDialog* dialog) { (void)widget; // Unused parameter. //lingot_mainframe_change_config(dialog->mainframe, &dialog->conf_old); // restore old configuration. lingot_gui_config_dialog_close(dialog); } void lingot_gui_config_dialog_callback_close(GtkWidget *widget, LingotConfigDialog *dialog) { (void)widget; // Unused parameter. lingot_gui_mainframe_change_config(dialog->mainframe, &dialog->conf_old); // restore old configuration. gtk_widget_destroy(dialog->win); lingot_gui_config_dialog_destroy(dialog); } void lingot_gui_config_dialog_callback_change_input_system(GtkWidget *widget, LingotConfigDialog *dialog) { (void)widget; // Unused parameter. char* text = gtk_combo_box_text_get_active_text(dialog->input_system); audio_system_t audio_system = str_to_audio_system_t(text); free(text); LingotAudioSystemProperties properties; if (lingot_audio_get_audio_system_properties(&properties, audio_system) == 0) { GtkListStore* input_dev_model = GTK_LIST_STORE( gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->input_dev))); gtk_list_store_clear(input_dev_model); if (properties.devices != NULL) { int i; for (i = 0; i < properties.n_devices; i++) if (properties.devices[i] != NULL) { gtk_combo_box_text_append_text(dialog->input_dev, properties.devices[i]); } } lingot_gui_config_dialog_set_audio_device(dialog->input_dev, dialog->conf.audio_dev[audio_system]); lingot_audio_audio_system_properties_destroy(&properties); } else { gtk_entry_set_text( GTK_ENTRY(gtk_bin_get_child(GTK_BIN(dialog->input_dev))), ""); gtk_widget_set_sensitive(GTK_WIDGET(dialog->input_dev), FALSE); } } void lingot_gui_config_dialog_set_audio_system(GtkComboBoxText* combo, audio_system_t audio_system) { const char* token = audio_system_t_to_str(audio_system); GtkTreeModel* model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo)); GtkTreeIter iter; gboolean valid = gtk_tree_model_get_iter_first(model, &iter); while (valid) { gchar *str_data; gtk_tree_model_get(model, &iter, 0, &str_data, -1); if (!strcmp(str_data, token)) gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo), &iter); g_free(str_data); valid = gtk_tree_model_iter_next(model, &iter); } } audio_system_t lingot_gui_config_dialog_get_audio_system(GtkComboBoxText* combo) { char* text = gtk_combo_box_text_get_active_text(combo); int result = str_to_audio_system_t(text); free(text); return result; } // extracts the string between <> static const gchar* lingot_gui_config_dialog_get_string(const gchar* str) { static char buffer[1024]; const char* delim = "<>"; char* str_ = strdup(str); char* token = strtok(str_, delim); if ((token == str_) && (strlen(token) != strlen(str))) { token = strtok(NULL, delim); } strcpy(buffer, token ? token : str); free(str_); return buffer; } // extracts the audio device name from the text introduced in the entry (which // includes description) const gchar* lingot_gui_config_dialog_get_audio_device(const gchar* str) { return lingot_gui_config_dialog_get_string(str); } void lingot_gui_config_dialog_set_audio_device(GtkComboBoxText* combo, const gchar* device_name) { GtkTreeModel* model = GTK_TREE_MODEL( gtk_combo_box_get_model(GTK_COMBO_BOX(combo))); GtkTreeIter iter; const gchar* item; const gchar* filtered_item; const gchar* filtered_name = device_name; if (gtk_tree_model_get_iter_first(model, &iter)) { do { gtk_tree_model_get(model, &iter, 0, &item, -1); filtered_item = lingot_gui_config_dialog_get_audio_device(item); if (!strcmp(device_name, filtered_item)) { filtered_name = item; break; } } while (gtk_tree_model_iter_next(model, &iter)); } gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo))), filtered_name); } // extracts the frequency from the text introduced in the entry (which may // include the note name) double lingot_gui_config_dialog_get_frequency(const gchar* str) { char* endptr; const char* double_str = lingot_gui_config_dialog_get_string(str); double result = strtod(double_str, &endptr); if ((result == 0.0) && (endptr == double_str)) { result = -1.0; } else if ((result < 0.0) || (result >= 20000.0)) { // TODO: limits // TODO: warning to the user? result = -1.0; } //printf("frequency '%s' = %f\n", str, result); return result; } void lingot_gui_config_dialog_set_frequency(LingotConfigDialog* dialog, GtkComboBoxText* combo, double frequency) { if (frequency >= 0.0) { static char buffer[20]; double error_cents; int closest_index = lingot_config_scale_get_closest_note_index( &dialog->conf.scale, frequency, dialog->conf.root_frequency_error, &error_cents); double freq2 = lingot_config_scale_get_frequency(&dialog->conf.scale, closest_index); // TODO: deviation if (fabs(frequency - freq2) < 1e-1) { int index = lingot_config_scale_get_note_index(&dialog->conf.scale, closest_index); int octave = lingot_config_scale_get_octave(&dialog->conf.scale, closest_index) + 4; // TODO: note name snprintf(buffer, sizeof(buffer), "%s %d <%0.2f>", dialog->conf.scale.note_name[index], octave, frequency); } else { snprintf(buffer, sizeof(buffer), "%0.2f", frequency); } // printf("closest index to frequency %f is %d, freq %f\n", frequency, // closest_index, freq2); // // printf("frequency name for %f = '%s'\n", frequency, buffer); gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo))), buffer); } } void lingot_gui_config_dialog_populate_frequency_combos(const LingotConfigDialog* dialog) { // TODO: only when necessary static char buff[512]; // Unset the model first and perform the operation over a new Combo to avoid // bug 673079 in gnome: https://bugzilla.gnome.org/show_bug.cgi?id=673079 // TODO: another way? gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->minimum_frequency), NULL); gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->maximum_frequency), NULL); GtkComboBoxText* combo = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new_with_entry()); const LingotConfig* const config = &dialog->conf; int i; int octave_index; for (i = 0; i < config->scale.notes; i++) { for (octave_index = frequency_combo_first_octave; octave_index < frequency_combo_first_octave + frequency_combo_n_octaves; octave_index++) { snprintf(buff, sizeof(buff), "%s%i", 12, config->scale.note_name[i], 7, octave_index); gtk_combo_box_text_append_text(combo, buff); } } gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->minimum_frequency), gtk_combo_box_get_model(GTK_COMBO_BOX(combo))); gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->maximum_frequency), gtk_combo_box_get_model(GTK_COMBO_BOX(combo))); gtk_widget_destroy(GTK_WIDGET(combo)); } void lingot_gui_config_dialog_change_combo_frequency(GtkComboBoxText *combo, LingotConfigDialog *dialog) { int index = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); if (index >= 0) { // the base frequency of the scale corresponds to octave 4, typically C4 int octave = frequency_combo_first_octave + (index % frequency_combo_n_octaves) - 4; int local_index = index / frequency_combo_n_octaves; int global_index = local_index + octave * dialog->conf.scale.notes; double frequency = lingot_config_scale_get_frequency(&dialog->conf.scale, global_index); lingot_gui_config_dialog_set_frequency(dialog, combo, frequency); } } void lingot_gui_config_dialog_change_min_frequency(GtkWidget *widget, LingotConfigDialog *dialog) { lingot_gui_config_dialog_change_combo_frequency(GTK_COMBO_BOX_TEXT(widget), dialog); } void lingot_gui_config_dialog_change_max_frequency(GtkWidget *widget, LingotConfigDialog *dialog) { lingot_gui_config_dialog_change_combo_frequency(GTK_COMBO_BOX_TEXT(widget), dialog); } // updates the enabled/disabled status of some widgets depending on the status of the check button static void lingot_gui_config_dialog_optimize_check_toggled_update(LingotConfigDialog *dialog) { gboolean enabled = !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(dialog->optimize_check_button)); GtkWidget* widgets[] = { GTK_WIDGET(dialog->fft_size_label), GTK_WIDGET( dialog->fft_size), GTK_WIDGET(dialog->fft_size_units_label), GTK_WIDGET(dialog->temporal_window_label), GTK_WIDGET( dialog->temporal_window), GTK_WIDGET( dialog->temporal_window_units_label), 0x0 }; unsigned int i; for (i = 0; widgets[i] != 0x0; i++) { gtk_widget_set_sensitive(widgets[i], enabled); } } void lingot_gui_config_dialog_optimize_check_toggled(GtkWidget *widget, LingotConfigDialog *dialog) { (void)widget; // Unused parameter. lingot_gui_config_dialog_optimize_check_toggled_update(dialog); } void lingot_gui_config_dialog_combo_select_value(GtkWidget* combo, int value) { GtkTreeModel* model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo)); GtkTreeIter iter; gboolean valid = gtk_tree_model_get_iter_first(model, &iter); while (valid) { gchar *str_data; gtk_tree_model_get(model, &iter, 0, &str_data, -1); if (atoi(str_data) == value) gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo), &iter); g_free(str_data); valid = gtk_tree_model_iter_next(model, &iter); } } void lingot_gui_config_dialog_data_to_gui(LingotConfigDialog* dialog, const LingotConfig* conf) { lingot_gui_config_dialog_set_audio_system(dialog->input_system, conf->audio_system); lingot_gui_config_dialog_set_audio_device(dialog->input_dev, conf->audio_dev[conf->audio_system]); gtk_range_set_value(GTK_RANGE(dialog->calculation_rate), conf->calculation_rate); gtk_range_set_value(GTK_RANGE(dialog->visualization_rate), conf->visualization_rate); gtk_range_set_value(GTK_RANGE(dialog->noise_threshold), conf->min_overall_SNR); gtk_spin_button_set_value(dialog->root_frequency_error, conf->root_frequency_error); gtk_spin_button_set_value(dialog->temporal_window, conf->temporal_window); lingot_gui_config_dialog_combo_select_value(GTK_WIDGET(dialog->fft_size), conf->fft_size); lingot_gui_config_dialog_set_frequency(dialog, dialog->minimum_frequency, conf->min_frequency); lingot_gui_config_dialog_set_frequency(dialog, dialog->maximum_frequency, conf->max_frequency); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->optimize_check_button), conf->optimize_internal_parameters); lingot_gui_config_dialog_scale_data_to_gui(dialog, &conf->scale); } int lingot_gui_config_dialog_gui_to_data(const LingotConfigDialog* dialog, LingotConfig* conf) { gchar* text1; // validation if (!lingot_gui_config_dialog_scale_validate(dialog, &conf->scale)) { return 0; } const char* audio_device = lingot_gui_config_dialog_get_audio_device( gtk_entry_get_text( GTK_ENTRY(gtk_bin_get_child(GTK_BIN(dialog->input_dev))))); LingotConfigParameterSpec audioDeviceSpec = lingot_io_config_get_parameter_spec(LINGOT_PARAMETER_ID_AUDIO_DEV); if (strlen(audio_device) >= audioDeviceSpec.str_max_len) { lingot_msg_add_error(_("Audio device identifier too long")); gtk_notebook_set_current_page(dialog->notebook, 0); return 0; } // TODO: value? int sample_rate = 44100; // LingotConfigParameterSpec sampleRateSpec = lingot_config_get_parameter_spec( // LINGOT_PARAMETER_ID_SAMPLE_RATE); // // // TODO: generalize validation? // if ((sample_rate < sampleRateSpec.int_min) // || (sample_rate > sampleRateSpec.int_max)) { // char buff[1000]; // sprintf(buff, "%s %i - %i %s", _("Sample rate out of range"), // sampleRateSpec.int_min, sampleRateSpec.int_max, // sampleRateSpec.units); // lingot_msg_add_error(buff); // gtk_notebook_set_current_page(dialog->notebook, 0); // return 0; // } conf->audio_system = lingot_gui_config_dialog_get_audio_system( dialog->input_system); snprintf(conf->audio_dev[conf->audio_system], sizeof(conf->audio_dev[conf->audio_system]), "%s", lingot_gui_config_dialog_get_audio_device( gtk_entry_get_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN(dialog->input_dev)))))); conf->root_frequency_error = gtk_spin_button_get_value( dialog->root_frequency_error); conf->calculation_rate = gtk_range_get_value( GTK_RANGE(dialog->calculation_rate)); conf->visualization_rate = gtk_range_get_value( GTK_RANGE(dialog->visualization_rate)); conf->temporal_window = gtk_spin_button_get_value(dialog->temporal_window); conf->min_overall_SNR = gtk_range_get_value( GTK_RANGE(dialog->noise_threshold)); conf->optimize_internal_parameters = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(dialog->optimize_check_button)); double min_freq = lingot_gui_config_dialog_get_frequency( gtk_entry_get_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN(dialog->minimum_frequency))))); double max_freq = lingot_gui_config_dialog_get_frequency( gtk_entry_get_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN(dialog->maximum_frequency))))); const LingotConfigParameterSpec minimumFrequencySpec = lingot_io_config_get_parameter_spec(LINGOT_PARAMETER_ID_MINIMUM_FREQUENCY); const LingotConfigParameterSpec maximumFrequencySpec = lingot_io_config_get_parameter_spec(LINGOT_PARAMETER_ID_MAXIMUM_FREQUENCY); if (min_freq <= max_freq) { if ((min_freq >= minimumFrequencySpec.float_min) && (min_freq <= minimumFrequencySpec.float_max)) { conf->min_frequency = min_freq; } if ((max_freq >= maximumFrequencySpec.float_min) && (max_freq <= maximumFrequencySpec.float_max)) { conf->max_frequency = max_freq; } } text1 = gtk_combo_box_text_get_active_text(dialog->fft_size); conf->fft_size = atoi(text1); g_free(text1); conf->sample_rate = sample_rate; lingot_config_scale_destroy(&conf->scale); lingot_gui_config_dialog_scale_gui_to_data(dialog, &conf->scale); lingot_config_update_internal_params(conf); lingot_gui_mainframe_change_config(dialog->mainframe, conf); if (conf->scale.max_offset_rounded > 200) { lingot_msg_add_warning( _("The provided scale contains wide gaps in frequency that increase the gauge range and produce a loss of visual accuracy. Consider providing scales with at least 12 tones, or with a maximum distance between adjacent notes below 200 cents.")); } lingot_gui_config_dialog_populate_frequency_combos(dialog); return 1; } int lingot_gui_config_dialog_apply(LingotConfigDialog* dialog) { return lingot_gui_config_dialog_gui_to_data(dialog, &dialog->conf); } void lingot_gui_config_dialog_destroy(LingotConfigDialog* dialog) { dialog->mainframe->config_dialog = NULL; lingot_config_destroy(&dialog->conf); lingot_config_destroy(&dialog->conf_old); free(dialog); } void lingot_gui_config_dialog_close(LingotConfigDialog* dialog) { dialog->mainframe->config_dialog = NULL; gtk_widget_destroy(dialog->win); } void lingot_gui_config_dialog_show(LingotMainFrame* frame, LingotConfig* config) { if (frame->config_dialog == NULL) { LingotConfigDialog* dialog = malloc(sizeof(LingotConfigDialog)); dialog->mainframe = frame; lingot_config_new(&dialog->conf); lingot_config_new(&dialog->conf_old); // config copy lingot_config_copy(&dialog->conf, (config == NULL) ? &frame->conf : config); lingot_config_copy(&dialog->conf_old, &frame->conf); GtkBuilder* builder = gtk_builder_new(); gtk_builder_add_from_resource(builder, "/org/nongnu/lingot/lingot-gui-config-dialog.glade", NULL); dialog->win = GTK_WIDGET(gtk_builder_get_object(builder, "dialog1")); gtk_window_set_icon(GTK_WINDOW(dialog->win), gtk_window_get_icon(GTK_WINDOW(frame->win))); //gtk_window_set_position(GTK_WINDOW(dialog->win), GTK_WIN_POS_CENTER_ALWAYS); dialog->mainframe->config_dialog = dialog; dialog->input_system = GTK_COMBO_BOX_TEXT( gtk_builder_get_object(builder, "input_system")); #ifdef OSS gtk_combo_box_text_append_text(dialog->input_system, audio_system_t_to_str(AUDIO_SYSTEM_OSS)); #endif #ifdef ALSA gtk_combo_box_text_append_text(dialog->input_system, audio_system_t_to_str(AUDIO_SYSTEM_ALSA)); #endif #ifdef JACK gtk_combo_box_text_append_text(dialog->input_system, audio_system_t_to_str(AUDIO_SYSTEM_JACK)); #endif #ifdef PULSEAUDIO gtk_combo_box_text_append_text(dialog->input_system, audio_system_t_to_str(AUDIO_SYSTEM_PULSEAUDIO)); #endif dialog->input_dev = GTK_COMBO_BOX_TEXT( gtk_builder_get_object(builder, "input_dev")); dialog->calculation_rate = GTK_SCALE( gtk_builder_get_object(builder, "calculation_rate")); dialog->visualization_rate = GTK_SCALE( gtk_builder_get_object(builder, "visualization_rate")); dialog->noise_threshold = GTK_SCALE( gtk_builder_get_object(builder, "noise_threshold")); dialog->fft_size = GTK_COMBO_BOX_TEXT( gtk_builder_get_object(builder, "fft_size")); dialog->temporal_window = GTK_SPIN_BUTTON( gtk_builder_get_object(builder, "temporal_window")); dialog->root_frequency_error = GTK_SPIN_BUTTON( gtk_builder_get_object(builder, "root_frequency_error")); dialog->minimum_frequency = GTK_COMBO_BOX_TEXT( gtk_builder_get_object(builder, "minimum_frequency")); dialog->maximum_frequency = GTK_COMBO_BOX_TEXT( gtk_builder_get_object(builder, "maximum_frequency")); dialog->notebook = GTK_NOTEBOOK( gtk_builder_get_object(builder, "notebook1")); dialog->optimize_check_button = GTK_CHECK_BUTTON( gtk_builder_get_object(builder, "optimize_check_button")); dialog->fft_size_label = GTK_LABEL( gtk_builder_get_object(builder, "fft_size_label")); dialog->fft_size_units_label = GTK_LABEL( gtk_builder_get_object(builder, "fft_size_units_label")); dialog->temporal_window_label = GTK_LABEL( gtk_builder_get_object(builder, "temporal_window_label")); dialog->temporal_window_units_label = GTK_LABEL( gtk_builder_get_object(builder, "temporal_window_units_label")); dialog->octave = GTK_COMBO_BOX_TEXT( gtk_builder_get_object(builder, "octave")); gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->octave), 4); gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(dialog->minimum_frequency), frequency_combo_n_octaves); gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(dialog->maximum_frequency), frequency_combo_n_octaves); GList* cell_list = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT(dialog->minimum_frequency)); if (cell_list && cell_list->data) { gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT(dialog->minimum_frequency), cell_list->data, "markup", 0, NULL); } cell_list = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT(dialog->maximum_frequency)); if (cell_list && cell_list->data) { gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT(dialog->maximum_frequency), cell_list->data, "markup", 0, NULL); } lingot_gui_config_dialog_scale_show(dialog, builder); g_signal_connect(dialog->input_system, "changed", G_CALLBACK(lingot_gui_config_dialog_callback_change_input_system), dialog); g_signal_connect(dialog->root_frequency_error, "value_changed", G_CALLBACK(lingot_gui_config_dialog_scale_callback_change_deviation), dialog); g_signal_connect(dialog->octave, "changed", G_CALLBACK(lingot_gui_config_dialog_scale_callback_change_octave), dialog); g_signal_connect(dialog->minimum_frequency, "changed", G_CALLBACK(lingot_gui_config_dialog_change_min_frequency), dialog); g_signal_connect(dialog->maximum_frequency, "changed", G_CALLBACK(lingot_gui_config_dialog_change_max_frequency), dialog); g_signal_connect(dialog->optimize_check_button, "toggled", G_CALLBACK(lingot_gui_config_dialog_optimize_check_toggled), dialog); g_signal_connect(gtk_builder_get_object(builder, "button_default"), "clicked", G_CALLBACK(lingot_gui_config_dialog_callback_button_default), dialog); g_signal_connect(gtk_builder_get_object(builder, "button_apply"), "clicked", G_CALLBACK(lingot_gui_config_dialog_callback_button_apply), dialog); g_signal_connect(gtk_builder_get_object(builder, "button_accept"), "clicked", G_CALLBACK(lingot_gui_config_dialog_callback_button_ok), dialog); g_signal_connect(gtk_builder_get_object(builder, "button_cancel"), "clicked", G_CALLBACK(lingot_gui_config_dialog_callback_button_cancel), dialog); g_signal_connect(dialog->win, "destroy", G_CALLBACK(lingot_gui_config_dialog_callback_close), dialog); lingot_gui_config_dialog_data_to_gui(dialog, &dialog->conf); gtk_widget_show(dialog->win); GtkWidget* scroll = GTK_WIDGET( gtk_builder_get_object(builder, "scrolledwindow1")); gtk_widget_show_all(scroll); g_object_unref(builder); lingot_gui_config_dialog_populate_frequency_combos(dialog); } else { if (config != NULL) { lingot_config_copy(&frame->config_dialog->conf, config); lingot_gui_config_dialog_data_to_gui(frame->config_dialog, &frame->config_dialog->conf); } gtk_window_present(GTK_WINDOW(frame->config_dialog->win)); } if (config != NULL) { lingot_config_destroy(config); } } lingot-1.0.1/src/lingot-config.c0000644000175000017500000001207713320113677013432 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include "lingot-defs.h" #include "lingot-config.h" #include "lingot-config-scale.h" #include "lingot-msg.h" #include "lingot-i18n.h" #define MAX(a, b) (((a) > (b)) ? (a) : (b)) void lingot_config_new(LingotConfig* config) { config->max_nr_iter = 10; // iterations config->window_type = HAMMING; config->optimize_internal_parameters = 0; lingot_config_scale_new(&config->scale); } void lingot_config_destroy(LingotConfig* config) { lingot_config_scale_destroy(&config->scale); } void lingot_config_copy(LingotConfig* dst, const LingotConfig* src) { *dst = *src; lingot_config_scale_new(&dst->scale); // null scale that will be destroyed in the copy below lingot_config_scale_copy(&dst->scale, &src->scale); } //---------------------------------------------------------------------------- void lingot_config_restore_default_values(LingotConfig* config) { #if defined(DEFAULT_AUDIO_SYSTEM_OSS) config->audio_system = AUDIO_SYSTEM_OSS; #elif defined(DEFAULT_AUDIO_SYSTEM_JACK) config->audio_system = AUDIO_SYSTEM_JACK; #elif defined(DEFAULT_AUDIO_SYSTEM_PULSEAUDIO) config->audio_system = AUDIO_SYSTEM_PULSEAUDIO; #else config->audio_system = AUDIO_SYSTEM_ALSA; #endif sprintf(config->audio_dev[AUDIO_SYSTEM_OSS], "%s", "/dev/dsp"); sprintf(config->audio_dev[AUDIO_SYSTEM_ALSA], "%s", "default"); sprintf(config->audio_dev[AUDIO_SYSTEM_JACK], "%s", "default"); sprintf(config->audio_dev[AUDIO_SYSTEM_PULSEAUDIO], "%s", "default"); config->sample_rate = 44100; // Hz config->oversampling = 21; config->root_frequency_error = 0.0; // Hz config->min_frequency = 82.407; // Hz (E2) config->max_frequency = 329.6276; // Hz (E4) config->optimize_internal_parameters = 0; config->fft_size = 512; // samples config->temporal_window = 0.3; // seconds config->calculation_rate = 15.0; // Hz config->visualization_rate = 24.0; // Hz config->min_overall_SNR = 20.0; // dB config->peak_number = 8; // peaks config->peak_half_width = 1; // samples //-------------------------------------------------------------------------- lingot_config_scale_restore_default_values(&config->scale); lingot_config_update_internal_params(config); } //---------------------------------------------------------------------------- void lingot_config_update_internal_params(LingotConfig* config) { // derived parameters. config->internal_min_frequency = 0.8 * config->min_frequency; config->internal_max_frequency = 3.1 * config->max_frequency; if (config->internal_min_frequency < 0) { config->internal_min_frequency = 0; } if (config->internal_max_frequency < 500) { config->internal_max_frequency = 500; } if (config->internal_max_frequency > 20000) { config->internal_max_frequency = 20000; } config->oversampling = floor( 0.5 * config->sample_rate / config->internal_max_frequency); if (config->oversampling < 1) { config->oversampling = 1; } // TODO: tune this parameters unsigned int fft_size = 512; if (config->internal_max_frequency > 5000) { fft_size = 1024; } FLT temporal_window = 1.0 * config->fft_size * config->oversampling / config->sample_rate; if (temporal_window < 0.3) { temporal_window = 0.3; } if (config->optimize_internal_parameters) { config->fft_size = fft_size; config->temporal_window = temporal_window; } else { // if the governed parameters happen to be the same as the one we would // suggest, then we will indeed suggest them. config->optimize_internal_parameters = (config->fft_size == fft_size) && (config->temporal_window == temporal_window); } config->temporal_buffer_size = (unsigned int) ceil( config->temporal_window * config->sample_rate / config->oversampling); config->min_SNR = 0.5 * config->min_overall_SNR; config->peak_half_width = (config->fft_size > 256) ? 2 : 1; if (config->scale.notes == 1) { config->scale.max_offset_rounded = 1200.0; } else { int i; FLT max_offset = 0.0; for (i = 1; i < config->scale.notes; i++) { max_offset = MAX(max_offset, config->scale.offset_cents[i] - config->scale.offset_cents[i - 1]); } config->scale.max_offset_rounded = max_offset; } config->gauge_rest_value = -0.45 * config->scale.max_offset_rounded; } lingot-1.0.1/src/lingot-audio-jack.h0000644000175000017500000000263113320113677014174 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef JACK #ifndef __LINGOT_AUDIO_JACK_H__ #define __LINGOT_AUDIO_JACK_H__ #include "lingot-audio.h" void lingot_audio_jack_new(LingotAudioHandler*, const char* device); // In case of failure, audio_system is set to -1. void lingot_audio_jack_destroy(LingotAudioHandler*); int lingot_audio_jack_read(LingotAudioHandler*); int lingot_audio_jack_get_audio_system_properties(LingotAudioSystemProperties*); // Return status : 0 for OK, else -1. int lingot_audio_jack_start(LingotAudioHandler*); void lingot_audio_jack_stop(LingotAudioHandler*); #endif #endif lingot-1.0.1/src/lingot-gui-config-dialog.h0000644000175000017500000000416213320113677015452 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_GUI_CONFIG_DIALOG_H__ #define __LINGOT_GUI_CONFIG_DIALOG_H__ #include #include "lingot-config.h" typedef struct _LingotConfigDialog LingotConfigDialog; struct _LingotConfigDialog { // widgets that contains configuration information. GtkComboBoxText* input_system; GtkComboBoxText* input_dev; GtkScale* calculation_rate; GtkScale* visualization_rate; GtkScale* noise_threshold; GtkComboBoxText* fft_size; GtkSpinButton* temporal_window; GtkSpinButton* root_frequency_error; GtkComboBoxText* minimum_frequency; GtkComboBoxText* maximum_frequency; GtkComboBoxText* octave; GtkCheckButton* optimize_check_button; GtkLabel* fft_size_label; GtkLabel* fft_size_units_label; GtkLabel* temporal_window_label; GtkLabel* temporal_window_units_label; GtkNotebook* notebook; GtkButton* button_scale_add; GtkButton* button_scale_del; GtkEntry* scale_name; GtkTreeView* scale_treeview; LingotConfig conf; // provisional configuration. LingotConfig conf_old; // restoration point for cancel. LingotMainFrame* mainframe; GtkWidget* win; // window }; void lingot_gui_config_dialog_destroy(LingotConfigDialog*); void lingot_gui_config_dialog_show(LingotMainFrame* frame, LingotConfig* config); #endif // __LINGOT_GUI_CONFIG_DIALOG_H__ lingot-1.0.1/src/lingot-audio-oss.h0000644000175000017500000000247613320113677014077 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef OSS #ifndef __LINGOT_AUDIO_OSS_H__ #define __LINGOT_AUDIO_OSS_H__ #include "lingot-audio.h" void lingot_audio_oss_new(LingotAudioHandler*, const char* device, int sample_rate); // In case of failure, audio_system is set to -1. void lingot_audio_oss_destroy(LingotAudioHandler*); int lingot_audio_oss_read(LingotAudioHandler*); int lingot_audio_oss_get_audio_system_properties(LingotAudioSystemProperties*); // Return status : 0 for OK, else -1. #endif #endif lingot-1.0.1/src/lingot-audio.h0000644000175000017500000000630113320113677013264 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_AUDIO_H__ #define __LINGOT_AUDIO_H__ #ifdef ALSA #include #endif #ifdef JACK #include #endif #ifdef PULSEAUDIO #include #endif #include "lingot-config.h" typedef void (*LingotAudioProcessCallback)(FLT* read_buffer, unsigned int read_buffer_size_samples, void *arg); #define FLT_SAMPLE_SCALE 32767.0 typedef struct { int audio_system; char device[100]; LingotAudioProcessCallback process_callback; void* process_callback_arg; # ifdef OSS int dsp; // file handler. # endif # ifdef ALSA snd_pcm_t *capture_handle; # endif # ifdef JACK jack_port_t *jack_input_port; jack_client_t *jack_client; int nframes; # endif # ifdef PULSEAUDIO pa_simple *pa_client; # endif # if !defined(OSS) && !defined(ALSA) && !defined(PULSEAUDIO) && !defined(JACK) # error "No audio system has been enabled" # endif unsigned int read_buffer_size_samples; FLT* flt_read_buffer; unsigned int real_sample_rate; short bytes_per_sample; // pthread-related member variables pthread_t thread_input_read; pthread_attr_t thread_input_read_attr; pthread_cond_t thread_input_read_cond; pthread_mutex_t thread_input_read_mutex; // indicates whether the audio thread is running int running; // indicates whether the thread was interrupted (by the audio server, not // by the user) int interrupted; } LingotAudioHandler; typedef struct { int forced_sample_rate; // tells whether the sample rate can be changed int n_sample_rates; // number of available sample rates int sample_rates [5]; // sample rates int n_devices; // number of available devices char** devices; // devices } LingotAudioSystemProperties; int lingot_audio_get_audio_system_properties( LingotAudioSystemProperties*, audio_system_t audio_system); // Return status : 0 for OK, else -1. void lingot_audio_audio_system_properties_destroy(LingotAudioSystemProperties*); // creates an audio handler void lingot_audio_new(LingotAudioHandler*, audio_system_t audio_system, const char* device, int sample_rate, LingotAudioProcessCallback process_callback, void *process_callback_arg); // In case of failure, audio_system is set to -1 in the LingotAudioHandler struct. // destroys an audio handler void lingot_audio_destroy(LingotAudioHandler*); int lingot_audio_start(LingotAudioHandler*); void lingot_audio_stop(LingotAudioHandler*); #endif lingot-1.0.1/src/lingot-audio-jack.c0000644000175000017500000002071113320113677014166 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef JACK #include #include "lingot-defs.h" #include "lingot-audio-jack.h" #include "lingot-i18n.h" #include "lingot-msg.h" #include // persistent JACK client to obtain hardware parameters jack_client_t* client = NULL; pthread_mutex_t stop_mutex = PTHREAD_MUTEX_INITIALIZER; // this array allows us to reconnect the client to the last ports it was // connected in a previous session #define MAX_LAST_PORTS 10 char last_ports[MAX_LAST_PORTS][80]; int lingot_audio_jack_process(jack_nframes_t nframes, void* param) { LingotAudioHandler* audio = param; audio->nframes = nframes; pthread_mutex_lock(&stop_mutex); if (audio->running) { lingot_audio_jack_read(audio); audio->process_callback(audio->flt_read_buffer, audio->read_buffer_size_samples, audio->process_callback_arg); } pthread_mutex_unlock(&stop_mutex); return 0; } // JACK calls this shutdown_callback if the server ever shuts down or // decides to disconnect the client. void lingot_audio_jack_shutdown(void* param) { LingotAudioHandler* audio = param; lingot_msg_add_error(_("Missing connection with JACK audio server")); pthread_mutex_lock(&stop_mutex); audio->interrupted = 1; pthread_mutex_unlock(&stop_mutex); } void lingot_audio_jack_new(LingotAudioHandler* audio, const char* device) { const char* exception; // const char **ports = NULL; const char *client_name = "lingot"; const char *server_name = NULL; jack_options_t options = JackNoStartServer; jack_status_t status; strcpy(audio->device, ""); audio->bytes_per_sample = -1; audio->audio_system = AUDIO_SYSTEM_JACK; audio->jack_client = jack_client_open(client_name, options, &status, server_name); try { if (audio->jack_client == NULL) { throw(_("Unable to connect to JACK server")); } if (status & JackServerStarted) { fprintf(stderr, "JACK server started\n"); } if (status & JackNameNotUnique) { client_name = jack_get_client_name(audio->jack_client); fprintf(stderr, "unique name `%s' assigned\n", client_name); } jack_on_shutdown(audio->jack_client, lingot_audio_jack_shutdown, audio); audio->real_sample_rate = jack_get_sample_rate(audio->jack_client); audio->read_buffer_size_samples = jack_get_buffer_size( audio->jack_client); // printf("engine sample rate: %" PRIu32 "\n", jack_get_sample_rate( // audio->jack_client)); // printf("buffer size: %" PRIu32 "\n", jack_get_buffer_size( // audio->jack_client)); audio->jack_input_port = jack_port_register(audio->jack_client, "input", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); if ((audio->jack_input_port == NULL)) { throw(_("No more JACK ports available")); } snprintf(audio->device, sizeof(audio->device), "%s", device); }catch { audio->audio_system = -1; lingot_msg_add_error(exception); } if (audio->audio_system == AUDIO_SYSTEM_JACK) { client = audio->jack_client; } } void lingot_audio_jack_destroy(LingotAudioHandler* audio) { if (audio->audio_system == AUDIO_SYSTEM_JACK) { //jack_cycle_wait(audio->jack_client); // jack_deactivate(audio->jack_client); jack_client_close(audio->jack_client); client = NULL; } } int lingot_audio_jack_read(LingotAudioHandler* audio) { register int i; float* in = jack_port_get_buffer(audio->jack_input_port, audio->nframes); for (i = 0; i < audio->nframes; i++) audio->flt_read_buffer[i] = in[i] * FLT_SAMPLE_SCALE; return 0; } int lingot_audio_jack_get_audio_system_properties( LingotAudioSystemProperties* properties) { int sample_rate = -1; const char *client_name = "lingot-get-audio-properties"; const char *server_name = NULL; jack_options_t options = JackNoStartServer; jack_status_t status; jack_client_t* jack_client = NULL; const char **ports = NULL; const char* exception; unsigned long int flags = JackPortIsOutput; properties->forced_sample_rate = 1; properties->n_devices = 0; properties->devices = NULL; try { if (client == NULL) { jack_client = jack_client_open(client_name, options, &status, server_name); if (jack_client == NULL) { throw(_("Unable to connect to JACK server")); } if (status & JackServerStarted) { fprintf(stderr, "JACK server started\n"); } if (status & JackNameNotUnique) { client_name = jack_get_client_name(jack_client); fprintf(stderr, "unique name `%s' assigned\n", client_name); } } else { sample_rate = jack_get_sample_rate(client); ports = jack_get_ports(client, NULL, NULL, flags); } }catch { // here I throw a warning message because we are only ontaining the // audio properties // lingot_msg_add_warning(exception); fprintf(stderr, "%s", exception); } properties->forced_sample_rate = 1; properties->n_devices = 1; if (ports != NULL) { int i; for (i = 0; ports[i] != NULL; i++) { } properties->n_devices = i + 1; } properties->devices = (char**) malloc( properties->n_devices * sizeof(char*)); char buff[512]; snprintf(buff, sizeof(buff), "%s ", _("Default Port")); properties->devices[0] = strdup(buff); if (ports != NULL) { if (properties->n_devices != 0) { int i; for (i = 0; ports[i] != NULL; i++) { properties->devices[i + 1] = strdup(ports[i]); } } } if (sample_rate == -1) { properties->n_sample_rates = 0; } else { properties->n_sample_rates = 1; properties->sample_rates[0] = sample_rate; } if (ports != NULL) { jack_free(ports); } if (jack_client != NULL) { jack_client_close(jack_client); } return 0; } int lingot_audio_jack_start(LingotAudioHandler* audio) { int result = 0; int index = 0; const char **ports = NULL; const char* exception; jack_set_process_callback(audio->jack_client, lingot_audio_jack_process, audio); try { if (jack_activate(audio->jack_client)) { throw(_("Cannot activate client")); } ports = jack_get_ports(audio->jack_client, NULL, NULL, JackPortIsOutput); if (ports == NULL) { throw(_("No active capture ports")); } if (!strcmp(audio->device, "default")) { // try to connect the client to the ports is was connected before int j = 0; int connections = 0; for (j = 0; j < MAX_LAST_PORTS; j++) { for (index = 0; ports[index]; index++) { if (!strcmp(last_ports[j], ports[index])) { if (jack_connect(audio->jack_client, ports[index], jack_port_name(audio->jack_input_port))) { throw(_("Cannot connect input ports")); } else { connections++; } } } } // if there wasn't connections before, we connect the client to the // first physical port if (!connections) { if (jack_connect(audio->jack_client, ports[0], jack_port_name(audio->jack_input_port))) { throw(_("Cannot connect input ports")); } } } else { if (jack_connect(audio->jack_client, audio->device, jack_port_name(audio->jack_input_port))) { char buff[512]; snprintf(buff, sizeof(buff), _("Cannot connect to requested port '%s'"), audio->device); throw(buff); } } }catch { lingot_msg_add_error(exception); result = -1; lingot_audio_jack_stop(audio); } if (ports != NULL) { jack_free(ports); } return result; } void lingot_audio_jack_stop(LingotAudioHandler* audio) { //jack_cycle_wait(audio->jack_client); const char** ports = jack_get_ports(audio->jack_client, NULL, NULL, JackPortIsOutput); if (ports != NULL) { int i, j = 0; for (i = 0; i < MAX_LAST_PORTS; i++) { strcpy(last_ports[i], ""); } for (i = 0; ports[i]; i++) { if (jack_port_connected( jack_port_by_name(audio->jack_client, ports[i]))) { strcpy(last_ports[j++], ports[i]); } } } pthread_mutex_lock(&stop_mutex); jack_deactivate(audio->jack_client); pthread_mutex_unlock(&stop_mutex); } #endif lingot-1.0.1/src/lingot-complex.c0000644000175000017500000000360313320113677013627 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lingot-complex.h" void lingot_complex_add(const LingotComplex a, const LingotComplex b, LingotComplex c) { c[0] = a[0] + b[0]; c[1] = a[1] + b[1]; } void lingot_complex_sub(const LingotComplex a, const LingotComplex b, LingotComplex c) { c[0] = a[0] - b[0]; c[1] = a[1] - b[1]; } void lingot_complex_mul(const LingotComplex a, const LingotComplex b, LingotComplex c) { c[0] = a[0] * b[0] - a[1] * b[1]; c[1] = a[1] * b[0] + a[0] * b[1]; } void lingot_complex_div(const LingotComplex a, const LingotComplex b, LingotComplex c) { FLT bm2 = b[0] * b[0] + b[1] * b[1]; c[0] = (a[0] * b[0] + a[1] * b[1]) / bm2; c[1] = (a[1] * b[0] - a[0] * b[1]) / bm2; } void lingot_complex_mul_by(LingotComplex a, const LingotComplex b) { double rr = a[0] * b[0] - a[1] * b[1]; a[1] = a[1] * b[0] + a[0] * b[1]; a[0] = rr; } void lingot_complex_div_by(LingotComplex a, const LingotComplex b) { FLT bm2 = b[0] * b[0] + b[1] * b[1]; double rr = (a[0] * b[0] + a[1] * b[1]) / bm2; a[1] = (a[1] * b[0] - a[0] * b[1]) / bm2; a[0] = rr; } lingot-1.0.1/src/lingot-gui-mainframe.h0000644000175000017500000000374113320113677014711 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_GUI_MAIN_FRAME_H__ #define __LINGOT_GUI_MAIN_FRAME_H__ #include "lingot-defs.h" #include "lingot-core.h" #include "lingot-gauge.h" #include "lingot-config.h" #include "lingot-filter.h" #include "lingot-gui-config-dialog.h" #include // Window that contains all controls, graphics, etc. of the tuner. struct _LingotMainFrame { // gtk widgets GtkWidget* gauge_area; GtkWidget* spectrum_area; GtkWidget* tone_label; GtkWidget* view_spectrum_item; GtkWidget* spectrum_frame; GtkWidget* freq_label; GtkWidget* error_label; GtkWidget* labelsbox; LingotFilter freq_filter; LingotGauge gauge; LingotCore core; GtkWidget* win; GdkColor gauge_color; GdkColor spectrum_color; LingotConfigDialog* config_dialog; LingotConfig conf; // timer uids guint visualization_timer_uid; guint freq_computation_timer_uid; guint gauge_computation_uid; guint error_dispatcher_uid; }; void lingot_gui_mainframe_create(int argc, char *argv[]); void lingot_gui_mainframe_destroy(LingotMainFrame*); void lingot_gui_mainframe_change_config(LingotMainFrame*, LingotConfig*); #endif //__LINGOT_GUI_MAIN_FRAME_H__ lingot-1.0.1/src/lingot-config-scale.h0000644000175000017500000000551013320113677014516 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef LINGOT_CONFIG_SCALE_H_ #define LINGOT_CONFIG_SCALE_H_ #include "lingot-defs.h" typedef struct { char* name; // name of the scale unsigned short int notes; // number of notes FLT* offset_cents; // offset in cents short int* offset_ratios[2]; // offset in ratios (pairs of integers) FLT base_frequency; // frequency of the first note (tipically C4) char** note_name; // note names // -- internal parameters -- FLT max_offset_rounded; // round version of maximum offset in cents } LingotScale; void lingot_config_scale_new(LingotScale*); void lingot_config_scale_allocate(LingotScale* scale, unsigned short int notes); void lingot_config_scale_destroy(LingotScale* scale); int lingot_config_scale_load_scl(LingotScale* scale, char* filename); /* The scale argument must *not* be initialized with _new. */ int lingot_config_scale_parse_shift(char*, double*, short int*, short int*); void lingot_config_scale_format_shift(char*, double, short int, short int); void lingot_config_scale_copy(LingotScale* dst, const LingotScale* src); /* The dst argument *must* be initialized with _new. */ void lingot_config_scale_restore_default_values(LingotScale* scale); // Gets the note index within the range [0, num notes) int lingot_config_scale_get_note_index(const LingotScale* scale, int index); // Gets an octave number from the note index // Octave 0 starts at index 0 int lingot_config_scale_get_octave(const LingotScale* scale, int index); // Gets the frequency of a given note in the scale. // The final absolute frequency depends on the base_frequency configured for // the scale, which corresponds to note index 0. // Tipically, the base frequency is C4, so in order to get C1 in a 12-note scale, // we need to pass -36 here as note index FLT lingot_config_scale_get_frequency(const LingotScale* scale, int index); int lingot_config_scale_get_closest_note_index(const LingotScale* scale, FLT freq, FLT deviation, FLT* error_cents); #endif /* LINGOT_CONFIG_SCALE_H_ */ lingot-1.0.1/src/lingot-gui-mainframe.glade0000644000175000017500000004167013320113677015541 00000000000000 True False True 6 lingot center True False vertical True False True False _File True True False gtk-open True False Opens an external configuration file. True True accelgroup1 gtk-save-as True False Saves the running configuration to an external file. True True accelgroup1 True False gtk-quit True False True True accelgroup1 True False _Edit True True False gtk-preferences True False True True accelgroup1 True False _View True True False True False Show spectrum True False _Help True True False gtk-about True False True True accelgroup1 False True 0 True False True False True True 0 in 184 115 True False True Shows the error in cents in a visual way. The range will depend on the maximum distance between each two notes in the scale defined in the Lingot settings. Try to provide scales with low maximum distance, i.e. with an anough number of notes, to have a higher resolution in this gauge (12 notes per scale is a good option). True True True False Deviation True 0 0 2 True False True True 0 in True False 12 150 115 True False True True immediate vertical True False True Estimated ground frequency in hertzs. f = --- True True 0 True False True Closest note to the estimated frequency, according to the scale defined in the Lingot settings. Closest note to the estimated frequency, according to the scale defined in the Lingot settings. --- True True 1 True False True Error in cents between the estimated frequency and the closest note according to the scale defined in the Lingot settings. Error in cents between the estimated frequency and the closest note according to the scale defined in the Lingot settings. e = --- True True 2 True False Tone True 2 0 True True 1 True False True True 0 in 300 120 True False True This area shows the signal-to-noise ratio (SNR) of the captured signal. The ground frequency computed is shown with a red vertical line, and the noise threshold with a horizontal dotted yellow line. True True True False Spectrum True True True 2 lingot-1.0.1/src/lingot-audio-alsa.h0000644000175000017500000000251113320113677014201 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef ALSA #ifndef __LINGOT_AUDIO_ALSA_H__ #define __LINGOT_AUDIO_ALSA_H__ #include "lingot-audio.h" void lingot_audio_alsa_new(LingotAudioHandler*, const char* device, int sample_rate); // In case of failure, the audio_system is set to -1. void lingot_audio_alsa_destroy(LingotAudioHandler*); int lingot_audio_alsa_read(LingotAudioHandler*); int lingot_audio_alsa_get_audio_system_properties(LingotAudioSystemProperties*); // Return status : 0 for OK, else -1. #endif #endif lingot-1.0.1/src/lingot.c0000644000175000017500000000603213320113677012161 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include "lingot-defs.h" #include "lingot-config.h" #include "lingot-gui-mainframe.h" #include "lingot-i18n.h" #include "lingot-io-config.h" #include #include #include char CONFIG_FILE_NAME[200]; int main(int argc, char *argv[]) { #ifdef ENABLE_NLS bindtextdomain(GETTEXT_PACKAGE, LINGOT_LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); #endif // default config file. snprintf(CONFIG_FILE_NAME, sizeof(CONFIG_FILE_NAME), "%s/" CONFIG_DIR_NAME DEFAULT_CONFIG_FILE_NAME, getenv("HOME")); // TODO: indicate complete config file path if ((argc > 3) || (argc == 2)) { printf("\nusage: lingot [-c config]\n\n"); return -1; } else if (argc > 1) { int c; while (1) { int option_index = 0; static struct option long_options[] = { { "config", 1, 0, 'c' }, { 0, 0, 0, 0 } }; c = getopt_long(argc, argv, "c:", long_options, &option_index); if (c == -1) break; switch (c) { case 'c': snprintf(CONFIG_FILE_NAME, sizeof(CONFIG_FILE_NAME), "%s/%s%s.conf", getenv("HOME"), CONFIG_DIR_NAME, optarg); printf("using config file %s\n", CONFIG_FILE_NAME); break; case '?': break; default: printf("?? getopt returned character code 0%o ??\n", c); break; } } } lingot_io_config_create_parameter_specs(); // if config file doesn't exists, i will create it. FILE* fp; if ((fp = fopen(CONFIG_FILE_NAME, "r")) == NULL) { char config_dir[200]; snprintf(config_dir, sizeof(config_dir), "%s/.lingot/", getenv("HOME")); printf("creating directory %s ...\n", config_dir); mkdir(config_dir, 0777); // creo el directorio. printf("creating file %s ...\n", CONFIG_FILE_NAME); // new configuration with default values. LingotConfig new_conf; lingot_config_new(&new_conf); lingot_config_restore_default_values(&new_conf); lingot_io_config_save(&new_conf, CONFIG_FILE_NAME); lingot_config_destroy(&new_conf); printf("ok\n"); } else { fclose(fp); } lingot_gui_mainframe_create(argc, argv); return 0; } lingot-1.0.1/src/lingot-audio-pulseaudio.h0000644000175000017500000000266013320113677015440 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2004-2018 Iban Cereijo. * Copyright (C) 2004-2008 Jairo Chapela. * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef PULSEAUDIO #ifndef __LINGOT_AUDIO_PULSEAUDIO_H__ #define __LINGOT_AUDIO_PULSEAUDIO_H__ #include "lingot-audio.h" void lingot_audio_pulseaudio_new(LingotAudioHandler*, const char* device, int sample_rate); // In case of failure, audio_system is set to -1. void lingot_audio_pulseaudio_destroy(LingotAudioHandler*); int lingot_audio_pulseaudio_read(LingotAudioHandler*); int lingot_audio_pulseaudio_get_audio_system_properties(LingotAudioSystemProperties*); // Return status : 0 for OK, else -1. void lingot_audio_pulseaudio_cancel(LingotAudioHandler* audio); #endif #endif lingot-1.0.1/org.nongnu.lingot.appdata.xml0000644000175000017500000000361413320113677015455 00000000000000 org.nongnu.lingot CC0-1.0 GPL-2.0 Lingot Universal tuner

LINGOT is a musical instrument tuner. It's accurate, easy to use, and highly configurable. Originally conceived to tune electric guitars, it can now be used to tune other instruments.

It looks like an analogue tuner, with a gauge indicating the relative shift to a certain note, determined automatically as the closest note to the estimated frequency.

  • It's free software. LINGOT is distributed under the GPL license.
  • It's really quick and accurate, perfect for real-time microtonal tuning.
  • Easy to use. Just plug in your instrument and run it.
  • LINGOT is a universal tuner. It can tune many musical instruments, you only need to provide the temperaments.
  • Highly configurable via GUI. It’s possible to change any parameter while the program is running, without editing any file.
org.nongnu.lingot.desktop The main windows https://www.nongnu.org/lingot/images/lingot-screenshot-896x504.png https://www.nongnu.org/lingot/ ibancg_AT_gmail.com lingot lingot
lingot-1.0.1/COPYING0000644000175000017500000004312213320113677010766 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program 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 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. lingot-1.0.1/test/0000755000175000017500000000000013320113730010756 500000000000000lingot-1.0.1/test/resources/0000755000175000017500000000000013320113730012770 500000000000000lingot-1.0.1/test/resources/lingot-0_9_2b8.conf0000644000175000017500000000123513320113677016126 00000000000000# Config file automatically created by lingot 0.9.2b8 AUDIO_SYSTEM = PulseAudio AUDIO_DEV = /dev/dsp AUDIO_DEV_ALSA = default AUDIO_DEV_JACK = default AUDIO_DEV_PULSEAUDIO = default ROOT_FREQUENCY_ERROR = 0.000 # cents FFT_SIZE = 512 # samples TEMPORAL_WINDOW = 0.300 # seconds MIN_SNR = 20.000 # dB CALCULATION_RATE = 15.000 # Hz VISUALIZATION_RATE = 24.000 # Hz MINIMUM_FREQUENCY = 82.410 # Hz MAXIMUM_FREQUENCY = 329.630 # Hz SCALE = { NAME = Default equal-tempered scale BASE_FREQUENCY = 261.625565 NOTE_COUNT = 12 NOTES = { C 1/1 C# 100.0000 D 200.0000 D# 300.0000 E 400.0000 F 500.0000 F# 600.0000 G 700.0000 G# 800.0000 A 900.0000 A# 1000.0000 B 1100.0000 } } lingot-1.0.1/test/resources/lingot-001.conf0000644000175000017500000000156013320113677015365 00000000000000# Config file automatically created by lingot 0.9.2b4 AUDIO_SYSTEM = PulseAudio AUDIO_DEV = /dev/dsp AUDIO_DEV_ALSA = plughw:0,0 AUDIO_DEV_JACK = default AUDIO_DEV_PULSEAUDIO = alsa_input.pci-0000_00_1b.0.analog-stereo SAMPLE_RATE = 44100 # Hz OVERSAMPLING = 25 ROOT_FREQUENCY_ERROR = 0.000 # cents MIN_FREQUENCY = 15.000 # Hz FFT_SIZE = 512 # samples TEMPORAL_WINDOW = 0.320 # seconds NOISE_THRESHOLD = 20.000 # dB CALCULATION_RATE = 20.000 # Hz VISUALIZATION_RATE = 30.000 # Hz PEAK_NUMBER = 3 # samples PEAK_HALF_WIDTH = 1 # samples PEAK_REJECTION_RELATION = 20.000 # dB DFT_NUMBER = 2 # DFTs DFT_SIZE = 15 # samples GAIN = -21.900 # dB SCALE = { NAME = Default equal-tempered scale BASE_FREQUENCY = 261.625565 NOTE_COUNT = 12 NOTES = { C 1/1 C# 100.0000 D 200.0000 D# 300.0000 E 400.0000 F 500.0000 F# 600.0000 G 700.0000 G# 800.0000 A 900.0000 A# 1000.0000 B 1100.0000 } } lingot-1.0.1/test/Makefile.am0000644000175000017500000000166613320113677012755 00000000000000## Process this file with automake to produce Makefile.in ## Created by Anjuta - will be overwritten ## If you don't want it to overwrite it, ## Please disable it in the Anjuta project configuration TESTS = lingot_test check_PROGRAMS = lingot_test lingot_test_CFLAGS = \ -I${top_srcdir}/src \ -Wall -Wextra \ $(PACKAGE_CFLAGS) $(GTK_CFLAGS) $(ALSA_CFLAGS) $(JACK_CFLAGS) lingot_test_LDFLAGS = lingot_test_LDADD = \ -L/usr/local/include -lcunit \ $(PACKAGE_LIBS) $(GTK_LIBS) $(ALSA_LIBS) $(JACK_LIBS) $(PULSEAUDIO_LIBS) $(GLADE_LIBS) $(LIBFFTW_LIBS) \ -lpthread AUTOMAKE_OPTIONS = subdir-objects lingot_test_SOURCES = \ src/lingot-test.c \ src/lingot-test.h \ src/lingot-test-main.c \ src/lingot-test-config-scale.c \ src/lingot-test-core.c \ src/lingot-test-io-config.c \ src/lingot-test-signal.c check_datadir = check_data_DATA = resources/lingot-001.conf resources/lingot-0_9_2b8.conf EXTRA_DIST = \ $(check_data_DATA) lingot-1.0.1/test/src/0000755000175000017500000000000013320113730011545 500000000000000lingot-1.0.1/test/src/lingot-test.c0000644000175000017500000000224213320113677014114 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "lingot-test.h" static struct timeval tv1; static struct timeval tv2; void tic() { gettimeofday(&tv1, NULL); } double toc() { double result = 0.0; gettimeofday(&tv2, NULL); result = (tv2.tv_sec - tv1.tv_sec) + 1e-6 * (tv2.tv_usec - tv1.tv_usec); printf("Elapsed time: %g s.\n", result); return result; } lingot-1.0.1/test/src/lingot-test-core.c0000644000175000017500000000413013320113677015040 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "lingot-test.h" #include "lingot-audio.h" #include "lingot-audio-alsa.h" #include "lingot-audio-oss.h" #include "lingot-audio-jack.h" #include "lingot-audio-pulseaudio.h" #include "lingot-fft.h" #include "lingot-core.h" void lingot_test_core() { FLT multiplier1 = 0.0; FLT multiplier2 = 0.0; int rel = lingot_core_frequencies_related(100.0, 150.001, 20.0, &multiplier1, &multiplier2); CU_ASSERT_EQUAL(rel, 1); CU_ASSERT_EQUAL(multiplier1, 0.5); rel = lingot_core_frequencies_related(100.0, 200.01, 20.0, &multiplier1, &multiplier2); CU_ASSERT_EQUAL(rel, 1); CU_ASSERT_EQUAL(multiplier1, 1.0); rel = lingot_core_frequencies_related(200.0, 100.01, 20.0, &multiplier1, &multiplier2); CU_ASSERT_EQUAL(rel, 1); CU_ASSERT_EQUAL(multiplier1, 0.5); rel = lingot_core_frequencies_related(100.0, 150.001, 70.0, &multiplier1, &multiplier2); CU_ASSERT_EQUAL(rel, 0); rel = lingot_core_frequencies_related(22.788177, 114.008917, 15.0, &multiplier1, &multiplier2); CU_ASSERT_EQUAL(rel, 1); CU_ASSERT_EQUAL(multiplier1, 1.0); CU_ASSERT_EQUAL(multiplier2, 0.2); rel = lingot_core_frequencies_related(97.959328, 48.977020, 15.0, &multiplier1, &multiplier2); CU_ASSERT_EQUAL(rel, 1); CU_ASSERT_EQUAL(multiplier1, 0.5); CU_ASSERT_EQUAL(multiplier2, 1.0); } lingot-1.0.1/test/src/lingot-test-io-config.c0000644000175000017500000000717013320113677015771 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lingot-test.h" #include "lingot-config-scale.h" #include "lingot-io-config.h" void lingot_test_io_config() { lingot_io_config_create_parameter_specs(); LingotConfig _config; LingotConfig* config = &_config; lingot_config_new(config); CU_ASSERT_PTR_NOT_NULL_FATAL(config); // old file with obsolete options // ------------------------------ int ok; ok = lingot_io_config_load(config, "resources/lingot-001.conf"); if (ok) { // TODO: assert CU_ASSERT_EQUAL(config->audio_system, AUDIO_SYSTEM_PULSEAUDIO); CU_ASSERT(!strcmp(config->audio_dev[config->audio_system], "alsa_input.pci-0000_00_1b.0.analog-stereo")); CU_ASSERT_EQUAL(config->sample_rate, 44100); CU_ASSERT_EQUAL(config->root_frequency_error, 0.0); CU_ASSERT_EQUAL(config->sample_rate, 44100); CU_ASSERT_EQUAL(config->fft_size, 512); CU_ASSERT_EQUAL(config->min_overall_SNR, 20.0); CU_ASSERT_EQUAL(config->calculation_rate, 20.0); CU_ASSERT_EQUAL(config->visualization_rate, 30.0); } else { fprintf(stderr, "warning: cannot find unit test resources\n"); } // recent file // ----------- ok = lingot_io_config_load(config, "resources/lingot-0_9_2b8.conf"); if (ok) { // TODO: assert CU_ASSERT_EQUAL(config->audio_system, AUDIO_SYSTEM_PULSEAUDIO); CU_ASSERT(!strcmp(config->audio_dev[config->audio_system], "default")); CU_ASSERT_EQUAL(config->sample_rate, 44100); CU_ASSERT_EQUAL(config->root_frequency_error, 0.0); CU_ASSERT_EQUAL(config->fft_size, 512); CU_ASSERT_EQUAL(config->sample_rate, 44100); CU_ASSERT_EQUAL(config->temporal_window, 0.3); CU_ASSERT_EQUAL(config->min_overall_SNR, 20.0); CU_ASSERT_EQUAL(config->calculation_rate, 15.0); CU_ASSERT_EQUAL(config->visualization_rate, 24.0); CU_ASSERT_EQUAL(config->min_frequency, 82.41); CU_ASSERT_EQUAL(config->max_frequency, 329.63); CU_ASSERT(!strcmp(config->scale.name, "Default equal-tempered scale")); CU_ASSERT_EQUAL(config->scale.notes, 12); CU_ASSERT_EQUAL(config->scale.base_frequency, 261.625565); CU_ASSERT(!strcmp(config->scale.note_name[1], "C#")); CU_ASSERT(!strcmp(config->scale.note_name[11], "B")); CU_ASSERT_EQUAL(config->scale.offset_ratios[0][0], 1); CU_ASSERT_EQUAL(config->scale.offset_ratios[1][0], 1); // defined as ratio CU_ASSERT_EQUAL(config->scale.offset_cents[0], 0.0); CU_ASSERT_EQUAL(config->scale.offset_ratios[0][1], -1); CU_ASSERT_EQUAL(config->scale.offset_ratios[1][1], -1); // not defined as ratio CU_ASSERT_EQUAL(config->scale.offset_cents[1], 100.0); // defined as shift in cents CU_ASSERT_EQUAL(config->scale.offset_ratios[0][11], -1); CU_ASSERT_EQUAL(config->scale.offset_ratios[1][11], -1); // not defined as ratio CU_ASSERT_EQUAL(config->scale.offset_cents[11], 1100.0); // defined as shift in cents } else { fprintf(stderr, "warning: cannot find unit test resources\n"); } lingot_config_destroy(config); } lingot-1.0.1/test/src/lingot-test-main.c0000644000175000017500000000461413320113677015043 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ void lingot_test_io_config(); void lingot_test_config_scale(); void lingot_test_signal(); void lingot_test_core(); // TODO: lib? #include "lingot-complex.c" #include "lingot-msg.c" #include "lingot-config-scale.c" #include "lingot-config.c" #include "lingot-io-config.c" #include "lingot-audio.c" #include "lingot-audio-alsa.c" #include "lingot-audio-oss.c" #include "lingot-audio-jack.c" #include "lingot-audio-pulseaudio.c" #include "lingot-fft.c" #include "lingot-core.c" #include "lingot-signal.c" #include "lingot-filter.c" #include #include #include int main(void) { CU_pSuite pSuite = NULL; /* initialize the CUnit test registry */ if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); /* add a suite to the registry */ pSuite = CU_add_suite("Lingot_test_suite", NULL, NULL); if (NULL == pSuite) { CU_cleanup_registry(); return CU_get_error(); } /* add the tests to the suite */ /* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */ if ( // (NULL == CU_add_test(pSuite, "lingot_config", lingot_test_io_config)) || // (NULL == CU_add_test(pSuite, "lingot_config_scale", lingot_test_config_scale)) || // (NULL == CU_add_test(pSuite, "lingot_signal", lingot_test_signal)) || // (NULL == CU_add_test(pSuite, "lingot_core", lingot_test_core)) || // 0) { CU_cleanup_registry(); return CU_get_error(); } /* Run all tests using the CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); int num_failures = CU_get_number_of_failures(); CU_cleanup_registry(); return num_failures; } lingot-1.0.1/test/src/lingot-test.h0000644000175000017500000000177113320113677014127 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LINGOT_TEST_H__ #define __LINGOT_TEST_H__ #include #include #include // unit testing functions // time measurement void tic(); double toc(); #endif lingot-1.0.1/test/src/lingot-test-config-scale.c0000644000175000017500000000721613320113677016452 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lingot-test.h" #include "lingot-config-scale.h" #include "lingot-config.h" void lingot_test_config_scale() { LingotConfig _config; LingotConfig* config = &_config; lingot_config_new(config); lingot_config_restore_default_values(config); LingotScale* scale = &config->scale; CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 0), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 1), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 10), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 11), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 12), 1); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 23), 1); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, 24), 2); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -1), -1); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -10), -1); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -11), -1); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -12), -1); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -13), -2); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -23), -2); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -24), -2); CU_ASSERT_EQUAL(lingot_config_scale_get_octave(scale, -25), -3); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 0), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 1), 1); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 10), 10); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 11), 11); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 12), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 23), 11); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, 24), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -1), 11); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -2), 10); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -11), 1); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -12), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -23), 1); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -24), 0); CU_ASSERT_EQUAL(lingot_config_scale_get_note_index(scale, -25), 11); double error_cents; int closest_note_index = 0; closest_note_index = lingot_config_scale_get_closest_note_index(scale, 140.812782, 0.0, &error_cents); CU_ASSERT_EQUAL(closest_note_index, -11); closest_note_index = lingot_config_scale_get_closest_note_index(scale, 130.812782, 0.0, &error_cents); CU_ASSERT_EQUAL(closest_note_index, -12); closest_note_index = lingot_config_scale_get_closest_note_index(scale, 130.81, 0.0, &error_cents); CU_ASSERT_EQUAL(closest_note_index, -12); closest_note_index = lingot_config_scale_get_closest_note_index(scale, 130.82, 0.0, &error_cents); CU_ASSERT_EQUAL(closest_note_index, -12); lingot_config_destroy(config); } lingot-1.0.1/test/src/lingot-test-signal.c0000644000175000017500000000623513320113677015375 00000000000000/* * lingot, a musical instrument tuner. * * Copyright (C) 2013 Iban Cereijo * * This file is part of lingot. * * lingot 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 of the License, or * (at your option) any later version. * * lingot 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 lingot; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include "lingot-test.h" #include "lingot-complex.h" #include "lingot-filter.h" #include "lingot-signal.h" void lingot_test_signal() { int N = 16; int i = 0; int n = 5; FLT* spd = malloc(N * sizeof(FLT)); FLT* noise = malloc(N * sizeof(FLT)); for (i = 0; i < N; i++) { spd[i] = i + 1; noise[i] = -1.0; } lingot_signal_compute_noise_level(spd, N, n, noise); // TODO: enable logic // printf("S = ["); // for (i = 0; i < N; i++) { // printf(" %f ", spd[i]); // } // printf("] \n"); // printf("N = ["); // for (i = 0; i < N; i++) { // printf(" %f ", noise[i]); // } // printf("] \n"); // // puts("done."); // // printf("S = ["); // for (i = 0; i < N; i++) { // printf(" %f ", spd[i]); // } // printf("] \n"); // assert(lingot_signal_quick_select(spd, 1) == 1.0); // assert(lingot_signal_quick_select(spd, 2) == 1.0); // assert(lingot_signal_quick_select(spd, 3) == 2.0); // assert(lingot_signal_quick_select(spd, 4) == 2.0); // assert(lingot_signal_quick_select(spd, 5) == 3.0); // assert(lingot_signal_quick_select(spd, 6) == 3.0); // printf("S = ["); // for (i = 0; i < N; i++) { // printf(" %f ", spd[i]); // } // printf("] \n"); free(spd); free(noise); N = 512; i = 0; n = 30; spd = malloc(N * sizeof(FLT)); noise = malloc(N * sizeof(FLT)); for (i = 0; i < N; i++) { spd[i] = N - i; noise[i] = -1.0; } // printf("S = ["); // for (i = 0; i < N; i++) { // printf(" %f ", spd[i]); // } // printf("] \n"); // double m; // // tic(); // m = lingot_signal_quick_select(spd, 512); // toc(); // // printf("m = %f\n", m); // printf("S = ["); // for (i = 0; i < N; i++) { // printf(" %f ", spd[i]); // } // printf("] \n"); // tic(); // m = lingot_signal_quick_select(spd, 512); // toc(); // printf("m = %f\n", m); // printf("S = ["); // for (i = 0; i < N; i++) { // printf(" %f ", spd[i]); // } // printf("] \n"); // ----------------- for (i = 0; i < N; i++) { spd[i] = N - i; noise[i] = -1.0; } tic(); lingot_signal_compute_noise_level(spd, N, n, noise); toc(); // printf("N = ["); // for (i = 0; i < N; i++) { // printf(" %f ", noise[i]); // } // printf("] \n"); tic(); for (i = 0; i < 10000; i++) { lingot_signal_compute_noise_level(spd, N, n, noise); } toc(); free(spd); free(noise); } lingot-1.0.1/po/0000755000175000017500000000000013320113730010415 500000000000000lingot-1.0.1/po/LINGUAS0000644000175000017500000000004413320113677011372 00000000000000es gl ca de sv cs pt_BR it zh_CN fr lingot-1.0.1/po/de.po0000644000175000017500000004646013320113677011311 00000000000000# German translation of lingot # Copyright (C) 2008 Iban Cereijo # This file is distributed under the same license as the lingot package. # Roland Stigge , 2008. # msgid "" msgstr "" "Project-Id-Version: 0.7.6\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2008-01-12 17:23:00+0100\n" "Last-Translator: Roland Stigge \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "" #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "" #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "" #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "" #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "" #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "" #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "" #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "" #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "" #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "" #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "" #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "" #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "Zeitfenster ist kleiner als FFT-Größe. Es wurde auf %0.3f Sekunden erhöht." #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Genaues und einfach zu bedienendes Stimmgerät für Musikinstrumente" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Roland Stigge , 2008" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "Lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Datei" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Anzeige" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "_Hilfe" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Abweichung" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Note" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Spektrum" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "Lingot-Konfiguration" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Standardeinstellung" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Berechnungstempo" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Darstellungsrate" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Zeitfenster" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "Sekunden" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "Samples" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "FFT-Größe" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" #~ msgid "Sample rate" #~ msgstr "Samplerate" #~ msgid "Noise threshold" #~ msgstr "Rausch-Schwellwert" #~ msgid "Effective sample rate" #~ msgstr "Samplerate" #~ msgid "peaks" #~ msgstr "Peaks" #~ msgid "DFTs" #~ msgstr "DFTs" #~ msgid "Peak rejection relation" #~ msgstr "Verhältnis Aussteuerung Spitze" #~ msgid "Peak half-width" #~ msgstr "Peak-Reihenfolge" #~ msgid "Peak number" #~ msgstr "Peak-Wert" #~ msgid "DFT size" #~ msgstr "DFT-Größe" #~ msgid "DFT number" #~ msgstr "DFT-Zahl" lingot-1.0.1/po/fr.po0000644000175000017500000004662313320113677011331 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2010-11-25 03:41+0100\n" "Last-Translator: Olivier HUMBERT \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "" #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "" #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "" #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "" #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "" #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "" #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "" #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "L'application n'a pas été construite avec le support OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "L'application n'a pas été construite avec le support ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "L'application n'a pas été construite avec le support Jack" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "L'application n'a pas été construite avec le support PulseAudio" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Il manque une connexion avec le serveur audio JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "Ne parvient pas à se connecter au serveur JACK" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "Plus de ports JACK disponibles" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "Ne peut pas activer le client" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "Pas de ports de capture" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "Ne peut pas se connecter aux ports d'entrées" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "" #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "" #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "" #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "" #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "" #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "Le tampon temporel est plus petit que la taille FFT. Il a été augmenté à " "%0.3f secondes" #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Accordeur d'instruments de musique précis et facile à utiliser" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Olivier Humbert , 2010" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Erreur" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Attention" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Fichier" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Edition" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Vue" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "Spectre" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "_H Aide" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Déviation" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Note" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Spectre" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "configuration de lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Défaut" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Système audio" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Périphérique audio" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Capture" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Taux de calcul" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Taux de visualisation" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Ajustements" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Fenêtre temporelle" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "secondes" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "échantillons" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Taille FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" lingot-1.0.1/po/pt_BR.po0000644000175000017500000004670613320113677011732 00000000000000# translation of pt_BR.po to Português do Brasil # Copyright (C) 2008 Carlos Laué # This file is distributed under the same license as the lingot package. # # Carlos Laue , 2008, 2010. msgid "" msgstr "" "Project-Id-Version: pt_BR\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2008-06-24 14:00+0200\n" "Last-Translator: Carlos Laue \n" "Language-Team: Português do Brasil\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Language: pt_BR\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "" #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "" #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "" #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "" #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "" #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "" #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "" #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "A aplicação nao foi compilada com suporte OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "A aplicação nao foi compilada com suporte ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "O programa não foi compilada com o suporte ao Jack" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "A aplicação nao foi compilada com suporte PulseAudio" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Falha de conexão com servidor de áudio JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "Impossível de conetar com o servidor JACK" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "Nenhuma porta JACK disponível" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "Ativação do cliente impossível" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "Porta de captura inexistente" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "Impossível conetar as portas de entrada" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "" #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "" #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "" #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "" #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "" #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "O buffer temporal é menor que o tamanho da FFT escolhido, Fora ampliado para " "%0.3f segundos." #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Afinador de instrumentos musicais preciso e fácil de usar" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Carlos Laué , 2008 - 2010" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Erro" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Atenção" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Arquivo" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Editar" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Ver" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "A_juda" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Diferença" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Nota" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Espectro" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "Configuração do lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Configuração padrão" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Sistema de som" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Dispositivo de som" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Captura" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Freqüência de cálculo" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Freqüência de visualizaçâo" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Ajustes" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Janela temporal" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "segundos" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "amostras" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Tamanho da FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" lingot-1.0.1/po/es.po0000644000175000017500000007021113320113677011317 00000000000000# Spanish translations for Lingot. # Copyright (C) 2004-2013 Iban Cereijo, 2004-2008 Jairo Chapela # This file is distributed under the same license as the lingot package. # Jairo Chapela , 2007. # Iban Cereijo , 2007-2011. # msgid "" msgstr "" "Project-Id-Version: lingot\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2007-08-23 17:46+0200\n" "Last-Translator: Iban Cereijo \n" "Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" "Imposible abrir el dispositivo de audio '%s'.\n" "%s" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "Imposible inicializar estructura de parámetros hardware." #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "Imposible establecer tipo de acceso." #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "Imposible establecer formato de muestra." #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "Imposible establecer tasa de muestreo." #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "Imposible establecer número de canales." #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "Imposible establecer parámetros." #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "Error preparando el interfaz de audio." #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "La lectura del dispositivo ha fallado." #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "Dispositivo predeterminado." #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "La aplicación no ha sido construída con soporte para OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "La aplicación no ha sido construída con soporte para ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "La aplicación no ha sido construída con soporte para Jack" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "La aplicación no ha sido construída con soporte para PulseAudio" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Perdida conexión con el servidor JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "No es posible conectar con el servidor JACK" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "No hay más puertos JACK disponibles" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "Puerto predeterminado" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "No es posible activar el cliente" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "No hay puertos físicos de captura" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "No es posible conectar los puertos de entrada" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "No es posible conectar con el puerto solicitado '%s'" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "Error estableciendo el número de canales." #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "Error estableciendo los bits por muestra." #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "Error estableciendo el tamaño del búfer DMA." #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "Error estableciendo tasa de muestreo." #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "Error creando cliente PulseAudio." #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "Fuente Predeterminada" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "C" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "C#" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "D" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "D#" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "E" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "F" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "F#" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "G" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "G#" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "A" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "A#" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "B" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "Escala cromática temperada" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "formato incorrecto" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "número de notas no coincide" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "Error abriendo archivo de escala." #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "las notas deben estar correctamente ordenadas" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "Error abriendo archivo de escala." #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "El búfer de la ventana temporal es menor que el de FFT, se ha incrementado a " "%0.3f segundos" #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "Diseño del logo" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Afinador de instrumentos preciso y fácil de usar" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Iban Cereijo " #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" "Comprueba que no haya otros procesos bloqueando el dispositivo solicitado. " "Ten en cuenta además que algunos servidores de audio mantienen el " "dispositivo bloqueado durante unos segundos tras su última utilización. En " "ese caso puedes probar dentro de unos instantes." #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "El afinador no está funcionando, debes comprobar la configuración." #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Error" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Aviso" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "Información" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "Abrir archivo de configuración" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "Archivos de configuración de Lingot" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "Guardar archivo de configuración" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "sin titulo.conf" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "El identificador de dispositivo de audio es muy largo" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" "La escala suministrada contiene grandes huecos en frecuencia que incrementan " "el rango de la aguja y provocan una pérdida de precisión visual. Considera " "proveer escalas con al menos 12 tonos, o con una distancia máxima entre " "notas adyacentes no superior a 200 'cents'." #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Archivo" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "Abre un archivo de configuración externo." #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "Guarda la configuración actual en un fichero externo." #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Editar" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Ver" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "Espectro" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "A_yuda" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" "Muestra el error en 'cents' de una manera visual. El rango dependerá de la " "distancia máxima entre pares de notas en la escala definida en la " "configuración de Lingot. Intenta suministrar escalas con baja distancia " "máxima, por ejemplo escalas con muchas notas, para obtener una mejor " "resolución en esta aguja (escalas de 12 notas son una buena elección)." #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Desviación" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "Frecuencia fundamental estimada, en hercios." #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "f = ---" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" "Nota más cercana a la frecuencia estimada, de acuerdo a la escala definida " "en la configuración." #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "---" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" "Error en 'cents' entre la frecuencia estimada y la nota más cercana según la " "configuración del afinador." #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "e = ---" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Tono" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" "Este área muestra la densidad espectral de potencia de la señal capturada. " "La frecuencia fundamental se muestra con una línea vertical roja, y el " "umbral de ruido mediante una línea amarilla horizontal y discontinua." #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Espectro" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "No puedes insertar una nota encima de la nota de referencia." #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "No uses caracteres vacíos para los nombres de las notas." #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "El nombre contiene caracteres inválidos." #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" "No puede cambiar el desplazamiento en frecuencia de primera nota, debe estar " "fijado a 1/1." #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" "El desplazamiento en frecuencia debe estar entre 0 y 1200 'cents', o entre " "1/1 y 2/1." #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "mid-A" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "mid-C" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "Nombre" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "Desplazamiento" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "Frecuencia [Hz]" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "Hay notas con el mismo nombre" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" "Hay valores inválidos en la escala: las notas deberían estar ordenadas por " "frecuencia / desplazamiento" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" "Hay valores inválidos en la escala: todas las notas deben estar en la misma " "octava" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "Hay notas sin nombre" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "Abrir archivo de escala" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "Ficheros de Scala" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" "Identificador de la nota. Texto libre que será mostrado en la ventana " "principal cuando el afinador esté cerca de la nota dada. No uses caracteres " "en blanco aquí." #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" "Desplazamiento en frecuencia. Puedes definirlo como una desviación en " "'cents' con respecto a la nota de referencia (la primera), o como un " "múltiplo de su frecuencia, tal como '3/2' o '5/4'. Todos los valores deben " "estar entre 0 y 1200 'cents', o entre 1/1 y 2/1 (es decir, todas las notas " "deben estar en la misma octava), y deben estar todos ellos bien ordenados." #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" "Frecuencia. Puedes definir aquí la frecuencia absoluta de una nota concreta " "como referencia, y el resto de frecuencias se establecerán en base a este " "valor y el desplazamiento en frecuencia de cada nota (definido en la columna " "'Desplazamiento'). Puedes usar tanto un valor numérico, o las palabras clave " "'mid-C' (261.625565 Hz) y 'mid-A' (440 Hz), normalmente reservadas para la " "cuarta octava (intenta asignar solamente frecuencias a la cuarta octava)." #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "configuración de Lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Predet." #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "Restaura la configuración predeterminada, sin aplicarla." #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" "Aplica los cambios actuales al afinador en ejecución, pero no modifica el " "fichero de configuración.\n" "\n" "Los cambios aplicados pueden ser revertidos pulsando Cancelar." #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "Aplica los cambios actuales y modifica el fichero de configuración." #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" "Anula los cambios aplicados previamente y cierra el diálogo de configuración." #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Sistema audio" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Dispositivo audio" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "Aquí puedes escoger el sistema de sonido" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" "Escoge el dispositivo de entrada si dispones de más de uno. Si estás usando " "JACK, puedes también conectar Lingot al origen de audio deseado mediante una " "aplicación de control de JACK externa." #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "Selecciona la fuente de audio" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" "Configuración de entrada de sonido. Define aquí la fuente de audio y la " "configuración relativa al hardware." #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Captura" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Tasa de cálculo" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Tasa de visualización" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "Mínima SNR" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "Ajusta las siguientes tasas de refresco" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "Ajusta el nivel de ruido" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" "Mínima relación señal a ruido para considerar la señal capturada como algo " "relevante. Intenta mantener un valor bajo para este parámetro, y elévalo si " "experimentas problemas en entornos muy ruidosos. Este nivel se muestra en la " "vista del espectro como una línea amarilla discontinua." #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" "Número de visualizaciones por segundo de la (última) frecuencia calculada, " "error y espectro." #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "Número de cálculos por segundo de la frecuencia fundamental." #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "Ajustes rápicos sobre la respuesta dinámica y los niveles de señal." #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Ajustes" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Ventana temporal" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" "Ésta es la porción más reciente de señal considerada en la afinación. Cuanto " "más largo sea, más precisión podemos obtener, pero a la vez la respuesta " "dinámica es más lenta, ya que estamos considerando partes más viejas de la " "señal. Además, si subes este parámetro, el coste computacional aumenta. Este " "valor, en muestras (que depende de la tasa efectiva de muestreo), debe ser " "mayor o igual que el tamaño de la FFT." #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "segundos" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "muestras" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Tamaño de FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "El búfer de FFT permite a Lingot echar un primer vistazo al espectro de la " "señal. Valores más altos ayudan a tener un mejor 'enganche' con el pico " "correcto, pero suponen además un mayor coste computacional. No uses valores " "muy elevados a no ser que tengas una tasa efectiva de muestreo igualmente " "elevada." #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "El búfer de FFT permite a Lingot echar un primer vistazo al espectro de la " "señal. Valores más altos ayudan a tener un mejor 'enganche' con el pico " "correcto, pero suponen además un mayor coste computacional. No uses valores " "muy elevados a no ser que tengas una tasa efectiva de muestreo igualmente " "elevada." #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "Optimizar parámetros automáticamente" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" "Deja esta opción activada y Lingot optimizará algunos parámetros por ti." #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "Mínimo tono" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "Máximo tono" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" "Esta es la frecuencia más baja que querrás afinar en este instrumento. Pon " "aquí una frecuencia o selecciona una nota del menú desplegable." #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "Rango de frecuencia del instrumento" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" "Configuración básica del algoritmo de cálculo de la frecuencia fundamental. " "Acude aquí para obtener una mejor precisión, rango de frecuencia o uso del " "procesador." #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "Preferencias" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "Nombre de la escala, sólo para su información." #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "cents" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" "Aplica un desplazamiento en frecuencia a todas las notas definidas en la " "tabla de abajo." #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "Octava" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" "Octava cuyas frecuencias se muestran en la tabla de abajo. Cambia este " "parámetro si quieres mostrar las frecuencias correspondientes a otras " "octavas, pero trata de asignar siempre frecuencias dentro de la 4ª octava " "(la 4ª octava comprende normalmente frecuencias desde 261.63 Hz a 523.25 Hz)." #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "Insertar" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" "Añade una nota a la lista, justo encima de la fila seleccionada, o la añade " "al final si no hay ninguna fila seleccionada. No es posible añadir una nota " "antes de la nota de referencia (la primera). Se pueden usar también las " "teclas Insertar y Suprimir sobre la tabla de al lado." #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "Eliminar" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" "Elimina las notas seleccionadas. La nota de referencia (la primera), no " "puede ser eliminada. Puedes utilizar también la tecla Suprimir sobre la " "tabla de al lado." #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "Importar" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" "Importa la escala desde un archivo externo .scl, con el formato utilizado en " "el proyecto Scala (http://www.huygens-fokker.org/scala/)" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" "Lingot es un afinador universal, puede afinar cualquier instrumento de " "acuerdo a la escala que definas aquí." #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "Escala" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" "Error leyendo el archivo de configuración, línea %i: sistema de audio no " "reconocido, asumiendo valor por defecto.\n" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" "El archivo de configuración tiene errores, y por tanto algunos parámetros " "tendrán valores por defecto. El problema será solucionado una vez confirmes " "las preferencias en el diálogo de configuración." lingot-1.0.1/po/ca.po0000644000175000017500000004650613320113677011305 00000000000000# Catalan translation for Lingot 0.7.4 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the lingot package. # Raül Cambeiro , 2007. # msgid "" msgstr "" "Project-Id-Version: lingot\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2007-10-02 19:00+0200\n" "Last-Translator: Raül Cambeiro \n" "Language-Team: Catalan \n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "" #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "" #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "" #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "" #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "" #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "" #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "" #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "" #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "" #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "" #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "" #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "" #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "La memòria intermèdia temporal és menor que la mida de l'FFT. S'ha augmentat " "a %0.3f segons." #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Afinador d'instruments musicals precís i fàcil de fer anar" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Raúl Cambeiro , 2007" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "Lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Fitxer" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Edita" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Visualitza" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "A_juda" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Desviació" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Nota" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Espectre" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "Configuració del Lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Configuració per defecte" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Taxa de càlcul" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Taxa de visualització" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Finestra temporal" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "segons" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "mostres" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Mida de l'FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" #~ msgid "Sample rate" #~ msgstr "Taxa de mostreig" #~ msgid "Noise threshold" #~ msgstr "Llindar de soroll" #~ msgid "peaks" #~ msgstr "pics" #~ msgid "DFTs" #~ msgstr "DFT" #~ msgid "Peak rejection relation" #~ msgstr "Relació de rebuig entre pics" #~ msgid "Peak half-width" #~ msgstr "Ordre de pic" #~ msgid "Peak number" #~ msgstr "Nombre de pics" #~ msgid "DFT size" #~ msgstr "Mida de la DFT" #~ msgid "DFT number" #~ msgstr "Nombre de DFT" lingot-1.0.1/po/cs.po0000644000175000017500000006242613320113677011326 00000000000000# translation of cs.po to Czech # Copyright (C) 2008 Karel Volný # This file is distributed under the same license as the lingot package. # # Karel Volný , 2008, 2009, 2013. msgid "" msgstr "" "Project-Id-Version: cs\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2013-02-01 17:29+0100\n" "Last-Translator: Karel Volný \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.5\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" "Nelze otevřít zvukové zařízení '%s'.\n" "%s" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "Nelze inicializovat strukturu nastavení hardware." #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "Nelze nastavit typ přístupu." #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "Nelze nastavit formát vzorků." #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "Nelze nastavit vzorkovací kmitočet." #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "Nelze nastavit počet kanálů." #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "Nelze nastavit parametry." #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "Nelze připravit zvukové rozhraní." #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "Čtení ze zvukového rozhraní selhalo." #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "Výchozí zařízení" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "Aplikace nebyla sestavena s podporou pro OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "Aplikace nebyla sestavena s podporou pro ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "Aplikace nebyla sestavena s podporou pro JACK" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "Aplikace nebyla sestavena s podporou pro PulseAudio" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Chybí spojení se zvukovým serverem JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "Nelze se připojit k serveru JACK" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "Nejsou dostupné žádné další porty systému JACK" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "Výchozí port" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "Nelze aktivovat klienta" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "Žádné aktivní vstupní porty" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "Nelze připojit vstupní porty" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "Nelze se připojit na požadovaný port %s" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "Chyba při nastavování počtu kanálů." #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "Chyba při nastavování počtu bitů na vzorek." #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "Chyba při nastavování vyrovnávací paměti DMA." #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "Chyba při nastavování vzorkovacího kmitočtu." #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "Chyba při vytváření klienta PulseAudio." #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "Výchozí zdroj" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "nesprávný formát" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "počet tónů nesouhlasí" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "Chyba při otevírání souboru se stupnicí." #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "tóny musí být uspořádány vzestupně" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "Chyba při otevírání souboru se stupnicí" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "Interval pro analýzu je menší než je třeba pro FFT, a proto byl zvýšen na " "%0.3f s." #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "design loga" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Přesná a snadno použitelná ladička hudebních nástrojů" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Karel Volný , 2008—2013" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" "Prosím zkontrolujte, že neběží jiné procesy, které zamykají požadované " "zařízení. Také mějte na paměti, že některé zvukové servery mohou blokovat " "prostředky i několik sekund poté, co byly naposledy použity. V tom případě " "to zkuste znovu." #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "Jádro neběží, zkontrolujte konfiguraci." #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Chyba" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Upozornění" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "Informace" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "Načíst soubor s konfigurací" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "Konfigurační soubory Lingot" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "Uložit konfigurační soubor" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "Identifikátor zvukového zařízení je příliš dlouhý" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" "Definovaná stupnice má velké intervaly mezi tóny, které budou mít za " "následek zvětšení rozsahu měřidla a tudíž ztrátu přesnosti vizualizace. " "Zvažte použití stupnice s nejméně 12 tóny, anebo s největším intervalem mezi " "sousedními tóny nanejvýše 200 centů." #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Soubor" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "Načte konfigurační soubor." #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "Uloží aktuální konfiguraci do zadaného souboru." #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "Úp_ravy" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Zobrazení" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "Zobrazit spektrum" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "_Nápověda" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" "Vizualizace odchylky v centech. Rozsah závisí na nejvyšším intervalu mezi " "dvěma tóny stupnice definovaném v nastavení Lingotu (definujte stupnice s " "malými intervaly mezi každými dvěma sousedními tóny, čili s mnoha tóny, " "abyste dosáhli vyššího rozlišení tohoto měřidla)." #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Odchylka" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "Zjištěný základní kmitočet v Hertzích." #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "f = ---" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" "Nejbližší tón ke zjištěnému kmitočtu, podle stupnice definované v nastavení " "Lingotu." #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "---" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" "Rozdíl v centech mezi zjištěným kmitočtem a nejbližším odpovídajícím tónem " "podle stupnice definované v nastavené Lingotu." #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "Δ = ---" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Tón" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Spektrum" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "Nelze vkládat před základní tón." #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "Nepoužívejte mezery v názvech tónů." #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "Název obsahuje nedovolené znaky." #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "Nelze změnit posun základního tónu, musí být 1/1." #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "Interval musí být mezi 0 a 1200 centy anebo 1/1 a 2/1." #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "Název" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "Interval" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "Kmitočet [Hz]" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "Jsou definovány tóny se stejným názvem" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" "Ve stupnici jsou definovány neplatné hodnoty: tóny musí být seřazeny dle " "kmitočtu / intervalu" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" "Ve stupnici jsou neplatné hodnoty: všechny tóny musí být ve stejné oktávě" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "Jsou definovány tóny bez názvu" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "Otevřít soubor se stupnicí" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "Soubory Scala" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" "Název tónu, text který bude zobrazen v hlavním okně pokud se ladění přiblíží " "tomuto tónu. Nevkládejte do názvu mezery." #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" "Interval. Můžete jej zadat jako posun v centech od referenčního tónu (první " "tón stupnice) anebo coby poměr frekvencí jako např. ‚3/2‘ nebo ‚5/4‘. " "Všechny hodnoty musí být mezi 0 a 1200 centy, resp. 1/1 a 2/1 (to znamená ve " "stejné oktávě) a musí být uspořádány vzestupně." #: ../src/lingot-gui-config-dialog-scale.c:641 #, fuzzy, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" "Kmitočet. Zde lze zadat absolutní hodnotu kmitočtu příslušného tónu jako " "referenční, a všechny ostatní kmitočty budou přepočteny podle nastavených " "intervalů. Lze zadat buď číselnou hodnotu anebo klíčová slova ‚mid-" "C‘ (261,625565 Hz) a ‚mid-A‘ (440 Hz)." #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "Nastavení lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Výchozí nastavení" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "Obnoví výchozí hodnoty, bez toho aby bylo nastavení použito." #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 #, fuzzy msgid "Applies the current changes and modifies the congifuration file." msgstr "Vrátí změny a zavře konfigurační dialog." #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "Vrátí změny a zavře konfigurační dialog." #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Ovladač" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Zvukové zařízení" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "Zde můžete vybrat zvukový ovladač." #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" "Vyberte zvukové zařízení, pokud máte více než jedno. Jestliže používáte " "JACK, můžete také Lingot připojit k požadovanému zařízení pomocí některé z " "aplikací pro ovládání JACKu." #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Vstup" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Frekvence výpočtů" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Obnovovací frekvence" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" "Počet zobrazení poslední vypočteného kmitočtu, chyby a spektra za sekundu." #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "Počet výpočtů základního kmitočtu za sekundu." #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Nastavení" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Interval pro analýzu" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" "Toto je poslední časový úsek braný v potaz pro ladění. Čím je delší, tím " "vyšší přesnosti lze dosáhnout, ale zároveň se prodlouží odezva, neboť bude " "uvažován starší signál. Zvýšením této hodnoty také vzrůstá výpočetní " "náročnost. Tato hodnota musí být stejná nebo větší než odpovídá vyrovnávací " "paměti FFT." #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "s" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "vzorků" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Rozsah FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "Vyrovnávací paměť pro FFT umožňuje analyzovat spektrum. Vyšší hodnoty mohou " "napomoci najít správnou špičku, ale zároveň jsou mnohem výpočetně " "náročnější. Nenastavujte vyšší hodnoty pokud nemáte zároveň odpovídajícně " "vysokou efektivní vzorkovací frekvenci." #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "Vyrovnávací paměť pro FFT umožňuje analyzovat spektrum. Vyšší hodnoty mohou " "napomoci najít správnou špičku, ale zároveň jsou mnohem výpočetně " "náročnější. Nenastavujte vyšší hodnoty pokud nemáte zároveň odpovídajícně " "vysokou efektivní vzorkovací frekvenci." #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" "Základní nastavení algoritmu pro zjištění kmitočtu. Zde nastavte větší " "přesnost, rozsah kmitočtů nebo výpočetní náročnost." #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "Název stupnice, jen pro informaci." #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "centů" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "Posune kmitočet všech tónů definovaných v tabulce výše." #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "Vložit" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" "Přidá nový tón do stupnice nad vybraný řádek, anebo na konec, není-li nic " "vybráno. Není možno přidat tón nad referenční (první) tón. Při úpravách " "tabulky lze také použít klávesu Insert." #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "Smazat" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" "Smaže vybrané tóny. Referenční (první) tón nelze odstranit. Při úpravách " "tabulky lze také použít klávesu Delete." #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "Importovat" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" "Načte stupnici ze souboru s koncovkou .scl ve formátu projektu Scala (http://" "www.huygens-fokker.org/scala/)." #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" "Lingot je univerzální ladička, může ladit jakýkoli nástroj podle stupnice " "nadefinované zde." #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "Stupnice" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" lingot-1.0.1/po/zh_CN.po0000644000175000017500000004755113320113677011724 00000000000000# Chinese/China translation of lingot. # Copyright (C) 2009 THE lingot'S COPYRIGHT HOLDER # This file is distributed under the same license as the lingot package. # Jairo Chapela , 2007. # Careone , 2009. # # msgid "" msgstr "" "Project-Id-Version: lingot 0.7.7b5\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2009-09-14 17:29+0800\n" "Last-Translator: Careone \n" "Language-Team: Chinese/Simplified \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "" #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "" #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "" #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "" #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "" #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "" #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "" #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "这个程序无法支持插孔" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "与插孔音频服务失去连接" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "无法连接到插孔服务" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "没有更多的插孔端口可以使用" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "无法激活客户端" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "无法连接输入端口" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "" #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "" #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "" #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "" #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "" #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "临时缓冲区小于“快速傅里叶变换(FFT)”的大小。提高到 %0.3f 秒" #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "精确和方便的乐器调音师" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Careone , 2009" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "错误" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "警告" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "文件(_F)" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "编辑(_E)" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "查看(_V)" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "帮助(_H)" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "偏差" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "音调" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "乐谱" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "lingot 配置" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "默认值" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "音频系统" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "音频设备" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "捕获" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "运算率" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "赫兹(Hz)" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "可见率" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "分贝(dB)" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "校正" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "临时窗口" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "秒" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "采样" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "快速傅里叶变换(FFT) 大小" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" #~ msgid "Sample rate" #~ msgstr "采样率" #~ msgid "Noise threshold" #~ msgstr "噪波极限值" #~ msgid "Gain" #~ msgstr "增益" #~ msgid "Effective sample rate" #~ msgstr "有效采样率" #~ msgid "Basic" #~ msgstr "基本" #~ msgid "peaks" #~ msgstr "峰值" #~ msgid "DFTs" #~ msgstr "二维傅里叶变换(DFT)" #~ msgid "Peak rejection relation" #~ msgstr "峰值抑制关系" #~ msgid "Peak half-width" #~ msgstr "半波峰值" #~ msgid "Peak number" #~ msgstr "高音数字" #~ msgid "DFT size" #~ msgstr "二维傅里叶变换(DFT) 大小" #~ msgid "DFT number" #~ msgstr "二维傅里叶变换(DFT) 数字" #~ msgid "Advanced" #~ msgstr "高级" #~ msgid "No physical capture ports" #~ msgstr "没有物理捕获端口" lingot-1.0.1/po/it.po0000644000175000017500000006375013320113677011336 00000000000000# translation of it.po to # translation of es.po to # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Jairo Chapela , 2007, 2011. # Stefano Cereda , 2011. msgid "" msgstr "" "Project-Id-Version: it\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2011-12-09 12:27+0100\n" "Last-Translator: Stefano Cereda \n" "Language-Team: Italian \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.2\n" "X-Language: it_IT\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" "Impossibile aprire la periferica '%s'.\n" "%s" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "Impossibile inizializzare la struttura dei parametri hardware." #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "Impossibile creare il tipo di accesso." #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "Impossibile impostare il formato dei campioni." #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "Impossibile impostare la frequenza di campionamento." #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "Impossibile impostare il numero di canali." #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "Impossibile impostare i parametri" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "Impossibile preparare la periferica audio per l'uso." #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "Lettura dal dispositivo audio fallita." #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "Periferica predefinita" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "L'applicazione è stata compilata senza il supporto a OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "L'applicazione è stata compilata senza il supporto a ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "L'applicazione è stata compilata senza il supporto a JACK" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "L'applicazione è stata compilata senza il supporto a PULSEAUDIO" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Manca la connessione al server audio JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "Impossibile connettersi al server JACK" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "Nessuna porta di JACK disponibile" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "Porta predefinita" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "Impossibile attivare il client" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "Nessuna porta di fisica di cattura" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "Impossibile connettere le porte d'ingresso" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "Impossibile connettersi alla porta richiesta '%s'" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "Errore nell'impostare il numero di canali." #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "Errore nell'impostazione dei bit per campione." #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "Errore nell'impostare la grandezza del buffer DMA." #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "Errore nell'impostare la frequenza di campionamento." #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "Errore nel creare un client di Pulseaudio" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "Sorgente predefinita" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "formato non valido" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "errore nel numero di note" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "Errore nell'apertura del file di scala." #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "le note devono essere ordinate correttamente" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "Errore nell'apertura del file di scala" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "Il buffer temporale è più piccolo dell'FFT. È stato aumentato a %0.3f secondi" #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "Disegno del logo" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Accordatore di strumenti affidabile e semplice da usare" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Stefano Cereda , 2008-2011" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" "Controlla che la periferica richiesta non sia utilizzata da altri processi. " "Inoltre considera che alcuni server audio a volte controllano le risorse " "fino a qualche secondo dopo l'ultimo utilizzo. In questo caso, puoi " "riprovare." #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" "Il programma principale non funziona, devi controllare la tua configurazione." #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Errore" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Attenzione" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "Info" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "Apri un file di configurazione" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "File di configurazione di lingot" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "Salva file di configurazione" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "Identificatore della risorsa audio troppo lungo" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" "La scala contiene grossi salti nelle frequenze che aumentano l'imprecisione " "e producono una bassa accuratezza nella riproduzione visiva. Considera " "l'utilizzo di scale con almeno 12 toni, o con una distanza massima fra le " "note adiacenti di 200 centesimi." #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_File" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "Apri un file di configurazione esterno." #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "Salva le impostazioni correnti in un file esterno." #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Modifica" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Visualizza" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "Mostra lo spettro" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "_Aiuto" #: ../src/lingot-gui-mainframe.glade.h:9 #, fuzzy msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" "Mostra l'errore percentuale in modo grafico. L'intervallo dipende dalla " "massima distanza fra due note nella scala definita nelle impostazioni di " "Lingot (prova ad impostare una scala con una bassa distanza massima, ad " "esempio utilizzando molte note, per ottenere un'elevata risoluzione)." #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Deviazione" #: ../src/lingot-gui-mainframe.glade.h:11 #, fuzzy msgid "Estimated ground frequency in hertzs." msgstr "Frequenza fondamentale stimata in hertz." #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "f = ---" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" "Nota più vicina alla frequenza stimata, in base alla scala definita nelle " "impostazioni." #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "---" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" "Errore in centesimi tra la frequenza stimata e la nota più vicina ricavata " "dalla scala definita nelle impostazioni." #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "e = ---" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Nota" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Spettro" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "Non puoi inserire prima della nota di riferimento" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "Non usare il carattere spazio per i nomi delle note." #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "Il nome contiene caratteri non validi." #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "Non puoi cambiare il primo spostamento, deve essere 1/1." #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "Lo spostaento deve essere fra 0 e 1200 centesimi, o fra 1/1 e 2/1." #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "Nome" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "Spostamento" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "Frequenza [Hz]" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "Ci sono note con lo stesso nome" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" "Ci sono valori errati nella scala: le note dovrebbero essere ordinate " "secondo la frequenza/spostamento" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" "Ci sono valori errati nella scala: tutte le note dovrebbero essere nella " "stessa ottava." #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "Ci sono note senza nome" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "Apri file di scala" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "File di scala" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" "Identificatore della nota, testo libero che verrà mostrato nella finestra " "principale quando accordi vicino alla nota. Non usare il carattere spazio " "qui." #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" "Spostamento. Lo puoi definire come una differenza in centesimi dalla nota di " "rifermiento (la prima), o come un rapporto di frequenze, come '3/2' o '5/4'. " "Tutti i valori devono essere fra 0 e 1200 centesimi, o fra 1/1 e 2/1 " "(poichè tutte le note devono appartenere alla stessa ottava), e devono " "essere ordinate correttamente." #: ../src/lingot-gui-config-dialog-scale.c:641 #, fuzzy, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" "Frequenza. Qui puoi inserire la frequenza assoluta per una data nota come " "riferimento, e tutte le altre frequenze si sposteranno in base allo " "spostamento definito nella colonna 'Spostamento'. Puoi usare sia un valore " "numerico assoluto sia le parole chiave 'mid-c' (261.625565 Hz) e 'mid-" "a' (440 Hz)." #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "configura lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Default" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "Torna ai settaggi di default, senza applicarli." #: ../src/lingot-gui-config-dialog.glade.h:4 #, fuzzy msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "Applica i cambiamenti, ma non modifica il file di configurazione." #: ../src/lingot-gui-config-dialog.glade.h:7 #, fuzzy msgid "Applies the current changes and modifies the congifuration file." msgstr "Applica i cambiamenti e modifica il file di configurazione." #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" "Torna alle impostazioni applicate precedentemente e chiudi la finestra di " "configurazione." #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Sistema audio" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Periferica audio" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "Qui puoi scegliere il sistema audio." #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" "Scegli la periferica audio se ne hai più di una. Se usi JACK, puoi " "connettere Lingot all'ingresso desiderato utilizzando un programma esterno " "di controllo di JACK." #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 #, fuzzy msgid "Audio input settings. Select here the audio source." msgstr "Impostazioni audio ingresso. Scegli l'ingresso e imposta l'hardware." #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Cattura" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Velocità di calcolo" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Soglia di visualizzazione" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" "Numero di visualizzazioni al secondo dell'ultima frequenza calcolata, errore " "e spettro." #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "Numero di calcoli al secondo della frequenza fondamentale." #: ../src/lingot-gui-config-dialog.glade.h:26 #, fuzzy msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "Correzioni veloci della risposta dinamica e dei livelli di segnale." #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Regolazioni" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Finestra temporale" #: ../src/lingot-gui-config-dialog.glade.h:29 #, fuzzy msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" "Questa è la quantità di dati più recenti considerati per l'accordatura. Più " "è lunga, più sarà accurata, ma la risposta dinamica diventerà lenta, poichè " "si considerano parti vecchie del segnale. Inoltre se aumenti il parametro " "aumenta il costo computazionale. Questo valore, in campioni (dipendente " "dalla frequenza di campionamento), deve essere maggiore o uguale alla " "grandezza del buffer FFT." #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "secondi" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "campioni" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Grandezza FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "Il buffer FFT da a Lingot una prima vista sullo spettro. Valori maggiori " "possono aiutare Lingot a trovare il picco corretto, ma comportano calcoli " "più pesanti. Non utilizzare valori elevati qui a meno che tu abbia una " "frequenza di campionamento effettiva altrettanto elevata." #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "Il buffer FFT da a Lingot una prima vista sullo spettro. Valori maggiori " "possono aiutare Lingot a trovare il picco corretto, ma comportano calcoli " "più pesanti. Non utilizzare valori elevati qui a meno che tu abbia una " "frequenza di campionamento effettiva altrettanto elevata." #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" "Impostazioni base dell'algoritmo di ricerca della frequenza. Vieni qui per " "ottenere una migliore precisione, range di frequenza o uso della CPU." #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "Nome della scala, solo per tua informazione." #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "centesimi" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" "Applica uno spostamento di frequenza a tutte le note definite nella tabella." #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "Inserisci" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" "Aggiungi una nuova nota alla lista, subito dopo la linea selezionata, o " "aggiungila alla fine se nessuna linea è selezionata. Non è possibile " "aggiungere una nota all'inizio. Puoi anche usare il tasto Insert nella " "tabella sottostante." #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "Cancella " #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" "Cancella le note selezionate. La nota di rifermiento (ad esempio la prima) " "non può essere rimossa. Puoi anche usare il tasto Canc sulla tabella " "sottostante." #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "Importa" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" "Importa la scala da un file .scl esterno, con il formato Scala project " "(http://www.huygens-fokker.org/scala/)" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" "Lingot è un accordatore universale, può accordare qualsiasi strumento sulla " "base della scala che definisci qui." #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "Scala" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" #~ msgid "Cannot set buffer size." #~ msgstr "Errore nell'impostare la grandezza del buffer." lingot-1.0.1/po/POTFILES.in0000644000175000017500000000130713320113677012125 00000000000000# List of source files containing translatable strings. ## Created by Anjuta - will be overwritten ## If you don't want it to overwrite it, ## Please disable it in the Anjuta project configuration # Source files src/lingot-audio-alsa.c src/lingot-audio.c src/lingot-audio-jack.c src/lingot-audio-oss.c src/lingot-audio-pulseaudio.c src/lingot.c src/lingot-complex.c src/lingot-config.c src/lingot-config-scale.c src/lingot-core.c src/lingot-fft.c src/lingot-filter.c src/lingot-gauge.c src/lingot-gui-mainframe.c src/lingot-gui-config-dialog.c src/lingot-gui-mainframe.glade src/lingot-gui-config-dialog-scale.c src/lingot-gui-config-dialog.glade src/lingot-io-config.c src/lingot-msg.c src/lingot-signal.c lingot-1.0.1/po/gl.po0000644000175000017500000006731713320113677011327 00000000000000# Galician translations for Lingot. # Copyright (C) 2004-2013 Iban Cereijo, 2004-2008 Jairo Chapela # This file is distributed under the same license as the lingot package. # Iban Cereijo , 2007-2011. # msgid "" msgstr "" "Project-Id-Version: lingot\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2007-08-23 17:46+0200\n" "Last-Translator: Iban Cereijo \n" "Language-Team: Galician \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" "Imposible abrir o dispositivo de audio '%s'.\n" "%s" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "Imposible establecer estructura de parámetros hardware." #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "Imposible establecer tipo de acceso." #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "Imposible establecer formato de mostra." #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "Imposible establecer tasa de mostreo." #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "Imposible establecer número de canles." #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "Imposible establecer parámetros." #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "Imposible preparar a interfaz de audio." #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "A lectura do dispositivo fallou." #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "Dispositivo predeterminado" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "A aplicación non foi construída con soporte para OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "A aplicación non foi construída con soporte para ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "A aplicación non foi construída con soporte para Jack" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "A aplicación non foi construída con soporte para PulseAudio" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Perdida a conexión có servidor JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "Non é posible conectar có servidor JACK" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "No hai máis portos JACK disponibles" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "Porto predeterminado." #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "No é posible activar o cliente" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "Non hai portos físicos de captura" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "Non é posible conectar os portos de entrada" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "Non é posible conectar có porto solicitado '%s'" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "Erro establecendo o número de canles." #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "Erro establecendo os bits por mostra." #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "Erro establecendo o tamaño do búfer DMA." #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "Erro establecendo a tasa de mostreo." #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "Erro creando cliente PulseAudio." #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "Fonte Predeterminada" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "C" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "C#" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "D" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "D#" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "E" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "F" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "F" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "G" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "G#" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "A" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "A#" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "B" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "Escala cromática temperada" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "formato incorrecto" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "número de notas non coincidinte" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "Erro establecendo tasa de mostreo." #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "as notas deben estar ben ordenadas" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "Erro abrindo ficheiro de escala" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "O búfer da ventá temporal é menor que o de FFT, foi incrementado a %0.3f " "segundos" #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "Deseño do logo" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Afinador de instrumentos preciso e fácil de usar" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "Iban Cereijo " #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" "Comproba que non haxa outros procesos bloqueando o dispositivo. Ten en conta " "tamén que algúns servidores de audio poden bloquear os recursos por uns " "segundos tras a última vez que foron utilizados. Nese caso inténtao de novo " "nuns intres." #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "O afinador non está funcionando, debes comprobar a configuración." #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Erro" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Aviso" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "Información" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "Abrir arquivo de configuración" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "Arquivos de configuración de Lingot" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "Gardar arquivo de configuración" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "sen titulo.conf" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "Identificador de dispositivo de audio moi longo" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" "A escala suministrada contén grandes espazos en frecuencia que incrementan o " "rango da agulla e provocan unha perda de precisión visual. Considere " "proporcionar escalas con 12 tonos cando menos, ou con unha distancia máxima " "entre notas adxacentes non superior a 200 'cents'." #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Arquivo" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "Abre un arquivo de configuración externo." #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "Garda a configuración actual nun ficheiro externo." #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Editar" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Ver" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "Espectro" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "A_xuda" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" "Amosa o erro en 'cents' dunha maneira visual. O rango dependerá da distancia " "máxima entre pares de notas da escala definida na configuración de Lingot. " "Tntente proporcionar escalas con baixa distancia máxima, por exemplo escalas " "con moitas notas, para obtener unha mellor resolución na agulla (escalas de " "12 notas son unha opción razoable)." #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Desviación" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "Frecuencia fundamental estimada, en hercios." #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "f = ---" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" "Nota máis cercana á frecuencia estimada, de acordo á escala definida na " "configuración." #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "---" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" "Error en 'cents' entre a frecuencia estimada e a nota máis cercana segundo a " "configuración do afinador." #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "e = ---" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Tono" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" "Este área amosa a densidade espectral de potencia do sinal capturado. A " "frecuencia fundamental móstrase cunha liña vertical vermella, e o umbral de " "ruido mediante unha liña amarela horizontal e discontínua." #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Espectro" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "Non podes insertar unha nota enriba da nota de referencia." #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "Non empregues caracteres valeiros para os nomes das notas." #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "O nome contén caracteres inválidos." #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" "Non podes cambiar o desprazamento en frecuencia na primeria nota, debe estar " "fixado a 1/1." #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" "O desprazamento en frecuencia debe estar entre 0 e 1200 'cents', ou entre " "1/1 e 2/1." #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "mid-A" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "mid-C" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "Nome" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "Desprazamento" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "Frecuencia [Hz]" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "Hai notas có mesmo nome" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" "Hai valores inválidos na escala: as notas deberán ficar ordenadas por " "frecuencia / desprazamento" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" "Hai valores inválidos na escala: tódalas notas deben estar na mesma octava" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "Hai notas sen nome" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "Abrir arquivo de escala" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "Ficheiros de Scala" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" "Identificador da nota, texto libre que será amosado na ventá principal cando " "o afinador esté preto da devandita nota. Non empregues caracteres en blanco " "aquí." #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" "Desprazamento en frecuencia. Podes definilo coma unha desviación en 'cents' " "con respecto á nota de referencia (a primeira), ou coma un múltiplo da súa " "frecuencia, como '3/2' ou '5/4'. Tódolos valores deben estar entre 0 e 1200 " "'cents', ou entre 1/1 e 2/1 (é dicir, tódalas notas deben estar na mesma " "octava), e deben estar todos eles ben ordenados." #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" "Frecuencia. Podes definir aquí a frecuencia absoluta dunha nota concreta " "como referencia, e o resto de frecuencias estableceranse en base a este " "valor e ó desprazamento en frecuencia de cada nota (definido na columna " "'Desprazamento'). Podes empregar tanto un valor numérico, ou as palabras " "clave 'mid-C' (261.625565 Hz) e 'mid-A' (440 Hz), normalmente reservadas á " "cuarta octava (intenta asignar soamente frecuencias á cuarta octava)." #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "configuración de lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Predet." #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "Restaura a configuración por defecto, sen aplicala." #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" "Aplica os cambios actuais ao afinador en execución, pero non modifica o " "ficheiro de configuración.\n" "\n" "Os cambios aplicados poderán ser desfeitos premendo Cancelar." #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "Aplica os cambios actuais e modifica o ficheiro de configuración." #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" "Anula os cambios aplicados previamente e pecha o diálogo de configuración." #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Sistema audio" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Dispositivo audio" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "Aquí podes escoller o sistema de sonido" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" "Escolle o dispositivo de entrada se dispós de máis de un. Se estás a usar " "JACK, tamén podes conectar Lingot á orixe de audio desexada mediante unha " "aplicación de control de JACK externa." #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "Escolle a orixe de audio:" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" "Configuración da entrada de sonido. Define aquí a fonte de audio e a " "configuración relativa ó hardware." #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Captura" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Tasa de cálculo" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Tasa de visualización" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "Mínima SNR" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "Axusta as seguintes tasas de refresco" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "Axusta os niveis de ruido" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" "Mínimo nivel de sinal-a-ruido pra considerar o sinal capturado como algo " "relevante. Intenta manter este nivel baixo, e súbeo se tes problemas en " "ámbitos ruidosos. Este nivel é reflexado no espectro como unha liña amarela " "discontínua" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" "Número de visualizacións por segundo da (última) frecuencia calculada, error " "e espectro." #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "Número de cálculos por segundo da frecuencia fundamental." #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "Axustes rápicos sobre a resposta dinámica e os niveis de sinal." #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Axustes" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Ventá temporal" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" "Ésta é a porción máis recente de sinal considerada na afinación. Canto máis " "longa sexa, máis precisión podemos obter, pero ao mesmo tempo a resposta " "dinámica será máis lenta, ao estarmos considerando partes máis vellas do " "sinal. Ademáis, se subes este parámetro, o coste computacional aumenta. Este " "valor, en mostras - que depende da tasa efectiva de mostreo - debe ser maior " "ou igual que o tamaño da FFT." #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "segundos" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "mostras" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "Tamaño de FFT" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "O búfer de FFT permite a Lingot botar unha primeira ollada ó espectro do " "sinal. Valores máis altos axudan a ter un mellor 'enganche' có pico " "correcto, pero supoñen ademáis un maior coste computacional. Non uses " "valores moi elevados a non ser que teñas unha tasa efectiva de mostreo " "igualmente elevada." #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" "O búfer de FFT permite a Lingot botar unha primeira ollada ó espectro do " "sinal. Valores máis altos axudan a ter un mellor 'enganche' có pico " "correcto, pero supoñen ademáis un maior coste computacional. Non uses " "valores moi elevados a non ser que teñas unha tasa efectiva de mostreo " "igualmente elevada." #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "Optimizar parámetros automáticamente" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" "Deixa esta opción activada e Lingot optimizará algúns parámetros por ti." #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "Frecuencia mínima" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "Frecuencia máxima" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" "Esta é a frecuencia mínima que queres afinar neste intrumento. Podes poñer " "aquí a frecuencia ou escoller unha nota da lista." #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "Rango de frecuencias" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" "Configuración básica do algoritmo de cálculo da frecuencia fundamental. " "Acude aquí para obter unha mellor precisión, rango de frecuencia ou uso de " "procesador." #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "Opcións" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "Nome da escala, só para a túa información." #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "cents" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" "Aplica un desprazamento en frecuencia a tódalas notas definidas na táboa de " "abaixo." #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "Octava" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" "Octava das frecuencias mostradas na táboa de abaixo. Cambia este parámetro " "se queres mostrar as frecuencias asignadas noutras octavas, pero trata de " "asignar frecuencias na 4ª octava (a 4ª octava comprende normalmente " "frecuencias dende os 261.63 Hz ata os 523.25 Hz)." #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "Insertar" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" "Engade unha nota á lista, xusto enriba da nota seleccionada, ou engádea ao " "final no caso de non haber filas seleccionadas. Non é posible engadir unha " "nota antes da nota de referencia (a primeira). Podes tamén usar as teclas " "Insertar e Suprimir sobre a táboa do lado." #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "Eliminar" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" "Elimina as notas seleccionadas. A nota de referencia (a primeira), non pode " "ser eliminada. Podes empregar tamén a tecla Suprimir sobre a táboa do lado." #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "Importar" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" "Importa a escala dende un arquivo externo .scl, có formato empregado no " "proxecto Scala (http://www.huygens-fokker.org/scala/)" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" "Lingot é un afinador universal, podes afinar calqueira instrumento segundo a " "escala definida aquí." #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "Escala" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" "Erro lendo o arquivo de configuración, liña %i: sistema de audio non " "recoñecido, asumindo valor por defecto.\n" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" "O arquivo de configuración ten erros, e polo tanto algúns parámetros terán " "valores por defecto. O problema será solucionado unha vez confirmes as " "preferencias no diálogo de configuración." lingot-1.0.1/po/sv.po0000644000175000017500000004647013320113677011352 00000000000000# Swedish messages for lingot # Copyright (C) 2007-2009 Iban Cereijo, Jairo Chapela. # This file is distributed under the same license as the lingot package. # John Gustafsson , 2008-2009. # msgid "" msgstr "" "Project-Id-Version: lingot\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-05 21:55+0200\n" "PO-Revision-Date: 2009-07-17 18:04+0100\n" "Last-Translator: John Gustafsson \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/lingot-audio-alsa.c:67 ../src/lingot-audio-oss.c:71 #, c-format msgid "" "Cannot open audio device '%s'.\n" "%s" msgstr "" #: ../src/lingot-audio-alsa.c:76 ../src/lingot-audio-alsa.c:84 msgid "Cannot initialize hardware parameter structure." msgstr "" #: ../src/lingot-audio-alsa.c:92 msgid "Cannot set access type." msgstr "" #: ../src/lingot-audio-alsa.c:99 msgid "Cannot set sample format." msgstr "" #: ../src/lingot-audio-alsa.c:108 msgid "Cannot set sample rate." msgstr "" #: ../src/lingot-audio-alsa.c:117 msgid "Cannot set channel number." msgstr "" #: ../src/lingot-audio-alsa.c:123 msgid "Cannot set parameters." msgstr "" #: ../src/lingot-audio-alsa.c:129 msgid "Cannot prepare audio interface for use." msgstr "" #: ../src/lingot-audio-alsa.c:166 ../src/lingot-audio-oss.c:139 #: ../src/lingot-audio-pulseaudio.c:119 msgid "Read from audio interface failed." msgstr "" #: ../src/lingot-audio-alsa.c:241 msgid "Default Device" msgstr "" #: ../src/lingot-audio.c:57 msgid "The application has not been built with OSS support" msgstr "Applikationen har inte byggts med stöd för OSS" #: ../src/lingot-audio.c:66 msgid "The application has not been built with ALSA support" msgstr "Applikationen har inte byggts med stöd för ALSA" #: ../src/lingot-audio.c:75 msgid "The application has not been built with JACK support" msgstr "Applikationen har inte byggts med stöd för JACK" #: ../src/lingot-audio.c:84 msgid "The application has not been built with PULSEAUDIO support" msgstr "Applikationen har inte byggts med stöd för PulseAudio" #: ../src/lingot-audio-jack.c:64 msgid "Missing connection with JACK audio server" msgstr "Saknar anslutning till ljudservern JACK" #: ../src/lingot-audio-jack.c:89 ../src/lingot-audio-jack.c:172 msgid "Unable to connect to JACK server" msgstr "Kan inte ansluta till JACK-servern" #: ../src/lingot-audio-jack.c:115 msgid "No more JACK ports available" msgstr "Inga fler JACK-portar är tillgängliga" #: ../src/lingot-audio-jack.c:205 msgid "Default Port" msgstr "" #: ../src/lingot-audio-jack.c:246 msgid "Cannot activate client" msgstr "Kan inte aktivera klient" #: ../src/lingot-audio-jack.c:252 msgid "No active capture ports" msgstr "" #: ../src/lingot-audio-jack.c:264 ../src/lingot-audio-jack.c:277 msgid "Cannot connect input ports" msgstr "Kan inte ansluta ingångsportar" #: ../src/lingot-audio-jack.c:285 #, c-format msgid "Cannot connect to requested port '%s'" msgstr "" #: ../src/lingot-audio-oss.c:79 msgid "Error setting number of channels." msgstr "" #: ../src/lingot-audio-oss.c:87 msgid "Error setting bits per sample." msgstr "" #: ../src/lingot-audio-oss.c:102 msgid "Error setting DMA buffer size." msgstr "" #: ../src/lingot-audio-oss.c:108 msgid "Error setting sample rate." msgstr "" #: ../src/lingot-audio-pulseaudio.c:90 msgid "Error creating PulseAudio client." msgstr "" #: ../src/lingot-audio-pulseaudio.c:193 msgid "Default Source" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "C#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "D#" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "E" msgstr "" #: ../src/lingot-config-scale.c:84 msgid "F" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "F#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "G#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "A#" msgstr "" #: ../src/lingot-config-scale.c:85 msgid "B" msgstr "" #. default 12 tones equal-tempered scale hard-coded #: ../src/lingot-config-scale.c:91 msgid "Default equal-tempered scale" msgstr "" #: ../src/lingot-config-scale.c:280 msgid "incorrect format" msgstr "" #: ../src/lingot-config-scale.c:281 msgid "note number mismatch" msgstr "" #: ../src/lingot-config-scale.c:290 msgid "Error opening scale file." msgstr "" #: ../src/lingot-config-scale.c:364 msgid "the notes must be well ordered" msgstr "" #: ../src/lingot-config-scale.c:375 msgid "Error opening scale file" msgstr "" #: ../src/lingot-core.c:96 #, c-format msgid "" "The temporal buffer is smaller than FFT size. It has been increased to %0.3f " "seconds" msgstr "" "Tidsbufferten är mindre än FFT-storleken. Den har ökats till %0.3f sekunder." #: ../src/lingot-gui-mainframe.c:107 msgid "Logo design" msgstr "" #: ../src/lingot-gui-mainframe.c:132 msgid "Accurate and easy to use musical instrument tuner" msgstr "Precist och lättanvänt stämprogram för musikinstrument" #: ../src/lingot-gui-mainframe.c:138 msgid "translator-credits" msgstr "John Gustafsson , 2008 - 2009" #: ../src/lingot-gui-mainframe.c:269 msgid "" "Please check that there are not other processes locking the requested " "device. Also, consider that some audio servers can sometimes hold the " "resources for a few seconds since the last time they were used. In such a " "case, you can try again." msgstr "" #: ../src/lingot-gui-mainframe.c:279 msgid "The core is not running, you must check your configuration." msgstr "" #: ../src/lingot-gui-mainframe.c:291 msgid "Error" msgstr "Fel" #: ../src/lingot-gui-mainframe.c:292 msgid "Warning" msgstr "Varning" #: ../src/lingot-gui-mainframe.c:292 msgid "Info" msgstr "" #: ../src/lingot-gui-mainframe.c:317 msgid "Open Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:326 ../src/lingot-gui-mainframe.c:368 msgid "Lingot configuration files" msgstr "" #: ../src/lingot-gui-mainframe.c:358 msgid "Save Configuration File" msgstr "" #: ../src/lingot-gui-mainframe.c:364 msgid "untitled.conf" msgstr "" #: ../src/lingot-gui-config-dialog.c:406 msgid "Audio device identifier too long" msgstr "" #: ../src/lingot-gui-config-dialog.c:490 msgid "" "The provided scale contains wide gaps in frequency that increase the gauge " "range and produce a loss of visual accuracy. Consider providing scales with " "at least 12 tones, or with a maximum distance between adjacent notes below " "200 cents." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:1 msgid "lingot" msgstr "Lingot" #: ../src/lingot-gui-mainframe.glade.h:2 msgid "_File" msgstr "_Arkiv" #: ../src/lingot-gui-mainframe.glade.h:3 msgid "Opens an external configuration file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:4 msgid "Saves the running configuration to an external file." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:5 msgid "_Edit" msgstr "_Redigera" #: ../src/lingot-gui-mainframe.glade.h:6 msgid "_View" msgstr "_Visa" #: ../src/lingot-gui-mainframe.glade.h:7 msgid "Show spectrum" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:8 msgid "_Help" msgstr "_Hjälp" #: ../src/lingot-gui-mainframe.glade.h:9 msgid "" "Shows the error in cents in a visual way. The range will depend on the " "maximum distance between each two notes in the scale defined in the Lingot " "settings. Try to provide scales with low maximum distance, i.e. with an " "anough number of notes, to have a higher resolution in this gauge (12 notes " "per scale is a good option)." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:10 #: ../src/lingot-gui-config-dialog.glade.h:47 msgid "Deviation" msgstr "Avvikelse" #: ../src/lingot-gui-mainframe.glade.h:11 msgid "Estimated ground frequency in hertzs." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:12 msgid "f = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:13 msgid "" "Closest note to the estimated frequency, according to the scale defined in " "the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:14 msgid "---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:15 msgid "" "Error in cents between the estimated frequency and the closest note " "according to the scale defined in the Lingot settings." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:16 msgid "e = ---" msgstr "" #: ../src/lingot-gui-mainframe.glade.h:17 msgid "Tone" msgstr "Not" #: ../src/lingot-gui-mainframe.glade.h:18 msgid "" "This area shows the signal-to-noise ratio (SNR) of the captured signal. The " "ground frequency computed is shown with a red vertical line, and the noise " "threshold with a horizontal dotted yellow line." msgstr "" #: ../src/lingot-gui-mainframe.glade.h:19 msgid "Spectrum" msgstr "Spektrum" #: ../src/lingot-gui-config-dialog-scale.c:98 msgid "You cannot insert before the reference note." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:226 msgid "Do not use space characters for the note names." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:229 msgid "The name contains illegal characters." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:246 msgid "You cannot change the first shift, it must be 1/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:254 msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:273 #: ../src/lingot-gui-config-dialog-scale.c:330 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-A" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:275 #: ../src/lingot-gui-config-dialog-scale.c:332 #: ../src/lingot-gui-config-dialog-scale.c:642 msgid "mid-C" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:347 #: ../src/lingot-gui-config-dialog.glade.h:43 msgid "Name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:362 msgid "Shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:381 msgid "Frequency [Hz]" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:434 msgid "There are notes with the same name" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:448 msgid "" "There are invalid values in the scale: the notes should be ordered by " "frequency / shift" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:455 msgid "" "There are invalid values in the scale: all the notes should be in the same " "octave" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:464 msgid "There are notes without name" msgstr "" #. Unused parameter. #: ../src/lingot-gui-config-dialog-scale.c:526 msgid "Open Scale File" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:534 msgid "Scala files" msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:630 msgid "" "Note identifier, free text that will be displayed in the main window when " "tuning close to the given note. Don't use space characters here." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:635 msgid "" "Shift. You can define it as a deviation in cents from the reference note " "(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the " "values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all " "the notes must be in the same octave), and they must be well ordered." msgstr "" #: ../src/lingot-gui-config-dialog-scale.c:641 #, c-format msgid "" "Frequency. You can enter here the absolute frequency for a given note as a " "reference, and all the other frequencies will shift according to the " "deviations specified in the 'Shift' column. You can either use an absolute " "numeric value or the keywords '%s' (261.625565 Hz) and '%s' (440 Hz). Those " "keywords are normally reserved for the 4th octave (try to assign frequencies " "only to the 4th octave)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:1 msgid "lingot configuration" msgstr "Konfiguration av Lingot" #: ../src/lingot-gui-config-dialog.glade.h:2 msgid "Default" msgstr "Standardvärde" #: ../src/lingot-gui-config-dialog.glade.h:3 msgid "Resets the built-in settings, without applying them." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:4 msgid "" "Applies the current changes to the running tuner, but doesn't modify the " "configuration file. \n" "\n" "Any applied changes can be rolled back pressing Cancel." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:7 msgid "Applies the current changes and modifies the congifuration file." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:8 msgid "" "Rolls back all the previous applied changes and closes the configuration " "dialog." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:9 msgid "Audio system" msgstr "Ljudsystem" #: ../src/lingot-gui-config-dialog.glade.h:10 msgid "Audio device" msgstr "Ljudenhet" #: ../src/lingot-gui-config-dialog.glade.h:11 msgid "Here you can pick the sound system." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:12 msgid "" "Choose the audio device if you have more than one. If you are using JACK, " "you can also connect Lingot to a desired source with an external JACK " "control application." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:13 msgid "Select the audio source:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:14 msgid "Audio input settings. Select here the audio source." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:15 msgid "Capture" msgstr "Ljudfångst" #: ../src/lingot-gui-config-dialog.glade.h:16 msgid "Calculation rate" msgstr "Beräkningsfrekvens" #: ../src/lingot-gui-config-dialog.glade.h:17 msgid "Hz" msgstr "Hz" #: ../src/lingot-gui-config-dialog.glade.h:18 msgid "Visualization rate" msgstr "Visualiseringsfrekvens" #: ../src/lingot-gui-config-dialog.glade.h:19 msgid "Minimum SNR" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:20 msgid "dB" msgstr "dB" #: ../src/lingot-gui-config-dialog.glade.h:21 msgid "Adjust the following refresh rates:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:22 msgid "Adjust the noise level:" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:23 msgid "" "Minimum signal-to-noise ratio to consider the captured signal as something " "relevant. Try to keep this level low, and raise it if you experience " "problems in very noisy environments. This level is depicted in the spectrum " "area as a yellow dotted line." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:24 msgid "" "Number of visualizations per second of the (last) computed frequency, error " "and spectrum. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:25 msgid "Number of calculations of the fundamental frequency per second." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:26 msgid "Quick adjustments on the dynamic response and the signal levels." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:27 msgid "Adjustments" msgstr "Justeringar" #: ../src/lingot-gui-config-dialog.glade.h:28 msgid "Temporal window" msgstr "Tidsfönster" #: ../src/lingot-gui-config-dialog.glade.h:29 msgid "" "This is the most recent amount of data considered for tuning. The longer it " "is, the more accuracy you can obtain, but also the dynamic response gets " "slower, regarding you are considering older parts of the signal. Also, if " "you raise this parameter, the computational cost increases. The size of the " "buffer, in samples (depending on the effective sample rate), must be greater " "than or equal to the FFT buffer size." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:30 msgid "seconds" msgstr "sekunder" #: ../src/lingot-gui-config-dialog.glade.h:31 msgid "samples" msgstr "samplingar" #: ../src/lingot-gui-config-dialog.glade.h:32 msgid "FFT size" msgstr "FFT-storlek" #: ../src/lingot-gui-config-dialog.glade.h:33 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally " "more expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:34 msgid "" "The FFT buffer gives Lingot a first look to the spectrum. Higher values can " "help Lingot to hook up the correct peak, but it's also computationally more " "expensive. Don't use high values here unless you need to tune high " "frequencies." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:35 msgid "Optimize parameters automatically" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:36 msgid "Leave this option ON and Lingot will optimize some parameters for you." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:37 msgid "Minimum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:38 msgid "Maximum note" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:39 msgid "" "This is the lowest frequency you want to tune in this instrument. You can " "put here either a frequency or select a note from the popup list." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:40 msgid "Intrument frequency range" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:41 msgid "" "Basic settings on the frequency finding algorithm. Come here to get better " "accuracy, frequency range or CPU usage. " msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:42 msgid "Settings" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:44 msgid "Scale name, only for your information." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:45 msgid "cents" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:46 msgid "" "Applies a shift in frequency to all the notes defined in the table below." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:48 msgid "Octave" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:49 msgid "" "Octave whose frequencies are being displayed in the table below. Change this " "parameter if you want to display the assigned frequencies in other octaves, " "but try to assign the frequencies always to the 4th octave (The 4th octave " "usually covers the frequencies from 261.63 Hz to 523.25 Hz)." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:50 msgid "Insert" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:51 msgid "" "Adds a new note to the list, just above the selected line, or appends it to " "the end if no line is selected. Is not possible to add a note before the " "reference (the first) one. You can also use the Insert key on the table " "beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:52 msgid "Delete" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:53 msgid "" "Deletes the selected notes. The reference note, i.e., the first one, cannot " "be removed. You can also use the Delete key on the table beside." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:54 msgid "Import" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:55 msgid "" "Imports the scale from an external .scl file, with the Scala project format " "(http://www.huygens-fokker.org/scala/)" msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:56 msgid "" "Lingot is an universal tuner, it can tune any instrument according to the " "scale you define here." msgstr "" #: ../src/lingot-gui-config-dialog.glade.h:57 msgid "Scale" msgstr "" #: ../src/lingot-io-config.c:589 #, c-format msgid "" "Error parsing the configuration file, line %i: unrecognized audio system, " "assuming default value.\n" msgstr "" #: ../src/lingot-io-config.c:614 msgid "" "The configuration file contains errors, and hence some default values have " "been chosen. The problem will be fixed once you have accepted the settings " "in the configuration dialog." msgstr "" lingot-1.0.1/org.nongnu.lingot.desktop.in0000644000175000017500000000053513320113677015321 00000000000000[Desktop Entry] Name=Lingot GenericName=Musical instrument tuner Keywords=frequency;note;gauge Comment=LINGOT Is Not a Guitar-Only Tuner Comment[cs]=(Nejen kytarová) ladička Comment[fr]=Un accordeur de guitare, mais pas que Exec=lingot Icon=@PACKAGE_ICON_DIR@/org.nongnu.lingot.svg Terminal=false Type=Application Categories=GNOME;GTK;AudioVideo;