SFML community forums

General => SFML projects => Topic started by: Phanoo on February 13, 2018, 10:46:04 am

Title: FM Composer - A sound & music creation tool
Post by: Phanoo on February 13, 2018, 10:46:04 am
(http://fmcomposer.org/img/icon256.png)
Download link http://fmcomposer.org/download.php (http://fmcomposer.org/download.php)
Main page : http://fmcomposer.org (http://fmcomposer.org)

Hello,

Today I'd like to show you the project I'm working on since a long time : FM Composer. It's a software allowing the user to design their own sound using FM synthesis and create a song with them.
It's made for musician/composers but also for developers, as the musics created with this tool can be integrated in any other app and altered in real-time, allowing for high degree of interactivity (dynamic instrument changes, tempo changes, reverb, sync'ed and evolving music...)


Sound demo and how to design an instrument : https://www.youtube.com/watch?v=AnDzLdit0Ds (https://www.youtube.com/watch?v=AnDzLdit0Ds)

It uses SFML for all input, drawing, events... I only slightly modified the library to get a sharper font rendering and add file drop support on Windows.

You can easily add notes with your (computer) keyboard :
(http://fmcomposer.org/img/song_editor_mini.png)

Instrument creation page. Quite a lot of parameters, but it's all there without submenus for fast editing once you are used to it :
(http://fmcomposer.org/img/instrument_editor_mini.png)

A simple piano roll view, with limited editing features but always fun to have :
(http://fmcomposer.org/img/piano_roll_mini.png)


The sound engine is made from scratch, it's a bit like 80's synths that use FM but in more powerful.
FM Composer is released with a lot of pre-made instruments, covering the whole General MIDI set, so it can import MIDIs without any problem.

Download here if you want to give it a try : http://fmcomposer.org/download.php (http://fmcomposer.org/download.php)

There is a complete documentation with tutorial on the website too :)

Of course the program is free and open-source, see the GitHub : https://github.com/stephanedamo/fmcomposer (https://github.com/stephanedamo/fmcomposer) (probably not the best code, but I'm open for improvements !)
Title: Re: FM Composer - A sound & music creation tool
Post by: Mario on February 13, 2018, 10:57:30 am
Beep. beep, detected someone with too much free time. :D  Sounds (pun intended) awesome, going to give it a spin later.

Edit: There are no project or build files anywhere to be found?
Title: Re: FM Composer - A sound & music creation tool
Post by: eXpl0it3r on February 13, 2018, 11:01:31 am
Wow this is amazing! :)

I'll definitely have to play around with this some more!
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on February 13, 2018, 11:12:41 am
Thanx !

I haven't uploaded the project files, i'll add the .vcproj but i'm not sure if it contains relative or absolute paths

Beep. beep, detected someone with too much free time. :D

Unfortunately I Don't, especially with a full time job, but it can be done, by sleeping less ;D
Title: Re: FM Composer - A sound & music creation tool
Post by: Hapax on February 17, 2018, 04:36:27 pm
Impressive. This is very nice indeed.

My own music stuff is nowhere near this complete or featured so kudos!
Title: Re: FM Composer - A sound & music creation tool
Post by: Tank on February 23, 2018, 09:24:12 am
Awesome!
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on February 23, 2018, 10:18:14 am
Thanks guys !

I just made a little tune with it, it's the first time I use it when I have the inspiration to compose something (I usually launch OpenMPT since it's the tracker I use since 10+ years)
Found two bugs by using it ;D (already corrected in 1.3)

https://www.youtube.com/watch?v=bT__3KI3Lt4 (https://www.youtube.com/watch?v=bT__3KI3Lt4)
Title: Re: FM Composer - A sound & music creation tool
Post by: Mongo13 on March 01, 2018, 09:19:58 pm
Great tool! I will give it a try. I am a music composer of royalty free music and this kind of tools is very inspiring and it seems that it is easy to master.. thank you.

Music Screen composer.
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on April 03, 2018, 04:38:33 pm
Thanks ! Don't hesistate to ask me for any question or feature request :)

I'm very happy with SFML, approx 600 downloads and nobody had any problems running the program on their computer.


One of my users created this mario remix :

https://www.youtube.com/watch?v=N0PHPe-Iogg (https://www.youtube.com/watch?v=N0PHPe-Iogg)

And I did a little cover of this famous boss music from FF8 :

https://www.youtube.com/watch?v=Jy_VsH6hALc (https://www.youtube.com/watch?v=Jy_VsH6hALc)

Title: Re: FM Composer - A sound & music creation tool
Post by: Ceylo on April 10, 2018, 12:17:09 am
Dunno how to tell and I a newbie in music composition/generation but… it just looks (and sounds) awesome!
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on April 19, 2018, 12:04:04 pm
Have you tried it ? It may be a bit confusing if you never user trackers or DAWs, but I think you can rapidly get some results by looking at the existing songs. A good basis would be to look at Dustin Stroh's songs, he shared his source files here : http://fmcomposer.org/resources.php

Apart from that, new features were added : like mutitrack export, high-density screen support, lowered CPU usage... :)

A new song created with FM Composer by another user : QIem2E&list=PLHv0qOxpb31967tQHFbwWplSMPTgd152H[/url]
https://www.youtube.com/watch?v=vRa5-QIem2E&list=PLHv0qOxpb31967tQHFbwWplSMPTgd152H

Enjoy!
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on May 11, 2018, 05:26:53 pm
FM Composer songs can be easily played in any C/C++ software

