Open meenie opened 9 years ago
I have midi and osc planned, but not in the immediate future.
What I can give you at the moment is raw json. You'll get lines like:
{ 'voice':'bass', 'octave':'1', 'instrument':'sawpulse', 'degree':'12.1', 'dur':'1', 'amp':'0.375', 'delta':'0', 'tempo':'2.1666666666667', },
{ 'voice':'kick', 'octave':'5', 'instrument':'kick', 'degree':'0.375', 'dur':'4', 'amp':'0.375', 'isRest':'true', 'delta':'0', 'tempo':'2.1666666666667', },
{ 'voice':'hats', 'octave':'5', 'instrument':'hats', 'degree':'0.25', 'dur':'4', 'amp':'0.25', 'isRest':'true', 'delta':'0', 'tempo':'2.1666666666667', },
{ 'voice':'snare', 'octave':'5', 'instrument':'snare', 'degree':'0.25', 'dur':'4', 'amp':'0.25', 'isRest':'true', 'delta':'0', 'tempo':'2.1666666666667', },
{ 'voice':'alice', 'octave':'5', 'instrument':'default', 'degree':'5.1', 'dur':'2', 'amp':'0.625', 'delta':'0', 'tempo':'2.1666666666667', },
{ 'voice':'bob', 'octave':'5', 'instrument':'default', 'degree':'1', 'dur':'2', 'amp':'0.625', 'delta':'1', 'tempo':'2.1666666666667', },
{ 'voice':'bass', 'octave':'1', 'instrument':'sawpulse', 'degree':'12.1', 'dur':'0.25', 'amp':'0.375', 'delta':'0.25', 'tempo':'2.1666666666667', },
but I can't commit at the moment, to every single field in each object.
note that many of the fields, such as 'degree', are further processed by SuperCollider; as in, the freqency or midi note # is calculated by the scale degree, the scale, the octave, any transposing, etc.
at some point in the future, i'll be able to dump the cooked values, but not any time soon.
any variable you set, like in 3 => @foo
will result in a corresponding field in the json.
do it like:
") ) ) )".skoar.json;
or
x = "{: ] ] o/ ] :: 20 times :}".skoar;
x.json;
It will output it.
Don't do it on a skoar that loops infinitely.
Thanks :). I don't have much experience with MIDI, so you'll have to bare with me. I'm going to assume the following: Voice: I don't have a concept of voice, just instrument, so I'll skip this Octave: That's obvious Instrument: Another obvious one. Although, I only have white/pink/brown/brownian/red noises, and the different basic oscillators. My library does have the ability to combine any of those to create a new instrument though. degree: I have a feeling that that is what I need to do some sort of calculation, with the octave, to turn it into a specific frequency to play. I use a hash table like this for my note names, but it only works for equal temperament. If I had just the frequency, I could use that directly without issue. Dur: I'm assuming Duration. 4 = whole note, 2 = half note, 1 = quarter note, .5 = eighth note, .25 = sixteenth note, etc? Amp: I'm guessing this is how "loud" the note is when played? Used for dynamics/accents? Delta: Not sure what this is isRest: That's an easy one Tempo: Why would all notes have a tempo? That's something that I've set to the "conductor". This makes it so that if I change it, I can recalculate the duration of the note once I've pulled it out of the queue to be played.
Anyway, it may be doable, but I think it might be easier once you are outputting the "cooked values". Do you have any clue as to how that will look? I know it wouldn't be set in stone or anything, just would like a small idea :).
Thanks for the response!
dur
is the number of beats to hold the note for.
delta
is how many beats you can go to sleep for, i think. So if multiple beats happen at the same time, the first of those will have delta == 0
.
delta
is something supercollider is adding to each event.
if stretch
is defined, it will multiply by dur
resulting in a larger delta
.
amp
is the volume yes, valid values are 0 to 1.
tempo
is just another parameter in this parameter-collecting language, so it's in the event. if you change the tempo mid song, the tempo will change. That being said, all voices are using the same tempo clock at the moment.
voice
- like a track in a multitrack song, skoar does multiple voices, voice is the name of the voice.
degree
- SuperCollider does scale degrees oddly. semitones are indicated by +/- 0.1 rather than +/- 0.5.. so keep that in mind.
if you set a key
like Am => @key
, then two other magic ones will be created, scale
and root
scale
is a supercollider object, dumped into a string in the json, you'll have to pick out the array.
You should experiment, there will be more things in there depending what you are doing. SuperCollider adds stuff, I'm adding stuff..
Cool :). Thanks for the added info!
I've made some changes while implementing choards. Noats used to be converted to scale degrees, and would be key'd in json by degree
. Now, numbers are still scale degrees, but noats and choards are key'd by note
. The root note is still 0, but semitone increments correspond to increments by 1.
i.e. c = 0, c# = 1, d = 2... add this to octave
* root
and you get the midi note number.
I'm wondering if you have any plans convert the output to JSON so I could try and import it into my library Band.js. It would be really cool to have music notation like this that can feed directly in and play :).
Here's an example of what Zelda sounds like: http://plnkr.co/edit/jFnos1?p=preview