hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.06k stars 173 forks source link

Please add non-session-manager support #32

Closed grammoboy2 closed 10 years ago

grammoboy2 commented 12 years ago

Hi,

Could you please add non-session-manager (NSM) support? It is the best session manager on GNU/Linux, I tried JackSession, but NSM is more user friendly and the API is smarter and better documented. Ladish is less minimal and NSM is better imho.

http://linuxmusicians.com/viewtopic.php?f=19&t=7986&p=25766#p25766

http://non.tuxfamily.org/nsm/ http://non.tuxfamily.org/nsm/API

You find C++ example wrapper in this yoshimi patch: http://non.tuxfamily.org/nsm/yoshimi-nsm.patch

A C example wrapper you'll find in the non-daw code (nsm.h) git://git.tuxfamily.org/gitroot/non/daw.git

Support via non mailinglist or #non @ Freenode

mauser commented 12 years ago

Hi,

we're always accepting patches. I can't speak for the others devs of hydrogen, but i for myself have decided to put no more effort at this moment in the support of session managers. Since some years, it seems that every now and then some new one pops out which is of course much better then anything before :)

grammoboy2 commented 12 years ago

On 07/21/2012 01:59 PM, Sebastian Moors wrote:

Hi,

we're always accepting patches. I can't speak for the others devs of hydrogen, but i for myself have decided to put no more effort at this moment in the support of session managers. Since some years, it seems that every now and then some new one pops out which is of course much better then anything before :)


Reply to this email directly or view it on GitHub: https://github.com/hydrogen-music/hydrogen/issues/32#issuecomment-7152262

I understand your sentiment very well, but you exaggerate a bit here....

At the moment there are three, JackSession seems to be more or less dead and it has drawbacks in usability.

Ladish has disadvantages to, it depends on jackdbus for instance. Also, Ladish will support NSM!

NSM has all a session-manager should have imo. I mean there are good arguments why this thing works and will work in the future, and LASH not for instance.

Also NSM has not the limitations JackSession has, it's reasonable to think that this thing can last for at least 10 years.

Also it's not likely that someone steps up and make another session API. All the LAD devs who where interested in session management spoke out, has build one, supports one or leaved.

It would be nice if you explored this a bit, you can't ask from a dev who made the API to apply all the patches. Devs of the apps should do.

\r

mauser commented 12 years ago

I'm asking no one to apply any patches.. i've just offered to apply any patches/pull requests towards session management that reach us. In addition i'm willing to help anyone who has interest in this topic. That's all I can do at the moment.

wolkstein commented 12 years ago

imo, the best would be if each jack supporting sound application can handle all available (jack) session managements. a nice dream:). i think linux user are so different (diverse) with there preferences in which way theirs own created lovely and best linux sound machine have to work. imo, this make it difficult to talk about better or inferiority session management systems. i really love exactly this diversity because the high level of released creativity.

for example my favorite session management is "jack session". for me it is easy to use because qjackctl which is my personal main/base application can handle exactly this session manager. qjackctl is the first application which i start and the last one which i closed. simple this fact make jack session perfect for me. nothing more and nothing less:). i use my laptop mostly on different places with different soundcards. sometimes i connect a usb card if the laptop is already runnig. sometimes i connect a card at first before i power on the laptop. sometimes i connect two soundcards and combine them with alsa_in and alsa_out. for all this cases i use the qjackctl preferences dialog for easy finding cards and setup this cards. for sure, many other people found theirs own better ways o setup a mobile linux sound box on start up. and also they have a good reason to use an other session manager because it is on their way. perfect:).

ohh i forgot totally to bring up, because this fact i implement jack session management in hydrogen. and now i am in gleeful anticipation that people who love "nsm" write a patch for hydrogen which we can apply:).

lg wolke

xjjx commented 10 years ago

You can still use nsm-proxy for start/stop hydrogen with jackpatch to store settings and then control h2 via MIDI.

rhetr commented 10 years ago

here is an article by harryhaaren about implementing NSM: http://openavproductions.com/implementing-nsm/

ViktorNova commented 10 years ago

Has anyone gotten Hydrogen to work well with NSM, whether by modifying Hydrogen itself or by a specific NSM configuration?

I have ALMOST gotten it to work perfectly, by enabling LASH on Hydrogen, having the song file inside the nsm-proxy folder for that session, and having Hydrogen sens SIGUSR1 to save. It works perfect on very small Hydrogen songs, even works well when copying sessions. But on larger songs (anything above around 114k on my machine) the saved file gets truncated and becomes unusable when the NSM session is closed or changed https://github.com/original-male/non/issues/99

So I turned off LASH support in Hydrogen to avoid the corrupted files, which results in a stable setup, but no automatic saving, and copying sessions seems to not work now.

Anybody have a good way to do this? =D

mauser commented 10 years ago

Hi!

Could you please create a new ticket for the corruption problem? Maybe even upload the problematic song somewhere?

thijz commented 10 years ago

adding emails from Harry (and me) about NSM support for Hydrogen (Harry offered his help, but there was no response form the hydrogen dev side)


Hey *,

As you may have seen, I've recently offered to help various projects support the NSM session manager. Thijs has approached me, and shown interest in adding NSM to Hydrogen.

I've just built Hydrogen from git, and am grepping the source to get to into it: The NSM support should be in Core (since cli / gui usage shouldn't matter to session management).

It looks like the AudioOutput base class will need some way to set the JACK client name, and that the Open / Save routines need to be called from the NSM open/save callbacks instead of GUI triggered. That's all there is to it really. Some details of course, but that's the idea.

