/usr/share/bse/v0.7.8/scripts/modules2grid.scm is in beast 0.7.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ;; CC0 Public Domain: http://creativecommons.org/publicdomain/zero/1.0/
;; (bse-script-register <func> <options> <category> <blurb> <author> <license> ARGS...)
(bse-script-register 'modules2grid
""
(N_ "/SNet/Grid Align")
(N_ "Round module positions to their nearest grid position, "
"so to align all modules within a synthesis network.")
"Tim Janik"
"Provided \"as is\", WITHOUT ANY WARRANTY;"
(bse-param-snet (N_ "Synth Net")))
(define (modules2grid snet)
(if (not (bse-is-snet snet))
(bse-exit-error 'text1 (_"No valid synthesis network supplied")))
(bse-item-group-undo snet "modules2grid") ; move all children at once
(do ((children (bse-container-list-children snet) (cdr children)))
((null? children))
(let ((module (car children)))
(if (bse-is-source module)
(let ((x (bse-item-get module "pos-x"))
(y (bse-item-get module "pos-y")))
(if #f (display (string-append (bse-item-get-name-or-type (car children))
": " (number->string x)
", " (number->string y)
"\n")))
(bse-source-set-pos module (round x) (round y))))))
(bse-item-ungroup-undo snet))
|