bateskevin / psharmonize Goto Github PK
View Code? Open in Web Editor NEWPowershell Music framework
License: MIT License
Powershell Music framework
License: MIT License
The DSL in my imagination would look something along these lines:
Song -BPM 120 -Content {
Bar {
Beat {
Eight {
C
}
Eight {
D
}
}
Beat {
Eight {
E
}
Eight {
F
}
}
Beat {
Eight {
G
}
Eight {
A
}
}
Beat {
Eight {
B
}
Quarter {
C -Octave 4
}
}
}
Bar {
Beat {
Eight {
}
Eight {
B
}
}
Beat {
Eight {
A
}
Eight {
G
}
}
Beat {
Eight {
F
}
Eight {
E
}
}
Beat {
Eight {
D
}
Eight {
C
}
}
}
}
That example would just play you the C Major Scale.
The Letters are functions that generate a note, that we can relate them to an octave. The Standard Octave for a Note atm is 3. That's why in the example above only the upper C of the scale has an octave defined.
So you could also send multiple notes in an eight, or a quarter or so. These in the background will just be midi note on sends.
The BPM defines how long the Sleep is between the eights. For the Moment I think it's enough to add Eights. Sixteenths could be added later.
The code above should create a script that runs the midi api calls and sleeps on its self. If done through foreach in the object directly there is to much latency. A standalone script however without any math for powershell to do in between should do the job.
If somebody has any suggestions or feedback on the above that would be much appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.