FamiTracker 0.4.1.1 pre-release

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
FamiTracker 0.4.1.1 pre-release
by on (#116760)
For those interested I've been working on a Qt port of FamiTracker for going on 8 months. It's very close to done but still has some issues that need to be worked out. I posted about it here. I have uploaded a Linux build which I know works at least in Ubuntu 12.04 and requires SDL. I know at least one person on NESDev has been after me to get off my butt and get this done. 8-)
Re: FamiTracker 0.4.1.1 pre-release
by on (#116766)
cpow wrote:
a Qt port of FamiTracker

Look at the way the FT is angled in the title bar or the main page of the wiki. Compare the logo of Qt, the multi-platform C++ application framework that powers the KDE Software Compilation and NESICIDE. Coincidence?

Image Image
It was inevitable.

And cpow has told me it's powered by an implementation of MFC on top of Qt, which should ideally allow other applications that use MFC to be more easily ported to Qt.
Re: FamiTracker 0.4.1.1 pre-release
by on (#116767)
Too bad the Ts don't match too! :lol:

Tepples if you get a chance to try it let me know what playback is like. I've only heard it inside VMs, one on a ridiculously underpowered host and the other on a behemoth machine. They both sounded bad. The slow machine obviously. But I'm wondering if I need to fiddle the SDL setup - Famitracker ran about 2x normal speed in the VM on the fast host.
Re: FamiTracker 0.4.1.1 pre-release
by on (#116779)
On my Atom netbook running 12.04 (which runs FT fine in Wine) the FTM that I loaded ran at half speed. While I was poking around in the configuration to try to find a way to lower the quality, it core dumped on me soon after I closed the configuration or module properties dialog box. How should I troubleshoot this? Two other FTMs that I tried gave "This file was created in a newer version of FamiTracker." It's especially a pain because the file chooser doesn't seem to go back to the same folder I was in last time, and it defaults to "all files" rather than "*.ftm". The toolbar buttons lack tooltips. Nothing in the Help menu works.

What's a "horzline not implemented"? And what's a "MapVirtualKey...not sure what to do here yet uCode=41, uMapType=0"? And I see a "QThread::setPriority: Cannot set priority, thread is not running".
Re: FamiTracker 0.4.1.1 pre-release
by on (#116781)
tepples wrote:
On my Atom netbook running 12.04 (which runs FT fine in Wine) the FTM that I loaded ran at half speed. While I was poking around in the configuration to try to find a way to lower the quality, it core dumped on me soon after I closed the configuration or module properties dialog box. How should I troubleshoot this? Two other FTMs that I tried gave "This file was created in a newer version of FamiTracker." It's especially a pain because the file chooser doesn't seem to go back to the same folder I was in last time, and it defaults to "all files" rather than "*.ftm". The toolbar buttons lack tooltips. Nothing in the Help menu works.


Easy one first. This is Qt FamiTracker-0.4.1.1 which is based on MFC FamiTracker-0.4.1. MFC FamiTracker has rolled to 0.4.3 beta, so FTMs that were created with MFC 0.4.2 or later won't load in Qt 0.4.1.1. Eventually, when I get to Qt 0.4.3.x that will be feature-compatible with MFC 0.4.3.

With regard to the half-speed issue, I haven't yet implemented the Sound configuration. What settings do you have in FT in Wine on that tab? Strange that in one of my VMs it ran at 2x speed...likely a SDL config issue. I'll look at implementing the Sound config dialog.

tepples wrote:
What's a "horzline not implemented"? And what's a "MapVirtualKey...not sure what to do here yet uCode=41, uMapType=0"? And I see a "QThread::setPriority: Cannot set priority, thread is not running".


Most of that is just like I indicated in the post on the FT forum: for now the program is very unabashedly console-chatty, mostly because it helps me remember what's left to do or figure things out. The "horzline" is just a graphical element that doesn't really add much so I will either remove that message or implement it. Those messages will disappear as releases happen that incorporate fixes, updates, etc. The QThread:: message is an annoyance but I can easily work around it.

Thanks for trying, and apologies for the annoyances. I'm hoping to work through them through feedback from people like you. 8-)
Re: FamiTracker 0.4.1.1 pre-release
by on (#116783)
Here's what I have in FT/Wine
Attachment:
FT_Wine_cfg.png
FT_Wine_cfg.png [ 3.63 KiB | Viewed 5914 times ]

44.1 kHz, 16-bit, 250 ms buffer, high-pass 16 Hz, low-pass -24 dB 12 kHz, 100% volume

By "half speed" I don't mean the pitch was low. I mean it sounds like frames of audio were being repeated, and low pitches were distorted beyond recognition. The slowdown tended to increase when I navigated through menus and dialogs and especially when I alt-tabbed to Firefox to write my testing report. Xfce Task Manager reported fairly high CPU usage.

Yesterday, I got FCEUX audio working in Wine. So it appears Wine audio improved greatly from the version in 10.04 to the version I'm running.

EDIT: cpow's burn-down list
Re: FamiTracker 0.4.1.1 pre-release
by on (#117857)
EDIT: cpow's burn-down list[/quote]

Haha. Alright I've updated the burn-down.

I apparently need to learn how DirectSound works because the FamiTracker code uses it and creates a certain number of "blocks" of audio sample data depending on the buffer size you select. It would make sense if the program got an interrupt at the end of each block, but I'm not sure that's what actually happens. [Which is different from SDL which interrupts whenever it needs a new "block"]. I am working to make the equivalent variability available with SDL's sample buffer size.
Re: FamiTracker 0.4.1.1 pre-release
by on (#117897)
I'll let you know how it builds and runs on OpenBSD. :) I have a nearly fresh install of BSD, so right now I'm in the process of building Qt3 from ports. (Is there anything else I'll need?) Then I'll try to build Nesicide.

I'm following your github now. :) (I'm Heathcode on github, in case I should contact you there.)
Re: FamiTracker 0.4.1.1 pre-release
by on (#117940)
Imperial wrote:
I'll let you know how it builds and runs on OpenBSD. :) I have a nearly fresh install of BSD, so right now I'm in the process of building Qt3 from ports. (Is there anything else I'll need?) Then I'll try to build Nesicide.

I'm following your github now. :) (I'm Heathcode on github, in case I should contact you there.)


NESICIDE and FamiTracker use Qt4. You don't have to build NESICIDE...just build the projects in libs/famitracker and apps/famitracker. For FamiTracker the only dependency [beyond the Qt libs] is SDL, I believe.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118105)
Hey, cpow. It looks like this needs the Windows SDK, and so I'll probably need Wine to get anywhere with this. The thing about that is, OpenBSD doesn't do Wine. Period. (OpenBSD is like the cranky old man on the block who always yells at little Linus to get off his lawn.)

It might be a wild goose chase, but would it be possible to put windows.h and company in the directory and compile it that way? I'm asking nicely, because I don't have windows.h, because you get the SDK from Microsoft's downloader, which is a .exe, which I cannot run. :roll:

I'm just working on MML in the meantime. :)
Re: FamiTracker 0.4.1.1 pre-release
by on (#118121)
Is windows.h or a reasonable facsimile in the MinGW w32api package?
Re: FamiTracker 0.4.1.1 pre-release
by on (#118127)
tepples wrote:
Is windows.h or a reasonable facsimile in the MinGW w32api package?
Since I have MinGW in my computer, I can tell you that it does include a file called "windows.h". (I don't know what other details would be needed to answer this question properly?)
Re: FamiTracker 0.4.1.1 pre-release
by on (#118151)
Imperial wrote:
Hey, cpow. It looks like this needs the Windows SDK, and so I'll probably need Wine to get anywhere with this. The thing about that is, OpenBSD doesn't do Wine. Period. (OpenBSD is like the cranky old man on the block who always yells at little Linus to get off his lawn.)

It might be a wild goose chase, but would it be possible to put windows.h and company in the directory and compile it that way? I'm asking nicely, because I don't have windows.h, because you get the SDK from Microsoft's downloader, which is a .exe, which I cannot run. :roll:

I'm just working on MML in the meantime. :)

It requires only the Wine headers not a functional Wine. Does that help? I thought the headers are freely available? If I recall all I had to do was sudo apt-get install wine-dev...no building Wine required.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118168)
tepples wrote:
Is windows.h or a reasonable facsimile in the MinGW w32api package?

cpow wrote:
It requires only the Wine headers not a functional Wine. Does that help? I thought the headers are freely available? If I recall all I had to do was sudo apt-get install wine-dev...no building Wine required.

To check on this, I downloaded mingw's w32api from sourceforge. I didn't build anything in it. I just copied all the contents and subdirectories of w32api's include directory to my home directory. Then I added this directory to nesicide-master/libs/famitracker/Makefile's INCPATH, having already run qmake4 there. Now I run gmake. (Funny thing. Did you know BSD's make and GNU's make aren't even the same? Of course not, you say, but then you get to deal with the incompatibilities. :x ) It finds the headers just fine, but I get the tail end of some errors:
Code:
/home/bjh/include/io.h:231: error: expected initializer before '_findnext64'
/home/bjh/include/io.h:232: error: expected initializer before '_findnext32i64'
/home/bjh/include/io.h:233: error: expected initializer before '_findnext64i32'
/home/bjh/include/io.h:236: error: expected initializer before 'intptr_t'
In file included from /usr/include/g++/i386-unknown-openbsd5.3/bits/c++io.h:43,
                 from /usr/include/g++/iosfwd:46,
                 from /usr/include/g++/bits/stl_algobase.h:70,
                 from /usr/include/g++/algorithm:65,
                 from /usr/local/include/X11/qt4/QtCore/qglobal.h:68,
                 from /usr/local/include/X11/qt4/QtCore/qnamespace.h:45,
                 from /usr/local/include/X11/qt4/QtCore/qobjectdefs.h:45,
                 from /usr/local/include/X11/qt4/QtCore/qobject.h:47,
                 from /usr/local/include/X11/qt4/QtCore/qcoreapplication.h:45,
                 from /usr/local/include/X11/qt4/QtGui/qapplication.h:45,
                 from /usr/local/include/X11/qt4/QtGui/QApplication:1,
                 from ../../common/cqtmfc.h:4,
                 from Source/stdafx.h:86,
                 from Source/TrackerChannel.cpp:21:
/usr/include/g++/i386-unknown-openbsd5.3/bits/gthr.h:122: error: expected `}' before end of line
/usr/include/g++/i386-unknown-openbsd5.3/bits/gthr.h:122: error: expected declaration before end of line
gmake: *** [TrackerChannel.o] Error 1


I'm sure there's a tool in BSD-land somewhere that can open deb packages, but I haven't found one yet. I'm presuming that the w32api headers in mingw are similar enough to those in Ubuntu's wine-dev package, but maybe they're not. The errors about gthr.h catch my eye as well.

Iunno, man. :?
Re: FamiTracker 0.4.1.1 pre-release
by on (#118169)
Imperial wrote:
I'm sure there's a tool in BSD-land somewhere that can open deb packages
They're AR chives. 7z also can unpack them.
Naively you could do something like ar p foo.deb data.tar.gz | bsdtar xzvf -
Re: FamiTracker 0.4.1.1 pre-release
by on (#118170)
lidnariq wrote:
Imperial wrote:
I'm sure there's a tool in BSD-land somewhere that can open deb packages
They're AR chives. 7z also can unpack them.
Naively you could do something like ar p foo.deb data.tar.gz | bsdtar xzvf -

Fantastic! Thank you lidnariq.

(EDIT:) It seems to work well with the wine-dev headers, if with warnings. So that's good! But then it gets to FFT/Fft.cpp and throws another error:
Code:
In file included from Source/FFT/Fft.h:9,
                 from Source/FFT/Fft.cpp:9:
Source/FFT/Complex.h:45:7: warning: no newline at end of file
In file included from Source/FFT/Fft.cpp:9:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant
Source/FFT/Fft.h: In member function 'double Fft::GetIntensity(int) const':
Source/FFT/Fft.h:26: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.h: In member function 'void Fft::PutAt(int, double)':
Source/FFT/Fft.h:54: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp: In constructor 'Fft::Fft(int, long int)':
Source/FFT/Fft.cpp:41: error: lvalue required as left operand of assignment
Source/FFT/Fft.cpp: In destructor 'Fft::~Fft()':
Source/FFT/Fft.cpp:85: error: type 'int' argument given to 'delete', expected pointer
Source/FFT/Fft.cpp: In member function 'void Fft::Transform()':
Source/FFT/Fft.cpp:147: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:148: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:148: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:149: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:150: error: invalid types 'int[int]' for array subscript
gmake: *** [Fft.o] Error 1


It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?
Re: FamiTracker 0.4.1.1 pre-release
by on (#118178)
Imperial wrote:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant

It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?

No I haven't seen this error. But from the error it seems that perhaps something in the compile chain is #define'ing Complex as a numeric value. I can't look right now to see where else Complex class might be used, but you could try renaming the class to ComplexFT or something else. If that fixes this then we should post that as a bug/cross-platform issue to jsr so he can adjust the MFC source for future drops.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118209)
cpow wrote:
Imperial wrote:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant

It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?

No I haven't seen this error. But from the error it seems that perhaps something in the compile chain is #define'ing Complex as a numeric value. I can't look right now to see where else Complex class might be used, but you could try renaming the class to ComplexFT or something else. If that fixes this then we should post that as a bug/cross-platform issue to jsr so he can adjust the MFC source for future drops.
I did try renaming it to CComplex, but the error was the same. If you Google this error, there are a few threads on stackoverflow, etc., and the solution is a missing semicolon. But I can't find a missing semicolon anywhere in FFT/*.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118211)
Imperial wrote:
cpow wrote:
Imperial wrote:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant

It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?

No I haven't seen this error. But from the error it seems that perhaps something in the compile chain is #define'ing Complex as a numeric value. I can't look right now to see where else Complex class might be used, but you could try renaming the class to ComplexFT or something else. If that fixes this then we should post that as a bug/cross-platform issue to jsr so he can adjust the MFC source for future drops.
I did try renaming it to CComplex, but the error was the same. If you Google this error, there are a few threads on stackoverflow, etc., and the solution is a missing semicolon. But I can't find a missing semicolon anywhere in FFT/*.

My bad. Try renaming the _X to something else. *That* is what it is complaining about, not Complex. Something is redefining _X as a number in your toolchain/environment. While you're at it, change _W too...
Re: FamiTracker 0.4.1.1 pre-release
by on (#118214)
@cpow - Done and done, and onto the next error. :)

Code:
Makefile:2926: warning: overriding recipe for target `install_target'
Makefile:2917: warning: ignoring old recipe for target `install_target'
Makefile:2930: warning: overriding recipe for target `uninstall_target'
Makefile:2921: warning: ignoring old recipe for target `uninstall_target'
g++ -c -pipe -O2 -fno-wrapv  -I/usr/local/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/X11R6/include -DXTHREADS -I/usr/include/wine/windows/ -DUSE_WS_PREFIX -DWINE_UNICODE_NATIVE -O2 -fno-wrapv  -Wall -W -Wno-reorder -Wno-unused -pthread -fPIC -DFAMITRACKER_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/lib/qt4/mkspecs/openbsd-g++4 -I. -I/usr/local/include/X11/qt4/QtCore -I/usr/local/include/X11/qt4/QtGui -I/usr/local/include/X11/qt4 -I. -ISource -I../../common -I. -I/usr/local/include -I/home/bjh/include/wine/windows -o Fft.o Source/FFT/Fft.cpp
g++ -c -pipe -O2 -fno-wrapv  -I/usr/local/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/X11R6/include -DXTHREADS -I/usr/include/wine/windows/ -DUSE_WS_PREFIX -DWINE_UNICODE_NATIVE -O2 -fno-wrapv  -Wall -W -Wno-reorder -Wno-unused -pthread -fPIC -DFAMITRACKER_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/lib/qt4/mkspecs/openbsd-g++4 -I. -I/usr/local/include/X11/qt4/QtCore -I/usr/local/include/X11/qt4/QtGui -I/usr/local/include/X11/qt4 -I. -ISource -I../../common -I. -I/usr/local/include -I/home/bjh/include/wine/windows -o cqtmfc.o ../../common/cqtmfc.cpp
In file included from ../../common/cqtmfc.cpp:1:
../../common/cqtmfc.h:3645:1: warning: "MB_CANCELTRYCONTINUE" redefined
In file included from /home/bjh/include/wine/windows/windows.h:44,
                 from ../../common/cqtmfc.h:231,
                 from ../../common/cqtmfc.cpp:1:
/home/bjh/include/wine/windows/winuser.h:2621:1: warning: this is the location of the previous definition
../../common/cqtmfc.cpp: In function 'void AfxGetFileTitle(const CHAR*, CHAR*, UINT)':
../../common/cqtmfc.cpp:291: error: unknown escape sequence '\]'
../../common/cqtmfc.cpp: In constructor 'CFrameWnd::CFrameWnd(CWnd*)':
../../common/cqtmfc.cpp:5533: warning: comparison between signed and unsigned integer expressions
../../common/cqtmfc.cpp: In member function 'void CToolBar::SetButtonStyle(int, UINT)':
../../common/cqtmfc.cpp:5911: warning: too few arguments for format
../../common/cqtmfc.cpp: In member function 'BOOL CCmdUI::DoUpdate(CCmdTarget*, BOOL)':
../../common/cqtmfc.cpp:9366: warning: empty body in an if-statement
gmake: *** [cqtmfc.o] Error 1

At line 291 of cqtmfc.cpp (is that your code?), there is this:
Code:
$ echo 291 | ed ../../common/cqtmfc.cpp
217285
   str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

One two many \'s? I don't know what this regex is for, but I changed it to "[/\\]" so it would compile. I don't know what effect this will have. And also, I'm getting a lot of redefinition warnings for MB_CANCELTRYCONTINUE.

Now here's the good news. :) It's still compiling. If this works, you just found a great way to compile Windows MFC code on systems that do support Qt but don't support even Wine. That deserves its own repository.

Aaaaand still compiling libs/famitracker. C++, gotta love it. EDIT: libfamitracker.so.1.0 compiled! :) Onto apps/famitracker.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118218)
I can't help with the overall "stuff" being discussed here (no familiarity with Qt), but quickly read up on QRegExp. But, re:

Code:
str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

The regex in question does look to contain one too many backslashes -- and how that compiled at all for anyone is beyond me (shame on whoever wrote that parser!). The fixed regex in English would read "match the character slash (/) or backslash (\)". If the individual really did mean to say in addition "... or close-bracket (])" then that should have been QRegExp("[/\\\]]")

Also, I urge whoever's writing that code to read this and be aware of the performance hit. It appears QRegExp is really quite awful performance-wise compared to PCRE (or just change the code to just look for '/' or '\' using other means than a regex engine; come on this is easy :P): http://blog.rburchell.com/2011/12/why-i ... nd-so.html
Re: FamiTracker 0.4.1.1 pre-release
by on (#118219)
Apps/famitracker:

Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it
mainwindow.o(.text+0xef): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0xf6): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x13f): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x146): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x16f): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x176): more undefined references to `vtable for MainWindow' follow
collect2: ld returned 1 exit status
gmake: *** [famitracker] Error 1
I love that warning for "dangerous GNU crap". :) I also looked up this "undefined reference to vtable" error, which pulled up this thread. Unfortunately, reordering the object files doesn't seem to have any effect. Same error. But, we're close.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118221)
koitsu wrote:
I can't help with the overall "stuff" being discussed here (no familiarity with Qt), but quickly read up on QRegExp. But, re:

Code:
str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

The regex in question does look to contain one too many backslashes -- and how that compiled at all for anyone is beyond me (shame on whoever wrote that parser!). The fixed regex in English would read "match the character slash (/) or backslash (\)". If the individual really did mean to say in addition "... or close-bracket (])" then that should have been QRegExp("[/\\\]]")

Also, I urge whoever's writing that code to read this and be aware of the performance hit. It appears QRegExp is really quite awful performance-wise compared to PCRE (or just change the code to just look for '/' or '\' using other means than a regex engine; come on this is easy :P): http://blog.rburchell.com/2011/12/why-i ... nd-so.html

Noted. :) Thank you!
Re: FamiTracker 0.4.1.1 pre-release
by on (#118222)
Imperial wrote:
Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it

RL LOL -- that warning is stupid. The glib folks (assuming it's coming from them -- maybe it's coming from the compiler) should be ashamed. stpcpy() is POSIX compliant (specifically POSIX 2008), specifically quoting the FreeBSD man page STANDARDS section:

Quote:
The stpcpy() and stpncpy() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').


stpcpy() returns a pointer to the trailing NULL that was copied into the destination; strcpy() returns a pointer to the start of the beginning of the string copied. If the warning is annoying (and I agree it is), you can accomplish the exact same thing as stpcpy() by using a combination of strcpy() and strrchr() (searching for '\0' in strrchr() -- yes, strrchr(buf, '\0') will work and find the last occurrence of a NULL in buf)).

Quote:
Code:
mainwindow.o(.text+0xef): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'


This error is weird. Notice that it's not saying "undefined reference to `vtable'", it's saying "...to `vtable for MainWindow'", almost if that long string is a symbol name. What's the code in MainWindow's destructor look like, specifically what mentions of vtable does it have? EDIT: Never mind, once I read what a vtable was, I can see how the error in question make sense. It's just that the visual formatting (use of backtick and apostrophe) don't generally jibe well with me when I see them. Note: this is hardcore C++ bullshit and I do not do C++ (this is a great example why. ;-) ). I had no idea what a vtable was until I read this gobbledegook. Way to make programming confusing for virtually no gain. Check out my hate-on! ;)

You might be getting a lot of these warnings/issues as a result of compiler differences between yourself and the author. g++ -v (assuming it's the g++ compiler being used and not clang) would be useful here from both of you, I think.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118226)
The vtable error was caused by this:

Code:
class MainWindow : public QMainWindow
{
    Q_OBJECT

Right there. :) This is my first venture with Qt, as well, but a quick search for Q_OBJECT explained that you have to run this header through moc. So I did this: $ moc4 mainwindow.h -o mainwindow.cc. Then I copied the contents of mainwindow.cc, minus #include "mainwindow.h" and the generated comments, right into mainwindow.cpp. Then $ gmake clean; gmake and there it is. :)

FamiTracker on OpenBSD. Tested with Shiru's after_the_rain.ftm. :)
Re: FamiTracker 0.4.1.1 pre-release
by on (#118227)
koitsu wrote:
Imperial wrote:
Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it

RL LOL -- that warning is stupid. The glib folks (assuming it's coming from them -- maybe it's coming from the compiler) should be ashamed. stpcpy() is POSIX compliant (specifically POSIX 2008), specifically quoting the FreeBSD man page STANDARDS section:

Quote:
The stpcpy() and stpncpy() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').


stpcpy() returns a pointer to the trailing NULL that was copied into the destination; strcpy() returns a pointer to the start of the beginning of the string copied. If the warning is annoying (and I agree it is), you can accomplish the exact same thing as stpcpy() by using a combination of strcpy() and strrchr() (searching for '\0' in strrchr() -- yes, strrchr(buf, '\0') will work and find the last occurrence of a NULL in buf)).

I don't know for sure, but that warning sounds like something from Theo de Raadt. :)

Quote:
Note: this is hardcore C++ bullshit and I do not do C++ (this is a great example why. ;-) ).

Oh I can't stand C++. That was my first language, but when I discovered Kernighan & Ritchie's The C Programming Language, and then Roberto Ierusalimschy's Programming in Lua, which is written in the same style, I never wanted to touch C++ again. It is there, and I accept it, because that's life. :)

Quote:
I had no idea what a vtable was until I read this gobbledegook. Way to make programming confusing for virtually no gain. Check out my hate-on! ;)

What language are you more familiar with, then? Vtables aren't unique to C++, of course, and the concept can be crudely mimicked in C.

Quote:
You might be getting a lot of these warnings/issues as a result of compiler differences between yourself and the author. g++ -v (assuming it's the g++ compiler being used and not clang) would be useful here from both of you, I think.

Good point. For posterity, I was able to build all of this with gcc 4.2.1.
Code:
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd5.3/4.2.1/specs
Target: i386-unknown-openbsd5.3
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719
Re: FamiTracker 0.4.1.1 pre-release
by on (#118230)
koitsu wrote:
I can't help with the overall "stuff" being discussed here (no familiarity with Qt), but quickly read up on QRegExp. But, re:

Code:
str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

The regex in question does look to contain one too many backslashes -- and how that compiled at all for anyone is beyond me (shame on whoever wrote that parser!). The fixed regex in English would read "match the character slash (/) or backslash (\)". If the individual really did mean to say in addition "... or close-bracket (])" then that should have been QRegExp("[/\\\]]")

Also, I urge whoever's writing that code to read this and be aware of the performance hit. It appears QRegExp is really quite awful performance-wise compared to PCRE (or just change the code to just look for '/' or '\' using other means than a regex engine; come on this is easy :P): http://blog.rburchell.com/2011/12/why-i ... nd-so.html


Thanks for the feedback koitsu. Yes, I wrote the parser. Yes it is meant to match both slashes only. It -- strangely -- compiles in Windows Qt. The function in question is only used once during file saving...so the "performance" isn't terribly concerning here.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118231)
Imperial wrote:
The vtable error was caused by this:

Code:
class MainWindow : public QMainWindow
{
    Q_OBJECT

Right there. :) This is my first venture with Qt, as well, but a quick search for Q_OBJECT explained that you have to run this header through moc. So I did this: $ moc4 mainwindow.h -o mainwindow.cc. Then I copied the contents of mainwindow.cc, minus #include "mainwindow.h" and the generated comments, right into mainwindow.cpp. Then $ gmake clean; gmake and there it is. :)

FamiTracker on OpenBSD. Tested with Shiru's after_the_rain.ftm. :)


Ok first of all...FREAK ON! That's ridiculously cool! Thanks for the effort! Could you do me a favor and post your machine stats and your observations on performance? [I take it since you didn't start out with ... meh it compiles but it sounds like excrement ... that you're happy with how it sounds?]

The Q_OBJECT macro should be automatic when doing qmake/make it should just do what it's supposed to do -- no manual intervention required. That's very strange.

I will cross-post to FamiTracker to have jsr update the MFC Fft.h usage of _X and _W.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118238)
cpow wrote:
Ok first of all...FREAK ON! That's ridiculously cool! Thanks for the effort!

You're welcome! :)

Quote:
Could you do me a favor and post your machine stats and your observations on performance? [I take it since you didn't start out with ... meh it compiles but it sounds like excrement ... that you're happy with how it sounds?]
I'm on a 2ish-year-old EeePC so I'm not using a power-house over here. :) It doesn't sound fantastic, but I attributed that to the fact that it's Nintendo music. :P Are you saying there's something I could do in the build process to tweak it?

And here ya go. :)
Code:
$ uname -mrs
OpenBSD 5.3 i386
$ dmesg | grep CPU
cpu0: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu1: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
$ sysctl -a | grep hw.*mem
hw.physmem=1064497152
hw.usermem=1044496384


Quote:
The Q_OBJECT macro should be automatic when doing qmake/make it should just do what it's supposed to do -- no manual intervention required. That's very strange.
I think so, too. I shouldn't have to do anything with generated code, but I did it to make it work.

Quote:
I will cross-post to FamiTracker to have jsr update the MFC Fft.h usage of _X and _W.

That's still weird.

Glad to be of help. :)
Re: FamiTracker 0.4.1.1 pre-release
by on (#118240)
Imperial wrote:
I'm on a 2ish-year-old EeePC so I'm not using a power-house over here. :) It doesn't sound fantastic, but I attributed that to the fact that it's Nintendo music. :P Are you saying there's something I could do in the build process to tweak it?

I am implementing the sound configuration dialog which gives the option to expand the audio buffer and change the sampling rate/size.

Perhaps you could do a quality comparison between a You-Tube video of a FamiTracker song playing and Qt FamiTracker? I'm just not sure what "doesn't sound fantastic means" but I'm very curious. Or...if there's a song that you *know* what it *should* sound like let me know if it *doesn't* sound like that. The reason I ask is because Tepples has had sound quality issues [earlier in this thread]. I am thinking it's partly due to unoptimal drawing routines. [I am emulating GDI/MFC on top of Qt QPainter...]

Quote:
I think so, too. I shouldn't have to do anything with generated code, but I did it to make it work.

Maybe you could try blowing away all generated stuff [debug/, release/, all Makefile*'s] and doing a fresh qmake/make?

Quote:
Quote:
I will cross-post to FamiTracker to have jsr update the MFC Fft.h usage of _X and _W.

That's still weird.

I agree...maybe you can run Fft.cpp through the preprocessor (-E switch?) and see what it is doing to the Fft.h/Complex.h headers it's including?
Re: FamiTracker 0.4.1.1 pre-release
by on (#118258)
@cpow: Better yet, I just used Famitracker to export a sound effect as an NES, then ran it under fceux. There is absolutely a delay in Famitracker which alters the sound. It is longer, choppier, and it feels like, as you said, the rendering or something is getting in the way. In the emulator, it's nice and quick.

As it is, this build of Famitracker lets me compose and gives me a rough idea of the sound, but not an accurate one. That's not a huge problem, as far as I'm concerned, because you should test the sound anyway, unless this could potentially stall/crash the program or damage any data.

And now I'll get to work on rebuilding the program. :)

Edit: Btw, what would it take to add MIDI support?
Re: FamiTracker 0.4.1.1 pre-release
by on (#118260)
Regarding _X:
Quote:
Names starting with a _ are reserved for the "system" (roughly compiler+libc) on all systems. In this particular case, _X happens to be #define:d to 0x40, so compilation fails.


That's why.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118261)
Imperial wrote:
@cpow: Better yet, I just used Famitracker to export a sound effect as an NES, then ran it under fceux. There is absolutely a delay in Famitracker which alters the sound. It is longer, choppier, and it feels like, as you said, the rendering or something is getting in the way. In the emulator, it's nice and quick.

Yeah I am looking into optimizations. Nothing concrete yet.

Imperial wrote:
As it is, this build of Famitracker lets me compose and gives me a rough idea of the sound, but not an accurate one. That's not a huge problem, as far as I'm concerned, because you should test the sound anyway, unless this could potentially stall/crash the program or damage any data.

My general disclaimer is the same as what jsr uses for beta versions. Don't use Qt FamiTracker for anything serious...yet. It is very much a beta beta and there's still some things in it that I know are not quite right [keyboard shortcuts, etc.] but progress is slowly being made. Choppy sound should not crash the program.


Imperial wrote:
And now I'll get to work on rebuilding the program. :)

Edit: Btw, what would it take to add MIDI support?

[/quote]
I just need to find a cross-platformy way to do MIDI, preferably something I can just compile in like SDL. I haven't looked for such a thing but if it exists and you know of it I'll gladly put it on my list.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118262)
Imperial wrote:
Regarding _X:
Quote:
Names starting with a _ are reserved for the "system" (roughly compiler+libc) on all systems. In this particular case, _X happens to be #define:d to 0x40, so compilation fails.


That's why.


Yes but that's slightly strange given the _X is a *member* of a *class*. But #define does what #define does...regardless of scope...oh well. I have posted to FamiTracker forum and we'll just carry on with the change on our side. When you're satisfied with the OpenBSD build would you mind creating a pull request on GitHub for the necessary changes [including this one]?
Re: FamiTracker 0.4.1.1 pre-release
by on (#118263)
Well, C preprocessor does text replacement, and all. :)

And sure, I'll give you a hand here.

Edit: Pull request.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118441)
cpow wrote:
I just need to find a cross-platformy way to do MIDI, preferably something I can just compile in like SDL. I haven't looked for such a thing but if it exists and you know of it I'll gladly put it on my list.


Previously I was on the search for this too, it's been a couple years since I looked but at the time this seemed to be the best I could find: http://portmedia.sourceforge.net/portmidi/
So far I've only used it in Windows though.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118506)
Memblers wrote:
cpow wrote:
I just need to find a cross-platformy way to do MIDI, preferably something I can just compile in like SDL. I haven't looked for such a thing but if it exists and you know of it I'll gladly put it on my list.


Previously I was on the search for this too, it's been a couple years since I looked but at the time this seemed to be the best I could find: http://portmedia.sourceforge.net/portmidi/
So far I've only used it in Windows though.

From portmidi's README_LINUX.txt:
Quote:
README_LINUX.txt for PortMidi
Roger Dannenberg
14 Oct 2009

To make PortMidi, you need cmake and the Java SDK

It might not be a big deal, but then the dependencies would include Qt 4, SDL, wine-dev, cmake, gmake, and Java. Personally, I don't feel that great about needing Java just do MIDI. Since MIDI isn't crucial, you might use PortMidi but make it a completely optional component at build-time. (EDIT:) Granted, of course, those are all things you should probably have installed as a programmer anyway.

I'm just thinking about this in the case of maintaining a BSD port for Nesicide in the future.
Re: FamiTracker 0.4.1.1 pre-release
by on (#118591)
It just occurred to me that Qt and SDL are both available to C4droid. I don't know that it'll be compatible with Qt4 or not, but that'll come up.

So, let me see if I can get FamiTracker on Android, hmm? :)

Edit: It looks like it should compile, but there are a couple of errors similar to those I came across earlier while building on OpenBSD. If it succeeds, I'm really curious how it will look and work, or if it will at all, on Android... And yes, I have those wine headers on my Nexus now.

I emailed the author of C4droid about building FamiTracker and got this quick (and slightly snarky) response:
Quote:
Qt can't be used at the same time with SDL, these input/output systems are independent and incompatible on Android.
P.S. I don't know why someone uses SDL with Qt...
Re: FamiTracker 0.4.1.1 pre-release
by on (#119728)
tepples wrote:
Here's what I have in FT/Wine
Attachment:
FT_Wine_cfg.png

44.1 kHz, 16-bit, 250 ms buffer, high-pass 16 Hz, low-pass -24 dB 12 kHz, 100% volume

By "half speed" I don't mean the pitch was low. I mean it sounds like frames of audio were being repeated, and low pitches were distorted beyond recognition. The slowdown tended to increase when I navigated through menus and dialogs and especially when I alt-tabbed to Firefox to write my testing report. Xfce Task Manager reported fairly high CPU usage.

Yesterday, I got FCEUX audio working in Wine. So it appears Wine audio improved greatly from the version in 10.04 to the version I'm running.

EDIT: cpow's burn-down list


When I was using Linux, I've had similar issue to what you are describing. What I've done was to stop using shitty ALSA and used PulseAudio. If you are already PulseAudio, please tell me your PA configuration. Maybe all that is needed is to change few things? Most likely when I'll see your PA configuration (if you are already using it), I'd be able to tell what's wrong.
Re: FamiTracker 0.4.1.1 pre-release
by on (#119736)
darkhog wrote:
shitty ALSA and used PulseAudio
<snicker>
<laugh>
<guffaw>
<roll on the floor laughing>

Oh man, oh man, do you even realize what you said? That's comedy gold.

PulseAudio is a terrible wrapper around ALSA that marginally less terrible than the previous terrible wrapper around ALSA (dmix). I'd try disabling dmix before I tried enabling that piece of crap.
FamiTracker 0.4.2.3 pre-release
by on (#126978)
I've put out a 32-bit Linux [Ubuntu 12.10] build of Qt FamiTracker here.

Still a 'pre-release' but many things have been getting significantly better with it in recent days, so I figured it's time to try to get some user feedback.

It's based on MFC FamiTracker 0.4.2.

You *should* only need SDL 1.2 to get it up and running. And, since I had to tell tepples I'm sure others might want to know:

Code:
LD_LIBRARY_PATH=. ./famitracker &

Do ^ this where you extract the tarball to start it.