Skip to content

Commit

Permalink
Add the statistics functionality to the ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattijs Kneppers committed Jul 8, 2024
1 parent a3e9a77 commit ef7c6f6
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion maxdiff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,30 @@ Removing the comments from the new MIDI Effect:
For `.amxd` files:
* The scripts will also tell you what device type it is.
* If a device is frozen, you will see an overview of the content frozen into the deivce. NOTE: We recommend never to commit frozen devices to a git repo, instead to include the dependencies as separate files.
* If a device is frozen, you will see an overview and statistics of the content frozen into the device. NOTE: We recommend never to commit frozen devices to a git repo, instead to include the dependencies as separate files.

### Why?

Readable diffs are very useful for patch code review, or for a sanity check before committing (did I really change nothing else expect removing all my debug messages and prints?).

### Using the frozen device statistics

It currently supports two different ways to count object instances and connections:

* Total - Counting every abstraction instance - Indicates loading time
* Unique - Counting abstractions once - Indicates maintainability

This provides the ability to quantify refactoring efforts. Of course there is more to refactoring than these statistics, but this does make refactoring work more tangible.

Note that we typically don't commit frozen devices to a repo, so the typical way to use this feature is:

1. Commit the device and its dependencies in **un**frozen state.
2. Temporarily freeze the device.
3. Run `python3 ./maxdiff/amxd_textconv.py <path/to/device.amxd>` to get the statistics.
4. Discard the freezing.

Note: the reason this only works with frozen devices is that these unambiguously capture all dependencies.

### What does not work

Typical things you can do with text-based code that will not work with Max patches or devices:
Expand Down

0 comments on commit ef7c6f6

Please sign in to comment.