Less lag music tutorial

Whoa :0 this seems complicated

1 Like

What is the advantage of this apart from reducing lag? It seems like it will take longer

2 Likes

Once you get used to it, it doesn’t take that long. The whole point is to reduce lag created by chords and regular notes. It’s just a more efficient way of coding music

If you compare this to conventional music coding, this sounds way better by far.

4 Likes

upon actually testing the method: it is a lot more familiar and easier to transition to from the common method! it’s so cool how we have so many different ways now to do the same thing :eyes:

if I’m using it correctly, it still looks like you have to do the whole piece (or at least the whole system that tells the notes to play) in one “track” or object rule? so if you were composing or taking from a score with a lot of polyphony, this means you’d have to be super smart about rhythms.

say you had a polyrhythm going: one “line” - let’s say the melody - playing a C four times in a measure and one line - let’s say the bassline - playing a G three times in a measure. that’s a weird subdivision, as fraction addition says you’d likely think of it in twelfths of a measure (which is four beats). the C would play at 1/12, 4/12, 7/12, and 10/12, while the G would play at 1/12, 5/12, and 9/12. then you have to do the math for how long to wait, which gets some weird code blocks:


(most of the wait blocks have ((bpm x 4) / 12) x #)

which is… very busy? and takes a bit to code if you’re not paying enough attention to all independent lines at once. this is why for polyphony I would use the whens method, which looks like (whoops, I had an error in uploading the file, but long story short only one multiplication block is required)

the other plus is that I can work on different parts of the song at any time I like. I usually code the melody first, then the bassline, then any ornaments or pedal tones I want in the track, and drums if I’m feeling ambitious :yum:. with the common method (and with this method if I have it correctly), I would have to go measure by measure, knowing for sure what I want - and editing code after the fact would be much harder because I would have to adjust all the wait times. with the when method I can put sound blocks in any object, so having multiple simultaneous sounds/independent lines is much easier. this is how I get the level of complexity in my tracks that most music projects lack.

this has been a pro/con ramble post :woman_shrugging:

4 Likes

THIS IS VERY AMBITIOUS lol

Yeah, it can easily get disorganized and messy, so I try to group them and label the variables to be easily recognized

3 Likes

that’s why I switched to the when method in the first place :yum:

1 Like

yes that is true

I need to look into the other method—how does that one work? this seems a lot more efficient to code but the other one the code seems easier to understand/easier to look back on and for pieces with more notes/instruments

1 Like

efficiency actually isn’t bad - you just copy and paste the entire rule and edit the “measure =” number and the note being played. I did most of rewrite the stars in an afternoon!

3 Likes

oh—copy paste really does help lol

is there a tutorial for the other method? probably will do future music with that since this easier to understand

2 Likes

I love this music discussion :DDDD

4 Likes

not as of now - but I can put one on my list to make!

since I hope my projects are organized decently, you can probably learn a bit from looking at that code, but I know that’s not always the best way to learn :sweat_smile:

2 Likes

so I looked at some of the method you used and figured what if the methods were combined? if the measure system was used and instead of setting a note it sets a value which plays a note if that makes sense? I would have to experiment but that could make it more time efficient and still keep clean code

4 Likes

let’s try it! if you have any questions about the measure system I can help out - also in the proccess of tutorial-ing while I make sage’s prize request

2 Likes

actually I didn’t look at how the measure system works lol but I’m assuming it is a value increasing by a sixteenth note every time that amount passes by?

2 Likes

usually something a bit smaller - I use measure = 0.25 as a quarter note, so I usually code a phrase or so and then take 0.25 in the master block and divide it by 2 until I get the tempo I’m looking for. the number needs to be a factor such that the measure tick will pass the number of all your notes at some point - which is why triplets are a bit tricky

I usually increase it continuously, but you could also throw a wait block in there if you want to control the tempo that way

1 Like

Bump
Great tutorial, but I’m confused about the bpm part. When I convert 108 into milliseconds, then divide it by 1000 I get 108 the same number, but then I have to wait 108 seconds for my next note which makes no sense. Help?

Formula for converting seconds to milliseconds:
[Seconds] x 1000 = [Milliseconds]

Conversely,
[Milliseconds] x 0.001 = [Seconds]

2 Likes

I know that, but what is the point of timesing by 1000 then dividing by 1000, I also get an answer that is too many

I’m confused at what you’re trying to get at. Please give an example?

2 Likes

Basically, I am coding some music using this tutorial, but am having trouble with the bpm, the original piece says 108, but if I times it by 1000 then divide it by 1000, nothing changes, the answer I get is still 108, and if I have to wait 108 seconds for every crochet/quarter note, that wont work.