The cli / gui have seperate main() functions (i see the LASH / jack_session stuff implemented twice). I'll assume that's the way to go for NSM too.

On startup we check for NSM_URL, and if active we should grey out Open/Save (since this is a session, we know where to open from & save to). We need the actual invocation name of the program (so NSM can launch Hydrogen when starting a session), which we can grab from argv[0].

Then AudioEngine::create_instance() is called from audioengine_init(), which we would need to pass the NSM JACK client name etc to. I'd value the opinion of somebody more experienced with the codebase here: how can we best move some info to where we instantiate JACK and load a session file into hydrogen.

Finally, a callback is needed to check if there are pending OSC messages. Best is to set this up in main, and then wait until we are told to load a session.

I look forward to your advice and opinions! Cheers, -Harry

OpenAV Productions www.openavproductions.com


Thijs van severen thijsvanseveren@gmail.com 15 mei

aan hydro Hi All, Harry

If anyone is interested in helping out with this: now is a good time to step forward.

I know that there have been many discussions about session management tools and pros and cons and ... etc etc, but it seems like NSM is becoming the de facto session management system in linux. On the other hand LV2 plugins are gaining popularity allowing the host application to handle 'session management' (well sort of)

However, since Hydrogen is a stand alone app and it is impossible to turn it into a LV2 plugin (see previous discussions) a good session management system is the only way to use Hydrogen in conjunction with other audio apps in an efficient way.

Harry is offering us help to implement this frequently requested feature, i think we should take it I only i had some programming skills :-(

Hope to hear from you soon !

Grtz Thijs


Harry van Haaren harryhaaren@gmail.com via lists.sourceforge.net 26 mei

aan hydrogen-devel Hey All,

Update: -NSM code is in place, callbacks are registered. -MainForm::openSongFile() is used to open a song based on NSM's request: it was made a public to allow opening a song from a filename directly (instead of trough the File->Open() dialog, which would prompt etc)

Problems: I've manually saved a "Untitled Song.h2song" in the NSM dir (so it should load on NSM start), but Hydrogen gives an error, saying: "(E) SongReader::readSong Error reading song: song node not found" The XML has ... in there though, so I'm guessing either A) I can't use the openSongFile() interface B) I'm not instantiating the Engine (or part thereof) soon enough, so its throwing errors.

I'd love some feedback on this: its a lot more work for me to figure out than somebody familiar with the code to say :)

Finally I need to manually set the JACK client name : should this be done using JACK_SESSION's setJackSessionUUID() call, or just create a new one for setNsmJackClientName() or similar?

Hackingly yours, -Harry

grammoboy2 commented 10 years ago

Thanks for your work! Wha! You would expect a quick response from the dev team, cause NSM makes Hydrogen such a more useful application on Linux. Moreover, I even don't use it because the lack of NSM support, then I prefer a plugin in Carla instead. Hydrogen is a modular app and I think the devs should do whatever it takes to let it function well in a modular ecosystem, that means proper session management, that means NSM these days.

Kind regards, \r

ViktorNova commented 10 years ago

I'm still using Hydrogen with NSM as-is via nsm-proxy every day without issue, although proper NSM support would be great

Here's my nsm-proxy script

executable
    nohup hydrogen
arguments
    --nosplash --song ./drumMachine.h2song
save signal
    10
stop signal
    15
label
    Hydrogen

..of course drumMachine.h2song has to be manually copied into the NSM Proxy.nXXXX directory in order for it to work, but once that's done you can duplicate the session and use it as a template. Not ideal, but it at least works for now! =D only other thing with that setup is I always save via NSM, then close Hydrogen, then abort the session, otherwise the .h2song will possibly get truncated/corrupted as mentioned above.. I will do my best to submit a separate issue about that corruption issue with a song file this weekend

grammoboy2 commented 10 years ago

Why would I use nsm-proxy, if some devs did already work on nsm? Nsm-proxy is a workaround for this case, which makes life a little bit better, but I wouldn't call this userfriendly.

ViktorNova commented 10 years ago

definitely not user the most user-friendly approach - I only mentioned nsm-proxy cause it allows Hydrogen and NSM to play together right now, of course we need true NSM support!

It is exciting that there is ground work being done on it, sounds like Harry is making some good progress! I didn't see his fork on Github though, sounds like maybe he's hacking away on his own..I'd be really insterested to see what he's been up to and try help out

Can we get an officially sanctioned new branch of Hydrogen to work on NSM support out in the open? Seems like a good first step! =D

mauser commented 10 years ago

@johnsen : Please note that hydrogen is not a modular app. At least it was never intended to be modular ;-) We have a sampler, sequencer, mixer, sample editor and more in one application. Earlier versions of hydrogen came even with built-in effects. It is definitely not a "stripped to one task" tool which was written to behave well in a modular environment. This comment might be little bit off topic, but i couldn't resist to let this unanswered ;-)

mauser commented 10 years ago

Master branch has now basic nsm capabilities. It would be great to get some feedback since i'm not really an nsm user...

ViktorNova commented 10 years ago

Oh wow! That's amazing, I will start pounding on it immediately

ViktorNova commented 10 years ago

I'm kind of amazed, excellent work! New projects, loading, cloning, saving Hydrogen with the whole session or as a single client all work great. I did find a bug, but I will submit it as it's own issue since I believe this one can now be closed at long last =D https://github.com/hydrogen-music/hydrogen/issues/199

Hydrogen supports NSM! Woohoo! Awesome job.

mauser commented 10 years ago

Thanks for the kind words! I will close this issue now, everything that is not working yet is new issue :)