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

Recording always gets trimmed to 4 beats #613

Closed
deviant-syndrome opened this issue Oct 12, 2022 · 2 comments
Closed

Recording always gets trimmed to 4 beats #613

deviant-syndrome opened this issue Oct 12, 2022 · 2 comments
Assignees
Milestone

Comments

@deviant-syndrome
Copy link

deviant-syndrome commented Oct 12, 2022

Environment

  • OS: MacOS Catalina 10.15.7
  • Giada version: 0.23.0

Describe the bug
I cannot record sound for longer than initial sequence size (4beats) at a given tempo. Loop length seems to be correct (same as sequence length), but recorded sound always gets trimmed after first 4 beats

To Reproduce
Steps to reproduce the behavior:

  1. Start application
  2. Add new sample channel A
  3. Load a sample into channel A
  4. Set new tempo
  5. Put channel A into loop mode
  6. Set the sequence length to 1 bar of 16 beats
  7. Add new sample channel B
  8. Arm channel B for recording
  9. Start recording
  10. Stop recording
  11. Put channel B into basic loop mode
  12. Disarm channel B recording
  13. The recorded sound gets trimmed after 4 beats

Expected behavior
I would like the loop sample to play the recorded sound, which duration corresponds to the length of the sequence (e.g. 16 beas of 1 bar)

Technical information
The offending lines seem to be here:

	const Frame framesToCopy = -1; // copy everything
	const Frame srcOffset    = 0;
	const Frame destOffset   = inputTracker % maxFrames; // loop over at maxFrames

	recBuf.sum(inBuf, framesToCopy, srcOffset, destOffset, inVol);

Seems like maxFrames is passed or set incorrectly somewhere up the stack. If I remove wrapping with % it works.

Further exploration, led me to conclusion, that this happens, because, changing the number of beats/bars does not call Engine::updateMixerModel(), which updates maxFramesToRec.

I'll try to create a pull request soon.

@gvnnz
Copy link
Contributor

gvnnz commented Nov 9, 2022

Hi @deviant-syndrome , thanks for the report and sorry for the annoying delay. I'll look into it very soon. Feel free to go ahead with your PR in the meantime.

@gvnnz gvnnz added this to the 0.23 milestone Nov 9, 2022
@gvnnz
Copy link
Contributor

gvnnz commented Nov 20, 2022

Fixed in 667482d. @deviant-syndrome feel free re-open it otherwise.

@gvnnz gvnnz closed this as completed Nov 20, 2022
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

2 participants