Thread: [kln2-devel] tune + amo
Brought to you by:
wiecko
From: Silhusk <si...@bl...> - 2004-08-05 14:17:47
|
Hi, the guitar tuner is really great! The 'free recognition' mode can easily be used for other instruments than guitars. Some people use A0 = 444 Hz or other frequencies, could we let the user choose the frequency of A0 (giving 440 as default)? (a little text field in the guitar tuner's window would be enough) the guitar tuner is not perfect... :( Some time KLN2 hangs up or generates a 'segmentation fault'. I think it's because of some negative pitchs it returns. some debug - Stack dump: BaseMusicNote::numOfNoteInOctave (pitch=-6) at basemusicnote.cpp: 119 BaseMusicNote::isWhite (pitch=-6) at basemusicnote.cpp: 122 BaseMusicNote::accidentalOf (pitch=-6) at basemusicnote.cpp: 144 BaseMusicNote::stringName (pitch=-6) at basemusicnote.cpp: 373 BaseMusicNote::stringName (numInOctave=0, accident=0, shorty=false) at aseusicote.cpp: 191 BaseMusicNote::stringName (pitch=-6) at basemusicnote.cpp: 373 BaseMusicNote::stringName (numInOctave=0, accident=0, shorty=false) at aseusicote.cpp: 191 BaseMusicNote::stringName (pitch=-6) at basemusicnote.cpp: 373 BaseMusicNote::stringName (numInOctave=0, accident=0, shorty=false) at aseusicote.cpp: 191 BaseMusicNote::stringName (pitch=-6) at basemusicnote.cpp: 373 [...] BaseMusicNote::stringName (numInOctave=0, accident=0, shorty=false) at aseusicote.cpp: 191 BaseMusicNote::stringName (pitch=-6) at basemusicnote.cpp: 373 GuitarTunerDialog::customEvent (this=0x8250390, e=0xfffffffa) at guitartuner.cpp: 241 QObject::event () from /usr/lib/libqt-mt.so.3 [...] stringName functions recursively call themselves forming an endless loop and then causing the segmentation fault :( this is my diagnosys. ## another midi output I wrote another midi output way using fluidsynth (http://www.fluidsynth.org/) wich is a software synthesizer. Unfortunately it uses SoundFonts (requiring another file), but some can be freely downloaded from http://www.geocities.com/SiliconValley/Campus/8645/sf2.html http://www.hammersound.net/cgi-bin/soundlink.pl?action=view_category&category=Collections (I used 'Vintage Dreams') Of course SoundFonts can also be created! (see http://smurf.sourceforge.net/ ) KLN2 looks for a SoundFont file named 'kln2fluid.sf2' that must be placed in program's current directory. It would be better to let the user choose wich file to use, but this means edit MIDI_setup dialog and options' struct. Can I do it? Note: the SoundFont file is not present in the cvs yet, but I'm trying to make a minimalist one, just with piano and guitar. Regards, Carlo |
From: Marek W. <Mar...@fu...> - 2004-08-05 23:49:09
|
Hi, On Thu, 5 Aug 2004, Silhusk wrote: > the guitar tuner is really great! Thanks. :) > The 'free recognition' mode can easily be used for other instruments > than guitars. Some people use A0 = 444 Hz or other frequencies, could we > let the user choose the frequency of A0 (giving 440 as default)? > (a little text field in the guitar tuner's window would be enough) OK. Thanks for the suggestion. > stringName functions recursively call themselves forming an endless loop > and then causing the segmentation fault :( > this is my diagnosys. True. Sorry for that. I committed a quick fix to the CVS - it shouldn't crash at this point any more. But I will have to look through the source to search for similar situations. Thanks for reporting. ~Marek -- \/ /|\ Marek Wieckowski ##### | | | = . . = \|/ Institute of Theoretical Physics U | Warsaw University / ~ \___ | <| | | > . < | http://www.fuw.edu.pl/~wiecko <<___>> | http://klearnnotes2.sourceforge.net |
From: Marek W. <Mar...@fu...> - 2004-08-06 22:38:38
|
Hi, On Thu, 5 Aug 2004, Silhusk wrote: > ## another midi output > I wrote another midi output way using fluidsynth As far as I understand, from user's point of view what fluidsynth does is exactly what timidity++ does: it takes midi data, reads wave patches from a soundfont file and sends appropriate patches to an audio device. This way one can listen to a midi file without using an, usually ugly sounding (if existing at all), hardware midi sequencer. Right? On one hand we already have a working timidity interface. But I think we should support as many sound-making systems as possible, allowing any user to use kln2 with sound made the way she likes. And as far as I learned since yesterday, fluidsynth is much simpler to use from programmers point of view. :) Oh, and it seems that fluidsynth also support more sound environments (JACK etc.) than timidity. So it's really great that you did this. :) > Note: the SoundFont file is not present in the cvs yet, but I'm trying > to make a minimalist one, just with piano and guitar. How big will be the sound font bank? With just two instruments it shouldn't be a big file, I suppose. If it was too big it would have to be published as a separate file, together with kln2 package but not as a part of it. :( And I would expect, that anyone who uses fluidsynth has already downloaded a sountfont which she/he likes: > can be freely downloaded from http://www.geocities... This is the way it works for timidity - it's user's responsibility to install both timidity and soundfonts/midi patches. But yes, if the file is small and "standard" sfonts are somehow irrelevant [WHY?], it might make sense to include it in the kln2 package itself; for example, for QT_VERSION > 0x030201 there is applicationDirPath() available - if the sound font was installed with the package it would be installed in a standard location, and applicationDirPatch() might be used for locating the sound font... (see how klearnnotes2.cpp around line 643 searches for helpfiles - not perfect, but you can search a few "natural" locations). > let the user choose wich file to use, but this means edit MIDI_setup > dialog and options' struct. Can I do it? Sure. :) Extra text box + a file chooser opening button in midi_setup dialog is OK. It would be nice if it would not only become disabled but even disappear if other midi sound system is chosen. It may for example replace "device(port)" selection which would be not used for fluidsynth. Oh, and it really needs controlling volume. The kln2 system of saving settings has to be rebuild (for example, because of settings for new exercises). Please, do not add anything to the settings saved as a structure loadSetX. If you would like to save location of user's soundfont do it into a separate file, the way e.g. voice model filename is stored. Anyway, this does look great and works fine. :) Regards, Marek PS: An big advantage of fluidsynth over timidity would be if it was used as a shared library instead of starting a separate process. But this would probably make our code much more complicated: another test in configure.in plus lots of #ifdef-s... No, it's probably better leave fluidsynth the way you coded it. -- \/ /|\ Marek Wieckowski ##### | | | = . . = \|/ Institute of Theoretical Physics U | Warsaw University / ~ \___ | <| | | > . < | http://www.fuw.edu.pl/~wiecko <<___>> | http://klearnnotes2.sourceforge.net |
From: Carlo <si...@bl...> - 2004-08-07 00:07:39
|
Hi, Il sab, 2004-08-07 alle 00:38, Marek Wieckowski ha scritto: > As far as I understand, from user's point of view what fluidsynth does is > exactly what timidity++ does: it takes midi data, reads wave patches from > a soundfont file and sends appropriate patches to an audio device Exactly. Well, I used timidity to play midi files without having to load soundfont file, so... I don't know how it works. My problem was that kln2 starts timidity as a server. It assumes that timidity has been compiled with the server option enabled, wich isn't the case in many rpm and even deb packages. (the user should recompile timidity) As far as I could notice timidity eat far more cpu resources than fluidsynth, ...but maybe I'm wrong... > Oh, and it seems that fluidsynth also support more sound environments > (JACK etc.) than timidity. btw: it also runs on mac and win (and other platforms) > How big will be the sound font bank? Vintage Dreams has >100 instruments and is 307.3 KB :) > The kln2 system of saving settings has to be rebuild (for example, because > of settings for new exercises). Yup, as you requested some mails ago, I was thinking about rewriting it. What about a text file config?? like the apache's one, not xml, something like: SECTION OPTION value OPTION2 value ENDSECTION where sections could be midi, exercises, notes ranges,... I know, this requires a parser. Harder to code and slower to run. But changing version would simply mean inserting a new line. I know this seems not to make sense since the user doesn't need to change anything in this file, so I'm ansking everybody for their opinion. ## Now about pitch input ex.: say you're playing kln2's game answearing with a piano, and the note shown is C. Now, I want to answear the same question (to show that I'm faster :P) but playing another instrument, say in Bb (B flat). If you play a C you answear right. If I play a C my answear is wrong! (I should play a Bb) kln2 should manage this "transposition" Another option to add to pitch input setup... Regards, Carlo |
From: Marek W. <Mar...@fu...> - 2004-08-07 01:34:29
|
On Sat, 7 Aug 2004, Carlo wrote: > Vintage Dreams has >100 instruments and is 307.3 KB :) Ah, that's why it sounds so lousy. ;) Just kidding. Do it! :) > Yup, as you requested some mails ago, I was thinking about rewriting it. Really? That would be wonderful. > What about a text file config?? like the apache's one, not xml, > something like: > > SECTION > OPTION value > OPTION2 value > ENDSECTION Great. But why not xml? I saw preferences-0.2.tar.gz at http://www.trolltech.com/freesoftware/index.html?Action=ShowCat&category=Classes . I didn't have time (and won't in predictable future - sorry), but first gilmpse was encouraging. But a rough text file seems as good. > I know, this requires a parser. Yeah. The advantages of the preferences-0.2 is that it is almost ready to use... And seems quite flexible. > I know this seems not to make sense since the user doesn't need to > change anything in this file, so I'm ansking everybody for their > opinion. OK. Here is mine: anything would be better than what we have now. :( If you have time and would like to do it: great! :) Whether txt or xml - anything is better. The only requirements are: * data should be stored in portable way (text/xml, not binary!); * the phaser should not crash if a preference is not set; it should let the caller know it should drop to a default value; * it should handle different kinds of data in a unified way. It would be great if it would: * enable deleting obolate entries (to keep the file small) * enable grouping the enteries (thus xml seems natural) * handle non-standard fonts for non-numeric settings (note, that there may be local characters even in computer paths!) But the last points are not obligatory and may be added in future. The first version may be very rough - just something that works more or less. BTW: I changed structure of some code in CVS and turnd saving/loading totally off until the code is sorted out. Regards, ~Marek -- \/ /|\ Marek Wieckowski ##### | | | = . . = \|/ Institute of Theoretical Physics U | Warsaw University / ~ \___ | <| | | > . < | http://www.fuw.edu.pl/~wiecko <<___>> | http://klearnnotes2.sourceforge.net |