HavenTune - Play musics, hands free

Forum for alternative clients, mods & discussions on the same.

HavenTune - Play musics, hands free

Postby kirion » Sat Feb 23, 2019 1:15 am

(first of all, pardon my potentially poor english)

Instruments are cool, but if you're anything like me, you suck at playing them and would rather compose music and let the game play it for you.
I recently felt like doing something about that, and so HavenTune(tm) was born.

Download : https://drive.google.com/file/d/1NtLArt ... sp=sharing
Current version : 1.3.3

HavenTune is currently rather simple and while I like it that way, a proper UI might still come in the future. For those interested, the download come with the sources (made in C# 4.7.2, VS2017)

Operation is easy :

1. In game, you put the instrument in your hands and open the musical keyboard by right-clicking the instrument;
2. You put a song file in the 'songs' folder, if it's not already there;
3. You run or refresh HavenTune;
4. You select the letter assigned to the song to start it;
5. You alt-tab to Haven;
6. Enjoy! Music should be playing. To stop or pause it, you alt-tab out of haven.

Please note that HavenTune does NOT actually interface with the game. All it does is simulate keypresses, simple as that. It CANNOT know if you have the musical keyboard opened or not ingame.

Current potential bug(s) :
- HavenTune check for a window title that contains "Hafen Client" or "Haven and Hearth". I'm not sure if every client out there has that string in it. Please comment about it and I will adjust.
- Due to an oversight, there can't be more than 9 songs listed. Will fix asap. It now use the alphabet, so there can be up to 26 songs.

How to write songs :
- Song-making isn't complicated. You simply have to make a '.txt' file in the songs folder (create it if it isn't already), and write a command for each lines. Here is an example song :


The only special line is the first one; it describe, in milliseconds, the delay between commands. Without it, the game would have some difficulty catching up with the song.
Other commands are :

1. The actual Notes, marked by a letter. (like c, b, j, etc), followed by an amount of time (in milliseconds) to hold the note;
2. "wait" followed by an amount of time to wait;
3. "shift" or "ctrl", followed by either "hold" or "release";

And that's all. The application will validate errors before attempting to play it, so test away!

If you enjoy HavenTune and manage to make cool songs, post here and i'll see to it that it is added into the default list of songs :D
Last edited by kirion on Tue Mar 24, 2020 8:28 pm, edited 1 time in total.
User avatar
Posts: 190
Joined: Sat Jul 31, 2010 11:45 pm

Re: HavenTune - Play musics, hands free

Postby Xcommand » Mon Feb 25, 2019 4:40 pm

This is pretty awesome, but for now I think it's not so user-friendly in case someone will try to add their own songs.
I remember playing LOTRO and there was native .abc format support.
Yes, It was still not so good experience to create your own songs, but many people including myself managed to use .3gp (guitar pro) format and .midi that is easily transfered to .abc and was playable in a game (afaik Starbound uses same .abc format to play songs on musical instruments).
LOTRO was limited to 3 octaves upon pressing shift and CTRL, and to have a really nice song, you still had to edit midi file, to crop or move too high or too low notes to match these octaves.
And for every instruments you had either to make separate tracks from this songs, or to squeze all notes to one track.
I personally waited for tool like yours to automate playing process, and I really love that someone managed to do this even with simulating keypresses within HaH.
In my spare time I will try to write my own songs within your limitation, or by making something like .abc->.txt converter.
Anyway keep up the good work. You made my hearthling smile ;)
User avatar
Posts: 28
Joined: Sun Aug 01, 2010 7:21 pm

Re: HavenTune - Play musics, hands free

Postby Hrenli » Mon Feb 25, 2019 5:08 pm

Nice work. Was considering writing similar myself, actually. Would be nice to have a support of abc though, as mentioned.

But what would be really nice is if transcribed music was supported by the server and we could write notes in a similar way we make paintings and then you could play it solo or together and it would be synchronized locally. Right now all the notes are sent as separate commands to the server and timing between the notes is often lost forever... I am pretty sure there is already a thread about it in C&I. But that has nothing to do with your tool anyway.

Thanks for sharing!
Too old to rock-n-roll, too young to die.
Posts: 1160
Joined: Mon Mar 21, 2016 1:39 pm

Re: HavenTune - Play musics, hands free

Postby AlexWanderer » Thu Feb 28, 2019 11:52 am

I follow the instructions but it doesnt work =(
Posts: 4
Joined: Mon Nov 25, 2013 1:17 pm

Re: HavenTune - Play musics, hands free

Postby foomanchu » Wed Mar 13, 2019 1:44 pm

looks good
always a fan of when people work on music stuff in this game

if you want to take it to the next level, maybe consider adding in a midi parser. i understand that you want to be creative and compose your own songs but at the same time, some of these songs translate really well into haven and are really enjoyable to listen to.

https://youtu.be/chPMRGEWvvU Zelda Dungeon Music
https://youtu.be/EXcCG_m29oU Legacy Cabin Music
https://youtu.be/SY3BkHr6pFY Legacy Fishing Music
https://youtu.be/E7msFWEjtFc Zelda Song of Storms (<- if you're curious about the gui)
https://youtu.be/mppccs2Rt3g Duo FF4 Cid Theme
https://youtu.be/B_Nq9qjLtD4 Duo FF4 World Theme
https://youtu.be/G8aVojxa6mU Duo Zelda 1 Dungeon
Last edited by foomanchu on Fri Apr 12, 2019 2:55 am, edited 1 time in total.
Posts: 119
Joined: Wed Jun 29, 2011 6:13 am

Re: HavenTune - Play musics, hands free

Postby DamJNeT » Tue Apr 02, 2019 6:08 pm

Foomanchu, what are you usign to do this ? xD
Posts: 408
Joined: Fri Jul 01, 2011 12:21 pm
Location: Worldwide

Re: HavenTune - Play musics, hands free

Postby foomanchu » Wed Apr 03, 2019 12:23 pm

DamJNeT wrote:Foomanchu, what are you usign to do this ? xD

midi files with a midi parser and key presser in the client
i also had to build various tools to let me test channel by channel, increase/decrease tempo, adjust the scale/octaves, assign specific instruments to specific channels to allow more than one client playing at a time and record/read these various settings on startup
it took many many hours to figure this all out and vet hundreds of songs one by one
Posts: 119
Joined: Wed Jun 29, 2011 6:13 am

Re: HavenTune - Play musics, hands free

Postby Irgat35 » Fri Apr 12, 2019 10:39 am

I dont know are you still here. But I really like your haventune. And preparing some musics for it. Can I share txt files here for everbody?
Posts: 27
Joined: Sat Mar 23, 2019 10:01 pm

Re: HavenTune - Play musics, hands free

Postby Irgat35 » Fri Apr 12, 2019 12:43 pm

Posts: 27
Joined: Sat Mar 23, 2019 10:01 pm

Re: HavenTune - Play musics, hands free

Postby Mikhos » Sat Jun 29, 2019 1:56 am

Thanks for this! I wish I was smart enough to make my own songs for this
User avatar
Posts: 9
Joined: Sun Nov 27, 2011 9:52 pm


Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 2 guests