Posted: Thu Sep 17, 2020 3:23 pm Post subject: Music programming language
I have started to develop a programming language for writing music.
It's mainly for fun. It will be very useful for musicians who want to learn basic programming.
Its development is in a very early stage.
The sounds available as of now are very primitive and resemble the 1980's.
That might improve in the future.
However, sound quality is not the goal of this.
I am planning to support exporting the code to a beautifully written sheet music in pdf format.
Anyway, i would like to get some users so you guys can tell me what features and capabilities you would like the language to have.
The project has a goal in mind to allow the programmatic composition and playing of music. It includes an interpreter and a player. The project is in very early stages so expect things to change without notice.
How to write the soundbytes script?
At the moment, there are few predefined functions and objects. Basic arithmetic is implemented.
All combinations of notes, octaves and durations are available globally.
note: C octave: 4 duration: 16th c_4_16
note: C# octave: 4 duration: 16th dotted c#_4_16*
C maj chord: c_5_4 + e + g
The first note of the chord carries the duration of blocking until the next note is played. c_5_16 + e_5_4 + g, e_5_4 after the first note c_5_16 has finished, the rest of the notes of the chord will keep playing because their longer duration e_5_4 + g while the next note e_5_4 will start.
It is mandatory to set the tempo, at least once.
tempo(60);
Creating a track from a bunch of notes.
Notice that the last couple of notes don't have an octave or a duration.
For the convenience of the user, if the octave and duration are identical, they can be omitted until a change is required.
track(c_4_16, c#_4_16*, c_4_16, c, a, b)
Playing the tracks
let bass = track(a_3_8*, b, g#_2_8*, a_3_8*, f_2_8*, f#, g, g);
let bass2 = track(x_8*, x, g#_2_16, b_3_16, d, f, e, c_2_16, e);
let solo = track(
a_5_32, c, e, a, c, e, b, d,
f, b, d, f, g#_4_32, b_5_32, d, g#_4_32,
b_5_32, d, a, c, e, a, c, e,
f_4_32, a_5_32, c, f_4_32, a_5_32, c, f#_4_32, a_5_32,
c, f#_4_32, a_5_32, c, f, e, d, c,
b, a, b, c, d, e, f, g
);
play(bass, bass2, solo);
The function play also accepts single notes but notes and tracks cannot be mixed together.
Running the code
Compile the project and give the .sb source file to the binary
You can also checkout the test file in /test
_________________ Plan like you are going to live forever, live like you are going to die tomorrow.
I'm sorry, I don't understand the purpose of this program. Is the technology used to create music, or to analyze music and write charts? I'm not interested in mathematically creating music, but I'm very interested in a program which could "hear" a bass track and write a chart for it without the use of midi.
I'm sorry, I don't understand the purpose of this program. Is the technology used to create music, or to analyze music and write charts? I'm not interested in mathematically creating music, but I'm very interested in a program which could "hear" a bass track and write a chart for it without the use of midi.
Actually, i was thinking of both.
However, at the moment the "hearing" capability is not implemented yet.
I will definitely look into implementing it.
If that feature would really be useful for you, i could have it on top of my list of priorities.
However, keep in mind that doing that for multiple instruments, at the same time, would be near impossible.
You won't be able to give it a whole song and have it transcribe it.
A more realistic expectation is that you would be able to play a single instrument without many effects, it would figure that out and generate the sheet music.
As far as the creation of music, the idea is that you might have an idea for a melody and you can write it out quickly using my language and then produce a chart.
The benefit is, not only that the chart would be immediately created as a pdf file but also, you would be able to actually hear what the melody would sound like.
For example, you might be in a plane and not have access to a musical instrument. _________________ Plan like you are going to live forever, live like you are going to die tomorrow.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum