Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a Playback-Track #381

Closed
desperateCoder opened this issue Jun 16, 2016 · 38 comments
Closed

Include a Playback-Track #381

desperateCoder opened this issue Jun 16, 2016 · 38 comments
Assignees
Milestone

Comments

@desperateCoder
Copy link

desperateCoder commented Jun 16, 2016

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

@elpescado
Copy link
Contributor

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.

@desperateCoder
Copy link
Author

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 😋

@thijz
Copy link
Member

thijz commented Jul 12, 2016

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)

@mikotoiii
Copy link
Contributor

mikotoiii commented Jul 12, 2016

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.

@elpescado
Copy link
Contributor

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?

@thijz
Copy link
Member

thijz commented Jul 13, 2016

@elpescado : no it does not

@desperateCoder
Copy link
Author

desperateCoder commented Jul 13, 2016

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.

@elpescado
Copy link
Contributor

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

@mauser
Copy link
Member

mauser commented Jul 23, 2016

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.

@desperateCoder
Copy link
Author

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

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

@mauser mauser added this to the 0.9.8 milestone Aug 18, 2016
@mauser mauser self-assigned this Aug 18, 2016
@mauser
Copy link
Member

mauser commented Sep 11, 2016

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.

@desperateCoder
Copy link
Author

desperateCoder commented Sep 12, 2016

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

@mauser
Copy link
Member

mauser commented Sep 25, 2016

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

@desperateCoder
Copy link
Author

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

@desperateCoder
Copy link
Author

desperateCoder commented Sep 27, 2016

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.

@mauser
Copy link
Member

mauser commented Sep 29, 2016

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..).

@pvint
Copy link
Contributor

pvint commented Sep 30, 2016

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

@desperateCoder
Copy link
Author

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

@mauser
Copy link
Member

mauser commented Oct 23, 2016

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 ;-)

@thijz
Copy link
Member

thijz commented Nov 26, 2016

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

@mauser
Copy link
Member

mauser commented Nov 27, 2016

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.

@thijz
Copy link
Member

thijz commented Dec 9, 2016

ok, got it

@mauser
Copy link
Member

mauser commented Dec 15, 2016

@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

@pvint
Copy link
Contributor

pvint commented Dec 17, 2016

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!

@trebmuh
Copy link
Member

trebmuh commented Feb 27, 2017

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

@mauser
Copy link
Member

mauser commented Feb 27, 2017

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..

@mauser
Copy link
Member

mauser commented Jun 21, 2017

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.

@trebmuh
Copy link
Member

trebmuh commented Mar 30, 2018

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?

@teknikumoy
Copy link

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.

@mauser
Copy link
Member

mauser commented Sep 10, 2018

@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 :)

@trebmuh
Copy link
Member

trebmuh commented Sep 12, 2018

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

@desperateCoder
Copy link
Author

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!

@CYFERIOUS
Copy link

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

@elpescado
Copy link
Contributor

It's available in Hydrogen 1.0.0-beta1.

@CYFERIOUS
Copy link

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

@CYFERIOUS
Copy link

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

thanks

@mauser
Copy link
Member

mauser commented Apr 3, 2020

Hi!

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

@mauser mauser closed this as completed Apr 3, 2020
@desperateCoder
Copy link
Author

Thanks again for implenting @mauser! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants