Hydrogen: Include a Playback-Track

Created on 16 Jun 2016  路  38Comments  路  Source: hydrogen-music/hydrogen

As a band member i quite often ran into the problem of having a song without Drums, for which i supposed to create the drum-track.
Due to varying chord progressions and groove-sequences i find it very annoying having a media player running and then start the hydrogen-playback on time, only to see, if my created groove fits the existing track.

I'd love a new feature, where i can just add this existing song as a "Playback-Track", which is automatically seeked and played along synchronously with the Hydrogen-playback, so no matter, where i start the song, the existing track starts right at the same position.

Thank you for your great work so far, i hope, i could clarify, what would make it even better. If you have any questions, just ask. If i only had more time and insight to the codebase, i would try to implement it by myself.

If you decide to implement it, i also could contribute some code, i just don't know where to start by now :(

Best regards
desperateCoder

enhancement

Most helpful comment

Small update: I've pushed some commits to the branch which enable support for resampling and some gui enhancements (small buttons next to the scroll bar to switch between timeline and playback track, edit/mute buttons)

playback

All 38 comments

That sounds like good idea, and it shouldn't be hard to implement (Hydrogen, after all works by playing music samples, albeit a little shorter than whole song).

However this would work only with songs originally recorded with click track - otherwise, if tempo varies slightly, recorded backing track and Hydrogen would go out of sync.

And last notw, you could check whether you couldn't achieve that effect with Jack.

I'd be very happy about this one, especially if it won't take much effort!

In my case my band has recorded it with a metronome, if not, hydrogens high precision drums wouldn't fit in anyway ;)

In fact, i wasn't that lazy, not to google. There are ways to achieve this by using jack or adding a custom instrument, but is this really the usability we want? I'm tired to hear bad opinions of linux' usability, maybe this is a small but important step forward of changing the user experience. Sounds funny, but i really feel to dumb to use jack correctly :yum:

what i usually do is create a new instrument and add the song (in wav or ogg of flac format) to the first layer of that instrument
then create a pattern that triggers this instrument and place it at the beginning of the song
works ok, but sometimes hydrogen can act up when you load such a long sample and you need to play around with the lead/lag to get the first beat of the song in sync with hydrogen
this can be really frustrating and adding a 'play along' track will not automagically fix this
(you need some sort of beat detection mechanism to auto align, but i dont think this is trivial to do)

also there is no guarantee that a track recorded with click will stay in sync, there are various things that can add jitter to the playback (or the recording can be bad to start with, or during wav>ogg conversion or whatever jitter can be added)

one other annoying thing is that you need to use F12 to mute the song (since it is a sample that has been triggered, so it will normally play to the end)

Coming from the Windows side of things, I usually set up Hydrogen to be my
metronome / click track, and do a multi track recording in a program like
Reaper. Any changes i make in hydrogen, i just need to export the wav again
and Reaper will pick up the changes.

I know there's a play on linux script for Reaper, though i've never tried
it, there is a Mac version of Reaper i believe. You might be able to do the
same thing in a program like Audacity, but i've never tried.

what i usually do is create a new instrument and add the song (in wav or ogg of flac format) to the first layer of that instrument

Does this work when you start playback at random position?

@elpescado : no it does not

this can be really frustrating and adding a 'play along' track will not automagically fix this

For me, it doesn't have to be that perfect... Maybe by taking small steps it becomes that perfect one day.

I think that's nice idea. I'd like to work on this feature, but I currently have virtually no time for hobby projects.

Hi,

i've started to play around with this and implemented a small prototype which basically plays a wav files if you're in song mode. The wav file playback acts as it is "global" sample, so you can start playback where you want in the song. At the moment this isn't ready for testing, but i suppose i can provide a preview at the beginning of august.

Wow, that went to reality much faster than expected...

Thank you buddy! Really looking forward to test it! :)

Hi!

You can now have a look at the functionality by using the "playbackTrack" branch in our repository. It previews only the basics, so you can add an playback track (which currently hides the timeline) and enable/disable it. The playback track is not scaled properly to the song editor squares and it doesn't support resampling yet.

Thank you so much @mauser! I will try it as soon as possible, maybe this evening.

Small update: I've pushed some commits to the branch which enable support for resampling and some gui enhancements (small buttons next to the scroll bar to switch between timeline and playback track, edit/mute buttons)

playback

Dear @mauser,
first of all: good job! This is exactly, what i needed!

Sorry for answering that late, had a busy time these days...

As i was testing, i noticed, that MP3 files won't be played. as i saw in the screenshot, you were using FLAC, wich worked nice, after i converted my file. Did i do something wrong, or is this caused by the proprietarity of the MP3-sources?

Additionally, i didn't see the Edit-button i saw in your screenshot, as well as the wave-visualization (or what ever it is called) with the filename on it in the BPM-bar. Did i clone an older revision?

But again, thank you so much, this already makes it so much easier for me!

Best Regards!
desperateCoder

As I played around, i got a memory access error:
http://pastebin.com/wyLBj4ru

Steps to reproduce:

Open hydrogen-dev: sudo ./build.sh x
open an existing project
select playback track
select song mode
toggle playback track
click play, then pause. (so far everything is fine)
now close the application (click X)
reopen: sudo ./build.sh x (just opened project will be reopened)
click play

This is the point, the mentioned error occurred. Hydrogen closes immediately.

Maybe this is because of the evidently old source i cloned, but maybe i should tell you.

Hi!

Thanks for the feedback! The mp3-problem is caused by libsndfile, which is the library that we're using to load samples. You can read about its mp3 limitation here.

To see the wav visualization, you have to switch to the view of the timeline panel (or whatever this will be called..). This can be done with the small "P" and "T" icons next to the scroll bar. Clicking "P" switches to the playback track view (wav visualization). Clicking "T" switches back to the timeline.

Those are just shortcuts, there will be an appropriate "View" menu in 0.9.8 to handle this task.

About the crash: I could not reproduce your problem, but i haven't tested it a lot and there are for sure some unhandled/undecided cases.

My next step would be to add a volume slider or rotary to the track item and to scale the wave display properly (at least if timeline is disabled..).

This is going to be very useful!
I haven't had a chance to try it yet, but I will love this. Thanks!

Hi @mauser,
Just tested it again a little, no crashes so far, and thanks for the "P" / "T" hint! Works nicely!

Good to hear, you invest way more effort in this, than i actually requested, as it seems, i am not the only one, who has a use for this feature.

I am looking forward to see, where this is leading. Hopefully it makes its way into HEAD and will be delivered by the repos of my distro (LMDE).

You sir have deserved a good "fr盲nkisches Bier", i'd love to send you one ;3

Greetings
desperateCoder

Hi @desperateCoder !

Thanks for your kind words! Hopefully this will be finished and polished until the end of this year and ready for a merge.

About the beer: Just mention it if you're around Paderborn the next time, then we can share one or more beers ;-)

what is the relationship between the displayed wav form and the hydrogen timeline ?
when i zoom in/out on the song editor the displayed wav does not follow the 'zoom level'

otherwise i really like this feature !!

maybe the 'T' / 'P' buttons can be placed next to the edit/mute buttons iso at the bottom of the song editor, like this :

image

Hi @thijz ,

There is no relationship current, this feature is work in progress. This was what i meant with "the playback track is not scaled properly".

About the button placement: The space left of the edit button was intended to hold the volume control fader or rotary for the playback track.

ok, got it

@thijz : The attached screenshot should give you a better idea of the playback track user interface.. (not yet pushed to the playback track branch)

bildschirmfoto zu 2016-12-15_23-10-28

Looks good!
A few times before I have made a drum track, and then used it when playing guitar - get the rhythm down and then add some extras..... then I find that I have deviated from the groove of the drum track. It'll be nice to be able to play the guitar on its own while building the drum track!

The interface looks good - not too crowded and not using up too much real estate. Nice!

@mauser : is there anything preventing this (really nice) feature to be merged into master? Can I help in some ways to achieve so?

I don't think that it is really ready yet, the wave-form is still scaled incorrectly, it has no relation to the squares of the song editor. I'm currently working on other things, like OSC support.

Testing is always very much appreciated :) Especially with different sound formats and maybe also with large files..

Hi,

the feature has been merged with the master branch. There is still some work to be done on the visualization of the playback track, but it should be ready for some more testing.

This new feature/enhancement is very very helpful. Nice job done here people!

As an improvement, I'd like to suggest something. When the playback track is shown, then we're not seeing the playback-cursor anymore and one has to hide the playback track to see where the playback-cursor is currently is:

h2-playback-track-1

h2-playback-track-2

Here is a quick mockup of how it could be more visually useful:

h2-playback-track-3

Even better would be to allow showing the bar number as well. Adding a refinement with a long line for better reading on this quick mockup:

h2-playback-track-4

Edit:

  • Note that I do understand that the waveform should scale appropriately for this enhancement to be useful.
  • what about renaming its "Edit" button to "Load" since this is what it is actually doing?

Ubuntu 16.04 LTS.
I compiled# hydrogen --version. Hydrogen 1.0.0-beta1.
Src: git clone git://github.com/hydrogen-music/hydrogen.git

Could you help me how to add playback track. I don't find any options in menu.

@teknikumoy : Currently ou have to press the small "P" button which is located below the song editor (the thing with those squares...). And yes, there will be a menu entry in the future :)

The more I think of this feature, the more I think this is a very big empowerment of H2!

The more I think of this feature, the more I think this is a very big empowerment of H2!

@trebmuh didn't imagine such a response to my request. Big thanks to the developers and the community for your support! I use this feature quite often for my band stuff and it works great!

how can i install this feature in my h2? thanks amazing!!!!

It's available in Hydrogen 1.0.0-beta1.

It's available in Hydrogen 1.0.0-beta1.

im rookie in linux, there is a clue how to install it easy, im trying to build the .deb, but it appears to have problems with QT.

thanks

well i have test this feature in windows and i think is amazing...!!! im checking how to run it on ubuntu 18.04

thanks

Hi!

I'm closing this issue now since the feature is implemented and the outstanding issues are documented in other GitHub issues.

Thanks again for implenting @mauser! 馃榿

Was this page helpful?
0 / 5 - 0 ratings