add freq support to sampler
This commit is contained in:
parent
8b22c2e04f
commit
df73ce8a60
5 changed files with 43 additions and 8 deletions
|
|
@ -10,6 +10,7 @@ import {
|
|||
tokenizeNote,
|
||||
toMidi,
|
||||
fromMidi,
|
||||
freqToMidi,
|
||||
_mod,
|
||||
compose,
|
||||
getFrequency,
|
||||
|
|
@ -94,6 +95,12 @@ describe('fromMidi', () => {
|
|||
expect(fromMidi(57)).toEqual(220);
|
||||
});
|
||||
});
|
||||
describe('freqToMidi', () => {
|
||||
it('should turn frequency into midi', () => {
|
||||
expect(freqToMidi(440)).toEqual(69);
|
||||
expect(freqToMidi(220)).toEqual(57);
|
||||
});
|
||||
});
|
||||
describe('getFrequency', () => {
|
||||
const happify = (val, context = {}) => pure(val).firstCycle()[0].setContext(context);
|
||||
it('should turn note into frequency', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue