Git Product home page Git Product logo

sonic-weave's Introduction

sonic-weave

SonicWeave is a Domain Specific Language for manipulating musical frequencies, ratios and equal temperaments.

Not to be confused with the Sweave flexible framework for mixing text and R code for automatic document generation.

Package overview

The sonic-weave package is many things.

You may also be interested in the technical overview of SonicWeave as a programming language.

Appendix: tempering, commas

Highlights

Harmonic segment from the 8th harmonic to the 16th (repeating at the octave).

8::16

10-tone equal temperament

tet(10)

The major scale in Pythagorean tuning i.e. 3-limit just intonation.

sort(3^[-1..5] rdc 2)

Scale title, colors and labels.

"Japanese pentatonic koto scale, theoretical. Helmholz/Ellis p.519, nr.110"

9/8 white "Major 2nd"
6/5 green "Minor 3rd"
3/2 white "Perfect 5th"
8/5 green "Minor 6th"
2   gray  "Root & Octave"

Additional resources

Special thanks

  • Arseniiv A. - Co-developer / Language feedback
  • Inthar - Co-developer / Language feedback
  • Akselai - Quality assurance
  • Godtone - Notation adviser / Language feedback
  • Joe Hildebrand - Grammar review
  • Marc Sabat - Notation adviser

Acknowledgments / inspiration

SonicWeave looks like Javascript with Python semantics, has Haskell ranges and operates similar to xen-calc with some Zig sprinkled on top.

  • ECMAScript - Brendan Eich et. al.
  • Python - Guido van Rossum et. al.
  • Haskell - Lennart Augustsson et. al.
  • Zig - Andrew Kelley et. al.
  • OCaml - Xavier Leroy et. al.
  • NumPy - Travis Oliphant et. al.
  • Scala - Manuel Op de Coul
  • Scale Workshop 1 - Sean Archibald et. al.
  • SQL - Donald D. Chamberlin et. al.
  • FJS - "misotanni"
  • NFJS - Matthew Yacavone
  • Xen-calc - Matthew Yacavone
  • Xenpaper - Damien Clarke
  • Ups and downs notation - Kite Giedraitis
  • S-expressions - "Godtone"
  • Peg.js - David Majda et. al.
  • Peggy - Joe Hildebrand et. al.
  • Xenharmonic Wiki - (community project)
  • Xenharmonic Alliance - (community Discord / Facebook)

sonic-weave's People

Contributors

frostburn avatar inthar-raven avatar arseniiv avatar osmiumic avatar

Stargazers

 avatar Dirk Arnez avatar akselai avatar Miika Alonen avatar

Watchers

 avatar  avatar Sevish avatar Alex Shen avatar

sonic-weave's Issues

Rename red to rd

Frees up the CSS color.

intharToday at 4:45 AM

May I suggest rd?

gcd, lcm

Component-wise min/max on monzos.

Movement in time

Break into issues as necessary

Root scale declaration
# = 4::8

Rest
. (one beat)
.. (two beats)

Beat duration declaration
. = 300ms

Time signature declaration
T = 4 (four beats per bar)

Barline
| (runtime error if in the wrong place according to the time signature)

Repeated section
|: foo bar :|x3

Duration literal
d1/2 (half a beat)

Duration labeling
3/2 d2 (a fifth from 1/1 lasting two beats)

Time advancing
1/1 5/4 3/2 . 2/1 (root, third, fifth, rest, octave)
[editor's note: Feels fragile. How is 440 Hz not 440 followed by 1Hz?]

Duration extension
(empty statement)

Pedal
1/1 ?? 5/4 3/2 (root lasts for three beats here)

Rewind
1/1 , 6/5 , 3/2 (this is a simultaneous chord)

Playhead
|> (start playback from last occurrence)

Playstop
>| (stop playback when encountered)

Timestamp
T

Jump to timestamp
@T

Duration multiplication
&
n => n & 3 (mainly useful for mapping)

Automatic colors/labels

dXToday at 7:23 AM

also u should add somethig to make it so that you can auto color the notes
(i dont like the color grey and am lazy)

frostburnToday at 7:25 AM

So you'd like this to be a toggleable preference and for the app to auto color every time?

dXToday at 7:27 AM

i was thinking it'd be a thing you can do in the modify scale category but thats also good

Scale degrees with equave stacking

#0 is always 1/1
#1 is $[0]
Indices that go beyond the size of the current scale stack like they do in Scala/Scale Workshop.

This is more relevant to making music tracks than making scales.

Make second a global variable

s is a useful variable name that should be overrideable.

s = %Hz

Needs updates to default string representation too.

Temperament configuration

It might be nice to see temperament at the top of the source instead of at the bottom. Would play nicer with the lattice too if it was the UI's responsibility to apply tempering.

One-letter hertz literals

LiftPizzasToday at 8:39 PM

Maybe even "z" or "h" as a prefix/suffix to signify hertz
Something single-key is way better. It's only one or two more keys, but it really adds up when you're trying to enter a bunch of them. 🙂
Especially if you're 10-keying the numbers.

Import export syntax

import * from prelude
import {mtof, PI} from prelude
import * as utils from utils#v0.1.0@frostburn
export riff plusOne x {x+1}

Implement (a subset of) ups-and-downs notation

The FJS accidentals take at least two characters to do anything so a single arrow which always points in to right direction could help.
Don't bother with mids, we already have neutrals and half-augmented for that.

Duration and logical duration extensions

Duration is how long the note sounds.
Logical duration is how much space the note takes up.

! extends duration and logical duration.
? extends duration only.
. extends logical duration only.

If there is no note on the sheet yet a special Silence note is created to hold the implied durations.

Implement type annotations

0.5° 🌜 — Today at 1:35 PM

BTW also how about considering simple typing annotations (just matching types at runtime when a function is called, before any possible type errors in calls to primitives in its body) if all values can be split into a small set of disjoint types (like ratio, logarithmic interval, number, pitch; were frequencies distinct from all of those too?; then scale of pitches and... what else was there?). In that case it would be simple to annotate and check, but for user-defined functions that don’t conform to those types one would need to drop annotations (and runtime checks) to some of the parameters

Spread syntax

Extend gcd and lcm to multiple parameters for
gcd(...$)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.