<commit_before>(ns overtone.api
  (:use [overtone.libs boot-msg app-icon]
        [overtone.helpers.ns])
  (:require clojure.stacktrace
            [overtone.config store]
            [overtone version osc speech]
            [overtone.algo chance scaling trig fn]
            [overtone.sc bindings buffer bus envelope example info
                         ugens defcgen node sample server synth
                         foundation-groups dyn-vars trig]
            [overtone.sc.cgens oscillators demand mix io buf-io env tap
                               line freq beq-suite berlach bhob info]
            [overtone.music rhythm pitch tuning time]
            [overtone.studio mixer inst util fx wavetable midi midi-player core]
            [overtone.repl ugens examples shell inst debug graphviz]
            [overtone.libs asset event]
            [overtone.gui scope mixer control]
            [overtone.samples freesound]))

(defn immigrate-overtone-api []
  (immigrate
   'overtone.osc
   'overtone.algo.chance
   'overtone.algo.scaling
   'overtone.algo.trig
   'overtone.algo.fn
   'overtone.config.store
   'overtone.sc.bindings
   'overtone.sc.buffer
   'overtone.sc.bus
   'overtone.sc.envelope
   'overtone.sc.example
   'overtone.sc.info
   'overtone.sc.node
   'overtone.sc.sample
   'overtone.sc.server
   'overtone.sc.synth
   'overtone.sc.ugens
   'overtone.sc.defcgen
   'overtone.sc.foundation-groups<commit_msg>warn users when tieredStopAtLevel is set to 1<commit_after>(ns overtone.api
  (:import [java.lang.management ManagementFactory])
  (:use [overtone.libs boot-msg app-icon]
        [overtone.helpers.ns])
  (:require clojure.stacktrace
            [overtone.config store]
            [overtone version osc speech]
            [overtone.algo chance scaling trig fn]
            [overtone.sc bindings buffer bus envelope example info
             ugens defcgen node sample server synth
             foundation-groups dyn-vars trig]
            [overtone.sc.cgens oscillators demand mix io buf-io env tap
             line freq beq-suite berlach bhob info]
            [overtone.music rhythm pitch tuning time]
            [overtone.studio mixer inst util fx wavetable midi midi-player core]
            [overtone.repl ugens examples shell inst debug graphviz]
            [overtone.libs asset event]
            [overtone.gui scope mixer control]
            [overtone.samples freesound]
            [overtone.helpers.doc :refer [fs]]))


;; Currently the default lein setting drastically reduces performance in
;; return for a 200ms improvement of the startup time. See:
;; https://github.com/technomancy/leiningen/pull/1230
(defonce __PRINT_TIERED_COMPILATION_WARNING__
  (let [compiler-bean (ManagementFactory/getCompilationMXBean)
        compiler-name (.getName compiler-bean)
        runtime-bean (ManagementFactory/getRuntimeMXBean)
        input-args    (.getInputArguments runtime-bean)]

    (when-let [arg (and (re-find #"Tiered" compiler-name)
                        (some #(re-find #"TieredStopAtLevel=1" %)
                              input-args))]
      (println
       (fs "**********************************************************
            WARNING: JVM argument TieredStopAtLevel=1 is active, and may
            lead to reduced performance. This happens to currently be
            the default lein setting:

            https://github.com/technomancy/leiningen/pull/1230

            If you didn't intend this JVM arg to be specified, you can
            turn it off in your project.clj file or your global
            ~/.lein/profiles.clj file by adding the key-val

            :jvm-opts ^:replace []
              **********************************************************")))))


(defn immigrate-overtone-api []
  (immigrate
   'overtone.osc
   'overtone.algo.chance
   'overtone.algo.scaling
   'overtone.algo.trig
   'overtone.algo.fn
   'overtone.config.store
   'overtone.sc.bindings
   'overtone.sc.buffer
   'overtone.sc.bus
   'overtone.sc.envelope
   'overtone.sc.example
   'overtone.sc.info
   'overtone.sc.node
   'overtone.sc.sample
   'overtone.sc.server
   'overtone.sc.synth
   'overtone.sc.ugens
   'overtone.sc.defcgen
   'overtone.sc.foundation-groups
{'fraction_non_alphanumeric': 0.1126360624704212, 'fraction_numerical': 0.003312825366777094, 'mean_word_length': 2.3843074459567655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4513333', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1238, 'n_words': 313}