Page 1 of 3

Compose (Yet another LÖVE project...Will I ever finish one?)

Posted: Sun Oct 21, 2012 9:56 pm
by Nixola
Sorry for missing the space after the three dots in the title, too many characters ^^'


This is another project of mine, Compose. (I just typoed "Compost", so I think it'll be the official name now.)
It is VAGUELY (Image) inspired by Stelpa's LuvMatrixMono (it's the same thing, just bigger and polyphonic), it allows you to write simple music. The length of a "piece" written with this program is 128 quarters (for now), and you can have as many notes you want in a single quarter. Commands:
leftClick: toggle a square [on/off]
rightClick: toggle a square [start/stop]
m: toggle mode [sine/kick.ogg]
up/down arrow keys: increase/decrease tempo and reset time
space: pause
The notes are written to the left of the grid(I don't think they should be written like this, but whatever) and two red lines show you the current position.
If you have any suggestion or question, feel free to ask Image

EDIT: Added the possibility to create a longer note, right-click a square to toggle it between start and stop of a note (start is green, stop is red)

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 12:36 am
by Stelpa
Firstly, I would like to say: OMG SO MANY BOXES xD

I am really very surprised and happy that my very first project was an inspiration to someone, hahaha ^^

I am impressed also, I was confused how I would implement polyphony and you did it very elegantly, so it was actually helpful to me as well! Also, you did a good job of adding western tunings and a REAL SINE SYNTH (wow!), really really clever :)

Thanks very much for making this though, it actually helped me a lot in understanding how a more experienced programmer would do a similar project, and seeing what was different and the same was neat :3

<3 Stelpa

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 12:50 am
by Nixola
Selpa wrote:Firstly, I would like to say: OMG SO MANY BOXES xD
They're so many that they ended up being too small, I wanted them to be 9x9 originally
Selpa wrote:I am really very surprised and happy that my very first project was an inspiration to someone, hahaha ^^
I like doing music related programs in LÖVE and seeing other people do them (Right, Stonecrow? I'm still waiting ATree >.<), it's quite easy once you've understood how it works
Selpa wrote:I am impressed also, I was confused how I would implement polyphony and you did it very elegantly, so it was actually helpful to me as well! Also, you did a good job of adding western tunings and a REAL SINE SYNTH (wow!), really really clever
You can use the Notes module if you want, it has also triangular ('triang') and square ('square') waves ;)
Anyway I already have a music related project, so it has been relatively easy to do this (Except the graphics... I didn't want to use Canvases >.<)
Selpa wrote:Thanks very much for making this though, it actually helped me a lot in understanding how a more experienced programmer would do a similar project, and seeing what was different and the same was neat :3
Thank you, I've had to do a similar project for months, you did what inspired me to do it and now I can use it to create the former ^^
I didn't understand yet what notes are played in LuvMatrixMono, in which order and why (and I didn't look at the code yet)


P.S: What time is it there?

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 1:18 am
by Stelpa
It is 21:15 here in Florida, USA. LuvMatrix has rather simple code I think, but I didn't leave any comments (I will remember to do that next time!). It basically just reads an array, where array[beatnumber]=notevalue, and the harmonic series is really rather obvious (just pitch=series#). Hopefully that helps :)

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 2:47 pm
by Nixola
I forgot to up for the new update (I only added long notes, I'll add horizontal and maybe vertical scrolling)

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 4:24 pm
by qaisjp
no offense..
but did you really have to use a canvas?

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 4:30 pm
by Nixola
I have to choose between canvases, spritebatches (that I don't like) and a strange way to draw that involves changing love.run, deleting love.draw and love.graphics.present(), otherwise it's quite slow (I didn't test it, but I have to draw 88*128 rectangles, it's not fast); I'm planning on making the third option available for those who don't support canvases, but graphical glitches are very likely

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 4:34 pm
by qaisjp
Nixola wrote:I have to choose between canvases, spritebatches (that I don't like) and a strange way to draw that involves changing love.run, deleting love.draw and love.graphics.present(), otherwise it's quite slow (I didn't test it, but I have to draw 88*128 rectangles, it's not fast); I'm planning on making the third option available for those who don't support canvases, but graphical glitches are very likely
Try calculating the positions before hand, storing those positions in a table (tab={{pos..},{pos..}}) and then in the draw function loop the table and draw accordingly..

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 5:20 pm
by Nixola
That's not a problem, 11264 calls to lg.rectangle per frame are

Re: Compose (Yet another LÖVE project...Will I ever finish o

Posted: Mon Oct 22, 2012 6:30 pm
by Banoticus
AAAAAAAAAAAAA!!

My ear drums!

I like though.
Can you make the squares bigger and you can scroll to see all of them ( like in FL studio ). I think your program would sell more if it were so.

Very nice overall. :awesome: