Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Pitch shift for slots #46

Closed
gurs1kh opened this issue Jun 2, 2016 · 5 comments
Closed

Pitch shift for slots #46

gurs1kh opened this issue Jun 2, 2016 · 5 comments
Labels

Comments

@gurs1kh
Copy link
Contributor

gurs1kh commented Jun 2, 2016

I think it would be a nice feature to implement if you could shift the pitch for an individual slot since I'd like to use the same sound sample for multiple slots, but apply different pitch shifts to each. I would prefer to do this without loading a new sample for each.

@gurs1kh
Copy link
Contributor Author

gurs1kh commented Jun 3, 2016

on a similar note, pitch shifting for patterns as a whole could be a good idea too for shifting the entire pattern's pitch all at once

@adamrenklint
Copy link
Owner

Should already have been possible, but didn't work with re-using layers between slots: fixed this in v0.6

var myKit = bap.kit();
var plong = bap.sample('plong.wav');

myKit.slot('Q').layer(plong);

myKit.slot('W').layer(plong);
myKit.slot('W').pitch = 100;

var myPattern = bap.pattern();
myPattern.channel(1).add(
  ['1.odd.01', '1Q', 96],
  ['1.even.01', '1W', 96]
);

I also added that you can do it for a complete pattern:

var myKit = bap.kit();
var plong = bap.sample('plong.wav');

myKit.slot('Q').layer(plong);
myKit.slot('W').layer(plong);

var myPattern = bap.pattern();
myPattern.channel(1).add(
  ['1.odd.01', '1Q', 96],
  ['1.even.01', '1W', 96]
);

myPattern.pitch = 100;

@gurs1kh
Copy link
Contributor Author

gurs1kh commented Jun 3, 2016

There still seems to be an issue. If I change the overall pitch for the pattern, it works fine (well, for increasing; the decreasing part is being discussed on a different thread). But after increasing the pattern pitch, the slot pitch becomes off. For example, increase the pattern pitch by 1 semitone (about 5.946309435929531) and then increase the slot or sample pitch by 50% and you'll notice that the resulting slot/sample pitch is actually about half a semitone flat of 50%.

@adamrenklint adamrenklint reopened this Jun 3, 2016
@adamrenklint
Copy link
Owner

I'm gonna hold off investigating this until pitching itself is figured out in #45

@adamrenklint
Copy link
Owner

This should be solved in v0.7, which includes the change to make pitch based on semitones, and the bap.pitchByRatio helper

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

No branches or pull requests

2 participants