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

Implement retunable primes #63

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Implement retunable primes #63

wants to merge 15 commits into from

Conversation

euwbah
Copy link

@euwbah euwbah commented Aug 8, 2022

Implements #62 using the following syntax:

(primes: <a> <b> <c> ...)

Where a b c ... are interval tunings of consecutive primes 2/1, 3/1, 5/1, 7/1, 11/1, etc...

The example below will play

  • 2*2 / 2*2: rootHz
  • 5 / 2*2: 51 steps of 22 edo above rootHz, minus (2/1) x (2/1) = 7 steps of 22 edo (down major third)
  • 3*2 / 2*2: 1900c above rootHz plus (2/1) minus (2/1)x(2/1) = 700c (7 steps of 12 edo perfect fifth)
  • 7 / 2*2: 87 steps of 31 edo above rootHz, minus 4/1 = 25 steps of 31 edo (augmented 6th)
(primes: 2/1 1900c 51\22 87\31) 4:5:6:7

the primes: token is implemented as a Setter under the type SetPrimes, so it can be chained together with other setters in a SetterGroup, e.g. (primes: 12\12 19\12 28\12 34\12; osc:square8) 4:5:6:7

More examples and details are written in the 'info' tab. A simple parsing test was added to grammar.test.ts under 'should parse sequence with primes tuning setter'.

Additional fixes:

  • Fix invalid ratios causing browser freeze
  • Improve generalized pitchDegreeWrap and ratioWrap calculations

@euwbah euwbah changed the title Add build instruction to README Implement retunable primes #62 Aug 9, 2022
@euwbah euwbah changed the title Implement retunable primes #62 Implement retunable primes Aug 9, 2022
@euwbah
Copy link
Author

euwbah commented Aug 13, 2022

Tested & ready for review @dxinteractive

@dxinteractive
Copy link
Owner

Hey @euwbah - I'm so sorry I missed this for so long! Thank you for putting all this effort in, including basic housekeeping that I haven't got around to. I'll review and leave some comments, but for the most part it looks great!

Install npm and yarn first.

```bash
yarn lerna init
Copy link
Owner

Choose a reason for hiding this comment

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

Thank you for including these! Apologies for not having build instructions - I didn't originally intend for this to be an open source project so I'm been slack on that front. My hidden intent is that yarn prep should execute everything required to prepare the project - if you could wrap these build steps up inside of yarn prep that would be fantastic.

yarn lerna run build

# serve webapp
serve -s packages/xenpaper-app/build
Copy link
Owner

Choose a reason for hiding this comment

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

I might suggest cd packages/xenpaper-app && yarn start, as it'll spin up a local dev environment with hot relaoding courtesy of create react app. Even better a "start": "yarn lerna run start", would be even better - the developer-facing command would then become yarn start.


export const Setter = Any(SetBpm, SetBms, SetSubdivision, SetOsc, SetEnv, SetRuler);
export const Setter = Any(SetBpm, SetBms, SetSubdivision, SetOsc, SetEnv, SetRuler, SetPrimes);
Copy link
Owner

@dxinteractive dxinteractive Nov 6, 2022

Choose a reason for hiding this comment

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

Would it be possible to add retunable primes to the grammar using {primes: } rather than setters ()? The reason being that syntaxes using { are intended for scale modification, and ( is intended for all the non-scale settings. Everything else about this syntax looks great.

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

Successfully merging this pull request may close these issues.

None yet

2 participants