Debug the repeat block (Coding Period IV)

Abhijeet Singh
2 min readJun 25, 2024

--

Introduction
In this blog we have gone through what is repeat block https://medium.com/@vayuabhijeet/looking-at-repeat-block-in-music-block-code-coding-period-iii-8bb61209148d
today we are going to look what was the issue when we are going to add the repeat block and how did we are able to resolve the issue

What was the Issue

The issue we have was that the block are not properly connected so if you are creating any other parser which converts MB format and it is not converting in to proper the error message is like there issue with the json file you are converting to MB a good way is to break into smaller pices so if you have big song do it for one note and check the connection with other are proper or not.

How did we able to resolve the issue

So we break down to the granular level and check the json converted with MB code created by hand the connection in the below you could see are not proper we then debug the code scratch out whole code and fix it phew !

See the connection on right(correct one) for notename is 35 and for wrong that we coded is 45 we then moved on to the code and fix the code

One thing we also need to care of the repeat scenario that is if its in starting then it should be connected with start block or if its middle then with other middle block just like linked list

What we are going to implement in this week
In this week are going to
i) Clean the code
ii) See the method could optimized
iii) Testing

Thank you for reading this blog if need any help building any parser to MB reach out to us at matrix

--

--

Abhijeet Singh

Software Dev @Vizuara | ex-5irechain( India's fastest unicorn) |