https://github.com/stephanedamo/fmcomposer/tree/master/src/fmengine (https://github.com/stephanedamo/fmcomposer/tree/master/src/fmengine)

I wrote a short manual on how to use FM Composer's FM engine in your applications.

It should be very easy to integrate into any SDL/SFML/other app.

You basically create an instance of the FM player, tell it to play a .fmcs file, and that's it. The FM engine can render classic stereo 16 bit audio data that is easily sent to a custom SFML audio stream (see https://www.sfml-dev.org/tutorials/2.0/audio-streams.php (https://www.sfml-dev.org/tutorials/2.0/audio-streams.php) )

I'm waiting for the first games that will use this :)
Title: Re: FM Composer - A sound & music creation tool
Post by: eXpl0it3r on May 11, 2018, 05:31:49 pm
That's pretty neat, something I wondered whether it would be easily possible. :)
Title: Re: FM Composer - A sound & music creation tool
Post by: Marukyu on May 15, 2018, 07:37:45 pm
Upon reading the title, this project immediately caught my interest. It looks (and sounds) amazing!

I made a set of modifications to get FM Composer to compile on Linux using CMake (thanks to Phanoo's great efforts for cross-platform compatibility, few changes were needed to port the program!). Feel free to check it out if you're interested: https://github.com/Marukyu/fmcomposer

My fork is still somewhat "quick-and-dirty", being essentially the minimal set of changes to get the program to compile successfully on my machine (possibly even breaking the Windows build in the process), but I hope that some of you will find a use for it anyway. ^^
Title: Re: FM Composer - A sound & music creation tool
Post by: eXpl0it3r on May 15, 2018, 08:02:27 pm
Maybe makr a pull request to get your changes upstream? :)
Title: Re: FM Composer - A sound & music creation tool
Post by: Marukyu on May 15, 2018, 08:21:58 pm
Submitting a pull request sounds good! I think I should first clean up the hacks I introduced though, and verify that I didn't break anything on the Windows build. I wouldn't want to cause the developer too much additional work, after all.
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on May 20, 2018, 03:59:48 am
Aww great work !
I looked at bit at your changes, most of them should be harmless, in fact for some of them it's my fault (like the "struct export export" which is ok in my compiler but bad practice).

Are templates better than defines for things like min/max/clamp ?

The only potentially problematic thing is :
/* avoid slow float denormals + round floats down (needed if program compiled with QIfist option (FISTP) fast int/float conversion) */
+               #ifdef _WIN32
                _control87(_RC_DOWN, _MCW_RC);
+               #endif
 

FM Composer is expected to be compiled with the QIfist flag (probably VC++ specific) that allow to speed up float to int conversions by using faster FISTP assembly calls than the slow ftol() from the C library. This method also rounds floats instead of trucating them down as a collateral effect, thus this _control87 force floats to be rounded down again. There are two possible choices :

- Use default C int/float conversions and remove _control87 like you did, which works but worse performance (would be nice to see how much worse it is, maybe it's acceptable)
- Find some way to do it on Linux. I don't know if some compiler flag exists like MSVC's QiFist, but basically it does something like this for conversion :

int convert(float x)
{
    int n;
    __asm {
        fld x
        fistp n
    }
    return n;
}
Then we'd need to find a way to tell the fpu to round down the floats, like _control87 did.


I'd be happy to try your code and integrate it into the main branch once we've tested it !
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on May 20, 2018, 12:06:42 pm
Can I link your repo in the project's description and on the website ?

Would be nice to have the compiled binary too, to avoid linux users having to build it manually (however i'm not sure how the compatibility works - If you compile on Ubuntu, will the binary be Ubuntu-compatible only?)
Title: Re: FM Composer - A sound & music creation tool
Post by: Marukyu on May 21, 2018, 12:26:03 am
It's very nice to hear that my modifications are appreciated! Feel free to link the forked repository anywhere you'd like, I'd be honored to be mentioned on your website. ^^

The reason I used templates for min/max is because defining macros with those names can break standard library headers that are included afterwards, which is what happened while I was compiling the project. Performance-wise, they should be identical on most modern compilers. I also added explicit min/max macros in fmlib.c to work around a linker issue (undefined references to "min" and "max"), but this might be solvable with a better CMake configuration.

As for _control87, I spent a while looking for a drop-in replacement for Linux, but couldn't find one, so I "temporarily" ifdef'd out the line to see if the program still behaves properly. It appeared to work just fine for me without audio or performance issues, but I'm not enough of a floating point optimization wizard to understand the exact effects this function has on subsequent operations. I'll be sure to let you know and/or update my fork if I stumble upon a cross-platform alternative to this function!

Providing Linux builds that work everywhere is somewhat tricky. Binaries will depend on the exact versions and compiler settings of all dynamically linked libraries (so, to answer your question, yes, Ubuntu builds will pretty much only work on Ubuntu). As a result, applications are usually distributed as packages in an environment where the library versions are predictable (this is what package managers and software repositories do).

There are some ways to work around this issue by bundling binaries and libraries into self-contained packages with tools like AppImage or Snappy, which can be used for universal software distribution on Linux, but my experience with these tools is rather limited. Personally, I'd say that providing source code that compiles successfully on Linux, along with some build instructions, is already a good starting point. :)
Title: Re: FM Composer - A sound & music creation tool
Post by: Phanoo on June 02, 2018, 02:34:45 pm
I successfully merged your work into the master branch, you're now part of the contributors to the project :)

I saw LAME MP3 was disabled by some ifdef conditions, is it because it wasn't possible to compile LAME on your distrib ?