Log In  

I am making a song in pico-8 that has a section with 3/4 time. How do I do that with the pico-8 tracker? I think you would do it in Milkytracker by changing the length of the pattern. I could just have each pattern contain three beats of one measure and one beat from the next measure, but that's kind of messy and would cause a lot of redundant notes. Could I use Lua programming and the sfx api to hack around the tracker? Is there a chance we could have a feature to change the length of patterns (or at least to make them shorter)?

P#11700 2015-07-19 17:36 ( Edited 2015-09-18 23:53)

I'm new here, but I think I know a way to do it in the existing system. stat(n) can access the currently played track on channels 1-4 (n 16..19) and the currently played note index on channels 1-4 (n 20..24). The music editor can play tracks with different speeds simultaneously, but it won't move to the next pattern of four until the slowest track finishes.

So first, set the speed of all tracks in the 3/4 time segment to 3/4 the normal speed (if delay is normally 12, then a delay of 16 means the tracks run three measures in four normal measures time). Then, code the track as if every three notes is a full measure, and completely ignore the last column.

Finally, you'll need to add some lua code in the update to make sure when the note index is >= 24 in the 3/4 time section, you play the next pattern immediately with music(pattern+1). This will skip that last empty column in the tracks and start right at the next measure. And this works even if only 1 of the four tracks is in 3/4 time, playing dissonantly with the rest of them. XD

P#11861 2015-07-26 20:18 ( Edited 2015-07-28 05:19)

Here's a quick demo I made of the idea. In your version you'll need to count measures (times the note index hits zero), and only play the next measure early when it makes sense.

Cart #11863 | 2015-07-27 | Code ▽ | Embed ▽ | No License

P#11864 2015-07-26 20:57 ( Edited 2015-07-27 00:57)

Hm, this has some potential! Thanks for your input. I'll try it out.

P#12336 2015-08-05 19:22 ( Edited 2015-08-05 23:22)

there's like one extra beat in between and it's bothering my musician ears :P

P#12390 2015-08-06 23:04 ( Edited 2015-08-07 03:04)

@Connorses: yes, the web player is still a little laggy on music, it works better when downloaded. zep mentioned somewhere that the 0.1.2 web player would be better at this. See below for a new method I'm hoping works better.

@xordspar0: it's pretty hacky, but thanks! Actually, I've found a better way in my travels: you can set the speed of the track after it starts playing and avoid that little gap! It's more code management, but a better 3/4 time hack for now.

Cart #12782 | 2015-08-19 | Code ▽ | Embed ▽ | No License

P#12781 2015-08-18 23:22 ( Edited 2015-08-19 03:28)
1

I've changed the way playback works for 0.1.2, and it will allow unusual time signatures without messing with playback in realtime.

0.1.1 took the length of the longest channel in each pattern as the length of the pattern
0.1.2 takes the length of the first non-looping channel from left to right

So, if you set the first channel to play at speed 12, and channels 1..3 at speed 16, only the first 24 rows get played of 1..3. So you can have 8 (24/3) bars.

Unfortunately, it means wasting the last 1/4 of each pattern, and the channel 0 has extremely syncopated timing.

(by the way, old cartridges will still load and play as they used -- 0.1.2 swaps channels around if needed to get the old behaviour)

P#14341 2015-09-18 19:53 ( Edited 2015-09-18 23:53)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 20:57:05 | 0.015s | Q:26