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

Let sample tracks play from any song position #3133

Merged
merged 15 commits into from Jan 5, 2017

Conversation

Projects
None yet
6 participants
@BaraMGB
Contributor

BaraMGB commented Nov 26, 2016

Okay, let's test this. I hope I found a solution that works for all.

@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Nov 26, 2016

Member

So I did some testing:
screenshot from 2016-11-26 12 45 53

It works really nice when I jump the playhead around and there's low CPU usage

Bugs:

  • When resizing the windows the CPU usage goes really high
  • CPU usage also goes high when you have a lot of sample tracks and you zoom in or out
  • When scrolling and resizing windows there are very noticeable clicks in the audio
  • The sync breaks when the playhead mode is set to anything other than to go back to the beginning after stopping (screenshot from 2016-11-26 12 49 15 screenshot from 2016-11-26 12 49 06)
  • It seems that when you actually resize the sample track so it's bigger than it's normal size, the part with no sample plays random parts of previous samples, or even stuff I previewed beforehand. I'll try to make a video later today.
Member

Umcaruje commented Nov 26, 2016

So I did some testing:
screenshot from 2016-11-26 12 45 53

It works really nice when I jump the playhead around and there's low CPU usage

Bugs:

  • When resizing the windows the CPU usage goes really high
  • CPU usage also goes high when you have a lot of sample tracks and you zoom in or out
  • When scrolling and resizing windows there are very noticeable clicks in the audio
  • The sync breaks when the playhead mode is set to anything other than to go back to the beginning after stopping (screenshot from 2016-11-26 12 49 15 screenshot from 2016-11-26 12 49 06)
  • It seems that when you actually resize the sample track so it's bigger than it's normal size, the part with no sample plays random parts of previous samples, or even stuff I previewed beforehand. I'll try to make a video later today.
@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Nov 26, 2016

Member

Here's a video of the weird behaviour: https://youtu.be/Hh9at-DF7hI

Member

Umcaruje commented Nov 26, 2016

Here's a video of the weird behaviour: https://youtu.be/Hh9at-DF7hI

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Nov 29, 2016

Contributor

Click noises on resize and scrolling Song Editor should be fixed now.

Contributor

BaraMGB commented Nov 29, 2016

Click noises on resize and scrolling Song Editor should be fixed now.

@softrabbit

This comment has been minimized.

Show comment
Hide comment
@softrabbit

softrabbit Nov 29, 2016

Member

How well does this cope with time signature and/or tempo automation?

Member

softrabbit commented Nov 29, 2016

How well does this cope with time signature and/or tempo automation?

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Nov 29, 2016

Contributor

How well does this cope with time signature and/or tempo automation?

Sorry, thats not implemented yet. Please let's do the things step by step.

Contributor

BaraMGB commented Nov 29, 2016

How well does this cope with time signature and/or tempo automation?

Sorry, thats not implemented yet. Please let's do the things step by step.

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Dec 11, 2016

Contributor

@Umcaruje the fourth point should be fixed now. You can now looping, change songposition per mouse and per left/right key. mute and unmute the track, solo and unsolo an other track, stop pause playing and all that stuff. It will be synced perfectly ( I hope 😄 )

Contributor

BaraMGB commented Dec 11, 2016

@Umcaruje the fourth point should be fixed now. You can now looping, change songposition per mouse and per left/right key. mute and unmute the track, solo and unsolo an other track, stop pause playing and all that stuff. It will be synced perfectly ( I hope 😄 )

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Dec 11, 2016

Member

Bloody amazing!

Member

zonkmachine commented Dec 11, 2016

Bloody amazing!

@BaraMGB BaraMGB added the in progress label Dec 12, 2016

@tresf

This comment has been minimized.

Show comment
Hide comment
@tresf

tresf Dec 15, 2016

Member

@BaraMGB I'm still getting some pretty bad artifacts if the sample is extended past its length... (white noise, clicks)

untitled

Member

tresf commented Dec 15, 2016

@BaraMGB I'm still getting some pretty bad artifacts if the sample is extended past its length... (white noise, clicks)

untitled

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Dec 15, 2016

Contributor

My plan is to limit the TCO length to sample length. I think this is the simplest way to avoid this.

Contributor

BaraMGB commented Dec 15, 2016

My plan is to limit the TCO length to sample length. I think this is the simplest way to avoid this.

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Dec 15, 2016

Contributor

@tresf okay, I guess I fixed it. Can you test this again?

Contributor

BaraMGB commented Dec 15, 2016

@tresf okay, I guess I fixed it. Can you test this again?

@tresf

This comment has been minimized.

Show comment
Hide comment
@tresf

tresf Dec 16, 2016

Member

artifacts if the sample is extended past its length

[fixed] Can you test this again?

Confirmed, the artifacts are gone.

Member

tresf commented Dec 16, 2016

artifacts if the sample is extended past its length

[fixed] Can you test this again?

Confirmed, the artifacts are gone.

@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Dec 16, 2016

Member

Do any artifacts occur when you add an empty tco, without any sample loaded?

Member

Umcaruje commented Dec 16, 2016

Do any artifacts occur when you add an empty tco, without any sample loaded?

@tresf

This comment has been minimized.

Show comment
Hide comment
@tresf

tresf Dec 16, 2016

Member

Do any artifacts occur when you add an empty tco, without any sample loaded?

None.

screen shot 2016-12-16 at 12 46 30 pm

Member

tresf commented Dec 16, 2016

Do any artifacts occur when you add an empty tco, without any sample loaded?

None.

screen shot 2016-12-16 at 12 46 30 pm

@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Dec 16, 2016

Member

Awesome 👍

Member

Umcaruje commented Dec 16, 2016

Awesome 👍

@tresf

This comment has been minimized.

Show comment
Hide comment
@tresf

tresf Dec 16, 2016

Member

@Umcaruje @BaraMGB @softrabbit I think this is ready to merge. I understand time signature will break this however we have many bugs today with time signature and seeking ahead. I want this in 1.2.0-RC2 so that we get solid usage and feedback on it.

Member

tresf commented Dec 16, 2016

@Umcaruje @BaraMGB @softrabbit I think this is ready to merge. I understand time signature will break this however we have many bugs today with time signature and seeking ahead. I want this in 1.2.0-RC2 so that we get solid usage and feedback on it.

@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Dec 16, 2016

Member

The drawing sequence needs to be simplified so it won't produce such high cpu usage on redraws, though I guess that could be an issue for a seperate PR. I'm going to do some more thorough testing now.

Member

Umcaruje commented Dec 16, 2016

The drawing sequence needs to be simplified so it won't produce such high cpu usage on redraws, though I guess that could be an issue for a seperate PR. I'm going to do some more thorough testing now.

@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Dec 16, 2016

Member

Ok so I found a problem: when you change the time signature to something other than 4/4 visually the sample view breaks. The track seems to sync up properly to the new time signature, but it's off from the drawn waveform. And on 3/4 time signature when you add a blank element it looks like this:
image
And it should be 1 measure long as usual

Member

Umcaruje commented Dec 16, 2016

Ok so I found a problem: when you change the time signature to something other than 4/4 visually the sample view breaks. The track seems to sync up properly to the new time signature, but it's off from the drawn waveform. And on 3/4 time signature when you add a blank element it looks like this:
image
And it should be 1 measure long as usual

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Dec 17, 2016

Contributor

Oh boy, that time signature stuff drives me crazy. I hope my thoughts about that and the resulting calculations are correct. Please test this out. @tresf @Umcaruje

Contributor

BaraMGB commented Dec 17, 2016

Oh boy, that time signature stuff drives me crazy. I hope my thoughts about that and the resulting calculations are correct. Please test this out. @tresf @Umcaruje

@tresf

This comment has been minimized.

Show comment
Hide comment
@tresf

tresf Dec 17, 2016

Member

👍

screen shot 2016-12-17 at 11 22 41 am

Member

tresf commented Dec 17, 2016

👍

screen shot 2016-12-17 at 11 22 41 am

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Dec 17, 2016

Member

Works mighty well. Is it screaming hard to have this work in the Beat/Bassline Sample Track too?

Member

zonkmachine commented Dec 17, 2016

Works mighty well. Is it screaming hard to have this work in the Beat/Bassline Sample Track too?

Show outdated Hide outdated src/tracks/SampleTrack.cpp
Show outdated Hide outdated src/tracks/SampleTrack.cpp
Show outdated Hide outdated src/tracks/SampleTrack.cpp
@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Dec 17, 2016

Member

clicktrack

clicktrack.zip Edit: re-uploaded with correct samples...

OK. I made a test project with two different length click tracks and they sync perfectly. However, every now and then the samples will cut out after the first click on one and sometimes both sides. I haven't seen this on export.

Member

zonkmachine commented Dec 17, 2016

clicktrack

clicktrack.zip Edit: re-uploaded with correct samples...

OK. I made a test project with two different length click tracks and they sync perfectly. However, every now and then the samples will cut out after the first click on one and sometimes both sides. I haven't seen this on export.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Jan 1, 2017

Member

https://github.com/LMMS/lmms/blob/master/src/core/Song.cpp#L262:L274

I thought there was cases in the code where we go one tick ahead (when we're playing) but I can't find any examples of it.

Member

zonkmachine commented Jan 1, 2017

https://github.com/LMMS/lmms/blob/master/src/core/Song.cpp#L262:L274

I thought there was cases in the code where we go one tick ahead (when we're playing) but I can't find any examples of it.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Jan 1, 2017

Member

if the loop goes back to start the first tick is not played

Also, the glitchy tick on loop back, is that the first tick of the next bar before a loop? So the whole audio track is one tick off... but instrument tracks isn't?

Member

zonkmachine commented Jan 1, 2017

if the loop goes back to start the first tick is not played

Also, the glitchy tick on loop back, is that the first tick of the next bar before a loop? So the whole audio track is one tick off... but instrument tracks isn't?

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Jan 2, 2017

Contributor

@zonkmachine the next problem is, this seems to be a timing issue. On my big computer (i7) the loop seems perfect. So on different computers it appears different.

edit: there's something fishy, but I don't see it. 😩

Contributor

BaraMGB commented Jan 2, 2017

@zonkmachine the next problem is, this seems to be a timing issue. On my big computer (i7) the loop seems perfect. So on different computers it appears different.

edit: there's something fishy, but I don't see it. 😩

@BaraMGB

This comment has been minimized.

Show comment
Hide comment
@BaraMGB

BaraMGB Jan 5, 2017

Contributor

@zonkmachine : perhaps this is a stupid idea:
https://github.com/BaraMGB/lmms/blob/sampletrack/src/core/Song.cpp#L341-L344
Here the loopback position emits the signal one tick earlier. Your clicktrack seem okay now. But may be the sampletrack is cut off at the end now ( one tick ) I can't hear and test it. For me it sounds okay.

Contributor

BaraMGB commented Jan 5, 2017

@zonkmachine : perhaps this is a stupid idea:
https://github.com/BaraMGB/lmms/blob/sampletrack/src/core/Song.cpp#L341-L344
Here the loopback position emits the signal one tick earlier. Your clicktrack seem okay now. But may be the sampletrack is cut off at the end now ( one tick ) I can't hear and test it. For me it sounds okay.

Show outdated Hide outdated src/core/Song.cpp
Show outdated Hide outdated src/core/Song.cpp
@Umcaruje

This comment has been minimized.

Show comment
Hide comment
@Umcaruje

Umcaruje Jan 5, 2017

Member

Ok so we went over this PR on Discord and both @BaraMGB and @zonkmachine agree on a merge. I'm going to merge this once Travis is done buidling, and we can make an RC2 🎉

There are a few quirks in the GUI drawing and also one minor bug when looping, and that can be adressed later.

Member

Umcaruje commented Jan 5, 2017

Ok so we went over this PR on Discord and both @BaraMGB and @zonkmachine agree on a merge. I'm going to merge this once Travis is done buidling, and we can make an RC2 🎉

There are a few quirks in the GUI drawing and also one minor bug when looping, and that can be adressed later.

@Umcaruje Umcaruje changed the title from lets Sampletrack play from any song position to Let sample tracks play from any song position Jan 5, 2017

@Umcaruje Umcaruje removed the in progress label Jan 5, 2017

@Umcaruje Umcaruje merged commit 43a77a0 into LMMS:master Jan 5, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

liushuyu added a commit to tonychee7000/lmms that referenced this pull request Jan 10, 2017

Let sample tracks play from any song position (#3133)
* play sampletracks from any song position

* take care of TCO length

* TCOs shouldn't be updated when SE window is resized

* take care of zooming level

* takes care on all song position changes and mute/solo tracks now

* playes the sample only within the buffer limits

* takes care of time signature changes

* some minor code improvements (zapashcanon)

* loopback one tick earlier

* minor code changes

* get rid off clicks by resize and scrolling song editor

* removes playhandle by remove TCO

* minor bugs on manipulating TCOs in Song Editor

* update on add sample by playing

* white spaces 1
@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Jan 17, 2017

Member

@zonkmachine : perhaps this is a stupid idea:
https://github.com/BaraMGB/lmms/blob/sampletrack/src/core/Song.cpp#L341-L344
Here the loopback position emits the signal one tick earlier. Your clicktrack seem okay now. But may be the sampletrack is cut off at the end now ( one tick ) I can't hear and test it. For me it sounds okay.

The glitches are still there but not as prominent. I'm looking into it.

Member

zonkmachine commented Jan 17, 2017

@zonkmachine : perhaps this is a stupid idea:
https://github.com/BaraMGB/lmms/blob/sampletrack/src/core/Song.cpp#L341-L344
Here the loopback position emits the signal one tick earlier. Your clicktrack seem okay now. But may be the sampletrack is cut off at the end now ( one tick ) I can't hear and test it. For me it sounds okay.

The glitches are still there but not as prominent. I'm looking into it.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Jan 24, 2017

Member

So on different computers it appears different.

Apparently libsndfile corrected some buffer overflow error in 1.0.26 and I'm on 1.0.25 so this could be related.

Member

zonkmachine commented Jan 24, 2017

So on different computers it appears different.

Apparently libsndfile corrected some buffer overflow error in 1.0.26 and I'm on 1.0.25 so this could be related.

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