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

classlib: Pattern.record correctly set header and sample formats #5031

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

elgiano
Copy link
Contributor

@elgiano elgiano commented Jun 20, 2020

Purpose and Motivation

Pattern.record used to simply ignore header and sample formats provided
as arguments.

Issue reproducer:

Pbind().record("test","wav")
// CmdPeriod to stop rec
SoundFile.use("test"){|f| f.headerFormat.postln} // -> "AIFF"

Types of changes

  • Documentation
  • Bug fix
  • Breaking change? I can't say if anyone relied on Patterns ignoring settings provided as arguments... sounds unlikely to me

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

@elgiano elgiano added the comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" label Jun 20, 2020
Copy link
Member

@telephon telephon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is OK to chenge the behaviour. It should be noted in the relsease note though.


var recorder = Recorder(server);
var pattern = if(dur.notNil) { Pfindur(dur, this) } { this };

headerFormat !? { recorder.recHeaderFormat = headerFormat };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for nil isn't necessary, right? When it is nil, it will just use the server's.

So perhaps just:

recorder.recHeaderFormat = headerFormat;
recorder.recSampleFormat = sampleFormat;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I didn't want to explicitly set those parameters as nil. But actually, on second thought, I don't see any reason why we shouldn't, and we save two nil-checks, so I changed it. Thanks!

@elgiano
Copy link
Contributor Author

elgiano commented Jun 20, 2020

Just to be sure: was the current behavior intended? It looked like a bug to me. This is not to say that a change shouldn't be reported in release notes though! I second that :)

Pattern.record used to simply ignore header and sample format provided
as arguments
@elgiano elgiano force-pushed the fix/pattern-record branch from f7a0fdf to 4662c4d Compare June 20, 2020 16:49
@telephon
Copy link
Member

Just to be sure: was the current behavior intended? It looked like a bug to me.

Sure, it is a bug. Certainly under the definition of a bug as something nobody should have been relying on it :).

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @elgiano !

@mossheim mossheim merged commit 442befd into supercollider:develop Aug 13, 2020
@elgiano elgiano deleted the fix/pattern-record branch August 13, 2020 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants