lid55
MidiFire Beta
Posts: 68
|
Post by lid55 on Jan 25, 2018 18:55:23 GMT
Thanks again Nic, I’ll test some stuff out and report back here.
|
|
lid55
MidiFire Beta
Posts: 68
|
Post by lid55 on Feb 23, 2018 18:10:08 GMT
Ok so I've realized that the way you started going about it at the beginning of this thread (changing the tempo on-the-fly) is much more powerful than simply changing the DynamicClock tempo from the get go: using a clock divider/multiplier gives you BOTH or MORE tempos to work with, whereas changing the tempo at the source just keeps you at a single working tempo.
With "looping conditionals" in MidiFire, is it possible to set arbitrary ratios for a clock multiplier?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 24, 2018 17:54:17 GMT
Hi lid55 , You can set arbitrary numerator / denominator values for the divider I posted by adjusting the two constants at the top to suit. You could run multiple dividers with multiple values in parallel. If you mean you want to change the divide ratio on the fly, then you could do this also by adding some code to set the values of K0 and K1 remotely via CC message (or randomly too I guess). Multiplying is a bit more tricky (as described in this thread). The example I posted is limited to clock doubling (although you could run multiple copies in series to get other multiples of 2) Then, I don't see why you couldn't add a divider at the end to effectively multiply by a fraction. Keep in mind that in the multiplication process each second tick will always be out a bit but in practice this may not be noticeable. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 68
|
Post by lid55 on Feb 24, 2018 18:18:56 GMT
Multiplication is actually quite a bit harder as ticks have to be added at the right time (tempo wise). Problem is, you don't know the tempo until the second incoming tick, so the first inserted tick will always be wrong. Most apps/devices won't notice this too much. So, doing simple multiplications like 2X or 3X could be done with the Stream Byter as it stands, but more elaborate multipliers like fractions or > 3 really require Stream Byter to support conditional looping. I plan to add looping in an upcoming update. If a simple clock doubler would suffice for now, the me know and I can post that here. Regards, Nic. Thanks for the info Nic. Well I was actually referencing something you had said earlier in the thread, and since MidiFire now supports (beta) conditional looping, I was wondering if it is now possible to create a module that would work dividing or mulitiplying the clock by ANY fraction? I’m not sure how difficult this would be to create... I could start on it at least... It would be cool to have confirmation that it’s possible though... what do you think?
|
|
lid55
MidiFire Beta
Posts: 68
|
Post by lid55 on Feb 24, 2018 18:27:25 GMT
or I guess what seems to be simplest, would be multiplication by any given ratio (then if you want to divide by 2, for example, you can just multiply by 1/2)
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 24, 2018 19:22:10 GMT
HI lid55, Yes, good point. Sorry I did not pick up on that. I think being able to loop will indeed make it more easy to cater for more esoteric fractions, but chaining multiple (pun) divider/multiplier blocks will probably have the same effect and could be done possibly more intuitively. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 68
|
Post by lid55 on Feb 27, 2018 16:53:40 GMT
Thanks Nic, I’ll consider the module/block approach.
As far as conditional looping, what is/will be supported for StreamByterII? FOR or WHILE loops?
Regards, - Brett
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 28, 2018 8:54:04 GMT
Hi lid55 , Yes conditional looping is in the current TestFlight beta that you have. You add a +L flag to the IF/END that you know and love now and instead of passing control on to the next rule when it hits the 'END' it will instead jump back to the conditional and evaluate again. Here is a simple example. ASS L0 = 0 IF L0 < 5 +L SND B0 07 01 MAT L0 = L0 + 1 ENDSo, it's a while loop. Now, since it could be possible to cause nasty problems if you programmed an infinite loop, each loop will execute a maximum of 128 times regardless of the condition. Regards, Nic.
|
|
lid55
MidiFire Beta
Posts: 68
|
Post by lid55 on Mar 1, 2018 17:57:03 GMT
Nice! I love how concise you’ve made it.... to just add “+L”
|
|
|
Post by alphaai on Sept 11, 2020 2:29:53 GMT
Could some old explain how the code works?
Hi, I am trying to process 32nd notes, 16th notes, 8 notes etc and because I want to play back all notes, I probably have it all wrong but I can process I think 32nd notes however I'm having difficulty Really understanding the code.
I understand that F8 are the ticks, K1 = 4 and MAT L2 = L0 % K1 So if L0 = 5, then L2 = 1
What's the best approach?
|
|