<commit_before>homepage: http://www.haskell.org/haskellwiki/Live-Sequencer
changelog-type: text
hash: 79b68740b693133943f9499a72990bc634ce5ff5cc66f91064b3d3ada64e6f7f
test-bench-deps: {}
maintainer: <NAME> <<EMAIL>>, <NAME>
  <<EMAIL>>
synopsis: Live coding of MIDI music
changelog: ! "0.0.5:\n\n* uniform singular names for modules\n\n  data/Controls ->
  data/Controller\n  data/Chords -> data/Chord\n"
basic-deps:
  explicit-exception: ! '>=0.1.5 && <0.2'
  bytestring: ! '>=0.9 && <0.11'
  wx: ! '>=0.12.1 && <0.93'
  unix: ! '>=2.4 && <2.8'
  stm: ! '>=2.2 && <2.5'
  base: ! '>=4.2 && <5'
  midi-alsa: ==0.2.*
  event-list: ! '>=0.0.11 && <0.2'
  strict: ! '>=0.3.2 && <0.4'
  httpd-shed: ! '>=0.4 && <0.5'
  filepath: ! '>=1.1 && <1.5'
  process: ! '>=1.0 && <1.5'
  network: ! '>=2.6 && <2.7'
  parsec: ! '>=2.1 && <3.2'
  data-accessor-transformers: ! '>=0.2.1 && <0.3'
  midi: ! '>=0.2.1 && <0.3'
  utility-ht: ! '>=0.0.8 && <0.1'
  containers: ! '>=0.3 && <0.6'
  data-accessor: ! '>=0.2.1 && <0.3'
  wxcore: ! '>=0.13.2 && <0.93'
  concurrent-split: ==0.0.*
  non-empty: ! '>=0.2 && <0.4'
  alsa-seq: ==0.6.*
  cgi: ! '>=3001.1 && <3001.4'
  network-uri: ! '>=2.6 && <2.7'
  stm-split: ! '>=0.0 && <0.1'
  html: ! '>=1.0 && <1.1'
  transformers: ! '>=0.2.2 && <0.6'
  pretty: ! '>=1.0 && <1.2'
  alsa-core: ==0.5.*
  non-negative: ! '>=0.0.6 && <0.2'
  directory: ! '>=1.0 && <1.4'
all-versions:
- '0.0'
- '0.0.1'
- '0.0.2'
- '0.0.3'
- '0.0.3.1'
- '0.0.4'
- '0.0.5'
- '0.0.5.1'
- '0.0.5.2'
- '0.0.6'
author: <NAME> and <NAME>
latest: '0.0.6'
description-type: markdown
description: ! "# Example usage\n\nThe live-sequencer does not make music itself,\nits
  entire task is to control other software or hardware synthesizers.\nThat is, in
  order to hear something you need a working MIDI synthesizer\nsuch as the sampling
  based software synthesizer TiMidity.\nYou may run TiMidity and the live-sequencer
  this way:\n\n~~~~\ntimidity -iA &\nlive-sequencer-gui --connect-to TiMidity Simplesong
  &\n~~~~\n\nThis should give you an ongoing stream of notes.\nThen change one of
  the numbers\nthat appear in the lines like\n`qn = 300`\nand press CTRL-R for \"reloading\"
  that module into the interpreter.\nThis should immediately have an effect,\nnamely
  increasing the tempo of the melody.\nYou may also alter a note name like `c 4` to
  `cis 4`, then reload,\nthen undo the modification and reload, again, after a while.\nThis
  is the main idea of changing the song while it is playing.\nThe way the changes
  are applied warrants\nthat the change takes effect when the time comes.\nMusic is
  not interrupted and\ndoes not need to be restarted for reacting to changes.\n\nThe
  overall task performed by the sequencer\nis to lazily evaluate a term called `main`\nthat
  is a list of events.\nThe value of `main` is a stream of midi events\n(`On/Off pitch
  velocity`, `PgmChange`, `Controller`)\nor (`Wait milliseconds`).\nYou may wrap a
  MIDI event in a `Channel` constructor\nin order to assign the event to the particular
  MIDI channel.\nIf you omit this constructor then the event is put to channel 0.\n\nIn
  each step, the head of the `main` stream gets reduced\nto head normal form (with
  `:` at the top),\nand the first arg of the `:` gets fully expanded\nand it must
  be a MIDI event.\n\n# Input language\n\nThe used language is syntactically almost
  a subset of Haskell with\nonly strict pattern matching and\npattern matching only
  at the definition level (no case),\nno local bindings (no lambda, let, where),\nno
  types (no type inference, type signatures and type declarations are skipped),\nand
  with diet syntax (i.e. drastically reduced syntactic sugar,\nlike no layout rule,
  no do syntax, no list comprehension, no operator sections).\n\nSemantics is similar
  to lazy evaluation,\nbut we have no sharing.\nThe design goal is that code can be
  changed\nwhile the program is running.\nThis implies that evaluation of one expression\nmay
  give different results at different times\n(e.g., during a live performance,\none
  changes some chords of a musical theme).\nIn turn, this implies that we do not store\nand
  share results of evaluations,\nhence, we don't have local bindings.\n\nYou may import
  and use\nthe special functions 'Controller.checkBox', 'Controller.slider'\nfrom
  the \"Controller\" module.\nFor every call to these functions a widget is added
  to the control window\nand the state of the widget is the result of the function
  call.\nTechnically every change of these widgets\ninternally adds or updates a rule
  in the \"Controller\" module.\nThe effect is very similar to updating a value definition
  in a module\nand then reloading that module to the interpreter,\nbut using the widgets
  is more intuitive.\n\n# Offline rendering\n\nIn the library interface of this package\nwe
  provide the basic Live-Sequencer modules\nin order to allow offline rendering of
  music\nthat you programmed within the Live-Sequencer.\nYou may generate a standard
  MIDI file\nusing functions from the \"Render\" module.\nTo this end load your song
  module into GHCi and call\n\n~~~~\nYourModule> Render.writeStream \"yoursong.mid\"
  yourSong\n~~~~\n\n# HTTP access\n\nYou may open a browser and view all modules under\n<http://localhost:8080/>.\nIf
  the user of the GUI inserts comments like this one:\n\n~~~~\n----------------\n~~~~\n\n,
  then it is possible to modify the content below this mark via HTTP.\nThis way multiple
  people can participate in the composition process.\nThe recommended situation is
  a room\nwith a data projector and a loudspeaker,\nwhere the conductor explains the
  functions to the auditory\nand the participants can watch the screen and listen
  to the music.\n\nYou may choose any other port using the command line option `--http-port`.\nIf
  you want to use a system port like the standard HTTP port 80,\nwe recommend to configure
  a firewall to redirect the external port 80\nto the internal user port.\nWe discourage
  from starting the live-sequencer as root user.\nYou may disable the HTTP server
  altogether\nby compiling with `cabal install -f-httpServer`.\n\n# Execution modes\n\nThere
  are three modes of execution\nthat you can choose from the `Execution` menu:\n\n*
  Real-time:\n  This is the mode for musical live performances.\n  The interpreter
  waits according to the `Wait` elements in the main list.\n\n* Slow motion:\n  This
  mode is for demonstration and debugging.\n  You can alter the speed using `CTRL-<`
  and `CTRL->`.\n\n* Single step:\n  This mode is for demonstration, debugging and
  as a pause mode,\n  when the interpreter reaches the end of the main list.\n  You
  can trigger evaluation of the next element using `CTRL-N`.\n  You can perform a
  single reduction with `CTRL-U`,\n  which also highlights the rule that will be applied
  next.\n  Changes to the program are only respected\n  when an element is completely
  reduced and sent via MIDI.\n  Unfortunately it is currently not possible to undo
  a step.\n\n# Editing\n\nYou can change a module name by altering the module identifier\nbetween
  the `module` and `where` keywords\nand then triggering module reload.\nThe same
  way you can load new modules\nby adding import lines and reloading the module.\nAlternatively,
  you may create new modules or close old ones\nusing functions from the `File` menu.\n\nFor
  composition it is useful to play parts of the music.\nYou can do this by simply
  placing the cursor within an identifier\nor by marking an expression\nand then call
  `Play term` from the `Execution` menu.\nThis will make the marked expression the
  current term\nand start playing.\n\nOnce the music is playing you can change it\nby
  altering the module and reload it.\nHowever you may find out\nthat you cannot do
  a certain modification this way.\nIn this case you can mark an expression\nthat
  denotes a stream transformation function\nand call the `Apply term` menu item.\nThis
  will apply the marked function to the current term.\nUseful functions are:\n\n*
  `merge newTrack` for adding a new track simultaneously.\n  However, mind the latency!\n\n*
  `flip append newTrack` for appending some events to the current music.\n\n* `dropTime
  time` for skipping a part of the music.\n  However this may skip some `Off` events
  and this yields hanging tones.\n  Additionally you may exceed the number of maximally
  allowed reductions.\n\n* `skipTime time` for skipping a part of the music.\n  This
  one only removes or shortens `Wait` constructors.\n  Thus all events are played
  but you risk exceeding the limit\n  for playing many events at once.\n\n* `compressTime
  acceleration time` for accelerating the music for a certain time.\n  This should
  circumvent the problems of `dropTime` and `skipTime`.\n\n# Limits\n\nWithout some
  safety belts it would be very easy\nto consume all memory or all processing power\nby
  accident or by people who contribute malicious code via HTTP.\nThus we have added
  some limits.\nThese have reasonable default values\nbut you can adjust them to your
  needs via command line options at startup.\nThese are the limits you can set:\n\n*
  maximum number of reduction steps per list element:\n  With this limit you can prevent
  infinite loops.\n\n* term size:\n  With this limit you can prevent memory leaks.\n
  \ You may also hit the limit if you write a whole song in a big list.\n  Better
  split the list up into sections\n  and define a function for each section.\n\n*
  term depth:\n  With this limit you can prevent unbalanced expression trees.\n  Unbalanced
  trees do not consume more memory than balanced ones,\n  but they consume considerably
  more graphical space on pretty-printing.\n\n* maximum number of events per time
  period:\n  If your song is too fast or does not contain any `Wait` elements at all,\n
  \ your machine will run out of processing power.\n  Thus you can restrict the number
  of events\n  generated in a certain period of time.\n  It is controlled by two options:\n
  \ `--event-period` sets the time period in milliseconds\n  whereas `--max-events-per-period`\n
  \ sets the maximum number of events within this time period.\n  In principle you
  can consider this a ratio\n  but you cannot simply cancel it.\n  E.g. both `--event-period=100
  --max-events-per-period=15`\n  and `--event-period=1000 --max-events-per-period=150`\n
  \ describe the same ratio,\n  the difference is how liberal is the sequencer\n  with
  respect to exceeding the ratio for a short time.\n  Read the first setting as:\n
  \ \"For 15 adjacent events,\n  the duration between the first and the last one must
  be at least 100ms.\"\n  That is, if you emit 20 events simultaneously every second,\n
  \ then the first setting will forbid this,\n  and the second setting will allow
  it.\n  Thus we recommend to first set `--max-events-per-period`\n  to the number
  of events that you want to emit simultaneously\n  and then set `--event-period`
  large enough\n  to match the power of your machine.\n\n# ALSA\n\nUsing the `--new-out-port`
  option\nyou may add more ALSA MIDI ports.\nEvery port extends the range of MIDI
  channels by 16 new logical channels.\nThat is `Channel 40 ev` sends an event\nto
  MIDI channel 8 at the second newly added ALSA port\n(because 40 = 2*16+8).\nEvery
  `--connect-to` option refers to the latest added port.\nExample:\n\n~~~~\nlive-sequencer
  --connect-to Synth0 --new-out-port out1 --connect-to Synth1 --new-out-port out2
  --connect-to Synth2\n~~~~\n\nYou do not need to connect to any synthesizer at startup.\nYou
  may connect or disconnect the live-sequencer\nto any synthesizer once it is running\nusing
  `aconnect` (command line) or\n`kaconnect`, `alsa-patch-bay`, `patchage` (graphical
  interfaces).\n\nThe live-sequencer itself can be controlled to some extent.\nYou
  may start the live-sequencer this way\n\n~~~~\nlive-sequencer --connect-from YourMidiController\n~~~~\n\nor
  connect to it once it is running.\nThis enables the following functions:\n\n* If
  you press a key on your MIDI keyboard named YourMidiController,\n  then the according
  note name is inserted in the current module.\n  However, note durations cannot be
  preserved\n  and velocities are ignored, as well.\n  Thus don't expect that the
  live-sequencer captures complex songs,\n  this function is just intended as assistance
  for note input.\n\n* You can control execution of the live-sequencer\n  using MIDI
  Machine Control SysEx messages.\n  Some MIDI controller keyboards have transportation
  buttons\n  that support those messages.\n\nThe supported MMC commands are:\n\n*
  RECORD STROBE:\n  Toggle between receiving and ignoring note input from MIDI keyboard\n\n*
  PLAY: Restart the interpreter\n\n* STOP: Halt the interpreter and turn sound off\n\n*
  PAUSE: Toggle between real time and single step mode\n\n* FAST FORWARD: Next element
  in single step mode\n\n# Tips & Tricks\n\n## Append with overlap\n\nThe `(+:+)`
  operator can only handle precise concatenation of event streams.\nHowever, in common
  music you also have to handle upbeats and legato.\nTechnically, this means that
  there may be events before and after a core part.\nFirst, let us consider the case
  where there are events after the core part.\nWe define a `Block` data structure
  containing two or more parallel `Track`s.\nFor simplicity we now use only two tracks:\n\n~~~~\ntype
  Track = [Event Message] ;\ndata Block = Block Track Track ;\n~~~~\n\nThe first track
  specifies the length of the block. It cannot overlap.\nIf you have no other use
  for it, fill it with rests.\nThe second track can be shorter or longer than the
  first track.\nEverything longer will be merged with subsequent `Block`s.\nThis is,
  how we convert a sequence of overlapping blocks\nto a plain `Event` stream:\n\n~~~~\nconsBlock<commit_msg>Update from Hackage at 2018-01-12T22:23:21Z<commit_after>homepage: http://www.haskell.org/haskellwiki/Live-Sequencer
changelog-type: markdown
hash: 0b2bcc530b2016d379ea5f8bc529ce0cdc4cbb82c8831899533137773ab533c2
test-bench-deps: {}
maintainer: <NAME> <<EMAIL>>, <NAME>
  <<EMAIL>>
synopsis: Live coding of MIDI music
changelog: ! "# Change log for the `live-sequencer` package\n\n## 0.0.6.1:\n\n *  Do
  not highlight terms anymore if they were from outdated module contents.\n    This
  also avoids warnings by GTK about highlighting invalid text positions.\n    Internally
  solved by using module versions.\n\n## 0.0.6:\n\n *  adapt to wxwidgets-3.0\n\n##
  0.0.5:\n\n *  uniform singular names for modules\n\n    data/Controls -> data/Controller\n
  \   data/Chords -> data/Chord\n"
basic-deps:
  explicit-exception: ! '>=0.1.9 && <0.2'
  bytestring: ! '>=0.9 && <0.11'
  wx: ! '>=0.12.1 && <0.93'
  unix: ! '>=2.4 && <2.8'
  stm: ! '>=2.2 && <2.5'
  base: ! '>=4.2 && <5'
  midi-alsa: ==0.2.*
  event-list: ! '>=0.0.11 && <0.2'
  strict: ! '>=0.3.2 && <0.4'
  httpd-shed: ! '>=0.4 && <0.5'
  process: ! '>=1.0 && <1.5'
  network: ! '>=2.6 && <2.7'
  parsec: ! '>=2.1 && <3.2'
  data-accessor-transformers: ! '>=0.2.1 && <0.3'
  midi: ! '>=0.2.1 && <0.3'
  utility-ht: ! '>=0.0.8 && <0.1'
  containers: ! '>=0.3 && <0.6'
  data-accessor: ! '>=0.2.1 && <0.3'
  wxcore: ! '>=0.13.2 && <0.93'
  concurrent-split: ==0.0.*
  non-empty: ! '>=0.2 && <0.4'
  alsa-seq: ==0.6.*
  cgi: ! '>=3001.1 && <3001.4'
  network-uri: ! '>=2.6 && <2.7'
  stm-split: ! '>=0.0 && <0.1'
  html: ! '>=1.0 && <1.1'
  pathtype: ! '>=0.8.1 && <0.9'
  transformers: ! '>=0.2.2 && <0.6'
  pretty: ! '>=1.0 && <1.2'
  alsa-core: ==0.5.*
  non-negative: ! '>=0.0.6 && <0.2'
all-versions:
- '0.0'
- '0.0.1'
- '0.0.2'
- '0.0.3'
- '0.0.3.1'
- '0.0.4'
- '0.0.5'
- '0.0.5.1'
- '0.0.5.2'
- '0.0.6'
- '0.0.6.1'
author: <NAME> and <NAME>
latest: '0.0.6.1'
description-type: markdown
description: ! "# Example usage\n\nThe live-sequencer does not make music itself,\nits
  entire task is to control other software or hardware synthesizers.\nThat is, in
  order to hear something you need a working MIDI synthesizer\nsuch as the sampling
  based software synthesizer TiMidity.\nYou may run TiMidity and the live-sequencer
  this way:\n\n~~~~\ntimidity -iA &\nlive-sequencer-gui --connect-to TiMidity Simplesong
  &\n~~~~\n\nThis should give you an ongoing stream of notes.\nThen change one of
  the numbers\nthat appear in the lines like\n`qn = 300`\nand press CTRL-R for \"reloading\"
  that module into the interpreter.\nThis should immediately have an effect,\nnamely
  increasing the tempo of the melody.\nYou may also alter a note name like `c 4` to
  `cis 4`, then reload,\nthen undo the modification and reload, again, after a while.\nThis
  is the main idea of changing the song while it is playing.\nThe way the changes
  are applied warrants\nthat the change takes effect when the time comes.\nMusic is
  not interrupted and\ndoes not need to be restarted for reacting to changes.\n\nThe
  overall task performed by the sequencer\nis to lazily evaluate a term called `main`\nthat
  is a list of events.\nThe value of `main` is a stream of midi events\n(`On/Off pitch
  velocity`, `PgmChange`, `Controller`)\nor (`Wait milliseconds`).\nYou may wrap a
  MIDI event in a `Channel` constructor\nin order to assign the event to the particular
  MIDI channel.\nIf you omit this constructor then the event is put to channel 0.\n\nIn
  each step, the head of the `main` stream gets reduced\nto head normal form (with
  `:` at the top),\nand the first arg of the `:` gets fully expanded\nand it must
  be a MIDI event.\n\n# Input language\n\nThe used language is syntactically almost
  a subset of Haskell with\nonly strict pattern matching and\npattern matching only
  at the definition level (no case),\nno local bindings (no lambda, let, where),\nno
  types (no type inference, type signatures and type declarations are skipped),\nand
  with diet syntax (i.e. drastically reduced syntactic sugar,\nlike no layout rule,
  no do syntax, no list comprehension, no operator sections).\n\nSemantics is similar
  to lazy evaluation,\nbut we have no sharing.\nThe design goal is that code can be
  changed\nwhile the program is running.\nThis implies that evaluation of one expression\nmay
  give different results at different times\n(e.g., during a live performance,\none
  changes some chords of a musical theme).\nIn turn, this implies that we do not store\nand
  share results of evaluations,\nhence, we don't have local bindings.\n\nYou may import
  and use\nthe special functions 'Controller.checkBox', 'Controller.slider'\nfrom
  the \"Controller\" module.\nFor every call to these functions a widget is added
  to the control window\nand the state of the widget is the result of the function
  call.\nTechnically every change of these widgets\ninternally adds or updates a rule
  in the \"Controller\" module.\nThe effect is very similar to updating a value definition
  in a module\nand then reloading that module to the interpreter,\nbut using the widgets
  is more intuitive.\n\n# Offline rendering\n\nIn the library interface of this package\nwe
  provide the basic Live-Sequencer modules\nin order to allow offline rendering of
  music\nthat you programmed within the Live-Sequencer.\nYou may generate a standard
  MIDI file\nusing functions from the \"Render\" module.\nTo this end load your song
  module into GHCi and call\n\n~~~~\nYourModule> Render.writeStream \"yoursong.mid\"
  yourSong\n~~~~\n\n# HTTP access\n\nYou may open a browser and view all modules under\n<http://localhost:8080/>.\nIf
  the user of the GUI inserts comments like this one:\n\n~~~~\n----------------\n~~~~\n\n,
  then it is possible to modify the content below this mark via HTTP.\nThis way multiple
  people can participate in the composition process.\nThe recommended situation is
  a room\nwith a data projector and a loudspeaker,\nwhere the conductor explains the
  functions to the auditory\nand the participants can watch the screen and listen
  to the music.\n\nYou may choose any other port using the command line option `--http-port`.\nIf
  you want to use a system port like the standard HTTP port 80,\nwe recommend to configure
  a firewall to redirect the external port 80\nto the internal user port.\nWe discourage
  from starting the live-sequencer as root user.\nYou may disable the HTTP server
  altogether\nby compiling with `cabal install -f-httpServer`.\n\n# Execution modes\n\nThere
  are three modes of execution\nthat you can choose from the `Execution` menu:\n\n*
  Real-time:\n  This is the mode for musical live performances.\n  The interpreter
  waits according to the `Wait` elements in the main list.\n\n* Slow motion:\n  This
  mode is for demonstration and debugging.\n  You can alter the speed using `CTRL-<`
  and `CTRL->`.\n\n* Single step:\n  This mode is for demonstration, debugging and
  as a pause mode,\n  when the interpreter reaches the end of the main list.\n  You
  can trigger evaluation of the next element using `CTRL-N`.\n  You can perform a
  single reduction with `CTRL-U`,\n  which also highlights the rule that will be applied
  next.\n  Changes to the program are only respected\n  when an element is completely
  reduced and sent via MIDI.\n  Unfortunately it is currently not possible to undo
  a step.\n\n# Editing\n\nYou can change a module name by altering the module identifier\nbetween
  the `module` and `where` keywords\nand then triggering module reload.\nThe same
  way you can load new modules\nby adding import lines and reloading the module.\nAlternatively,
  you may create new modules or close old ones\nusing functions from the `File` menu.\n\nFor
  composition it is useful to play parts of the music.\nYou can do this by simply
  placing the cursor within an identifier\nor by marking an expression\nand then call
  `Play term` from the `Execution` menu.\nThis will make the marked expression the
  current term\nand start playing.\n\nOnce the music is playing you can change it\nby
  altering the module and reload it.\nHowever you may find out\nthat you cannot do
  a certain modification this way.\nIn this case you can mark an expression\nthat
  denotes a stream transformation function\nand call the `Apply term` menu item.\nThis
  will apply the marked function to the current term.\nUseful functions are:\n\n*
  `merge newTrack` for adding a new track simultaneously.\n  However, mind the latency!\n\n*
  `flip append newTrack` for appending some events to the current music.\n\n* `dropTime
  time` for skipping a part of the music.\n  However this may skip some `Off` events
  and this yields hanging tones.\n  Additionally you may exceed the number of maximally
  allowed reductions.\n\n* `skipTime time` for skipping a part of the music.\n  This
  one only removes or shortens `Wait` constructors.\n  Thus all events are played
  but you risk exceeding the limit\n  for playing many events at once.\n\n* `compressTime
  acceleration time` for accelerating the music for a certain time.\n  This should
  circumvent the problems of `dropTime` and `skipTime`.\n\n# Limits\n\nWithout some
  safety belts it would be very easy\nto consume all memory or all processing power\nby
  accident or by people who contribute malicious code via HTTP.\nThus we have added
  some limits.\nThese have reasonable default values\nbut you can adjust them to your
  needs via command line options at startup.\nThese are the limits you can set:\n\n*
  maximum number of reduction steps per list element:\n  With this limit you can prevent
  infinite loops.\n\n* term size:\n  With this limit you can prevent memory leaks.\n
  \ You may also hit the limit if you write a whole song in a big list.\n  Better
  split the list up into sections\n  and define a function for each section.\n\n*
  term depth:\n  With this limit you can prevent unbalanced expression trees.\n  Unbalanced
  trees do not consume more memory than balanced ones,\n  but they consume considerably
  more graphical space on pretty-printing.\n\n* maximum number of events per time
  period:\n  If your song is too fast or does not contain any `Wait` elements at all,\n
  \ your machine will run out of processing power.\n  Thus you can restrict the number
  of events\n  generated in a certain period of time.\n  It is controlled by two options:\n
  \ `--event-period` sets the time period in milliseconds\n  whereas `--max-events-per-period`\n
  \ sets the maximum number of events within this time period.\n  In principle you
  can consider this a ratio\n  but you cannot simply cancel it.\n  E.g. both `--event-period=100
  --max-events-per-period=15`\n  and `--event-period=1000 --max-events-per-period=150`\n
  \ describe the same ratio,\n  the difference is how liberal is the sequencer\n  with
  respect to exceeding the ratio for a short time.\n  Read the first setting as:\n
  \ \"For 15 adjacent events,\n  the duration between the first and the last one must
  be at least 100ms.\"\n  That is, if you emit 20 events simultaneously every second,\n
  \ then the first setting will forbid this,\n  and the second setting will allow
  it.\n  Thus we recommend to first set `--max-events-per-period`\n  to the number
  of events that you want to emit simultaneously\n  and then set `--event-period`
  large enough\n  to match the power of your machine.\n\n* split wait:\n  The interpreter
  cannot be interrupted if it waits\n  in reaction to a `Wait` command.\n  The way
  we implemented the interpreter,\n  an overly long `Wait` duration\n  will still
  allow to stop playing music immediately.\n  However, if you restart the music you
  may still meet the interpreter\n  while waiting for the end of the wait duration.\n
  \ To prevent this situation the interpreter will split a `Wait`\n  if its duration
  is too long.\n  The `--split-wait` option allows you to adjust\n  the maximum allowed
  `Wait` duration.\n\n# ALSA\n\nUsing the `--new-out-port` option\nyou may add more
  ALSA MIDI ports.\nEvery port extends the range of MIDI channels by 16 new logical
  channels.\nThat is `Channel 40 ev` sends an event\nto MIDI channel 8 at the second
  newly added ALSA port\n(because 40 = 2*16+8).\nEvery `--connect-to` option refers
  to the latest added port.\nExample:\n\n~~~~\nlive-sequencer --connect-to Synth0
  --new-out-port out1 --connect-to Synth1 --new-out-port out2 --connect-to Synth2\n~~~~\n\nYou
  do not need to connect to any synthesizer at startup.\nYou may connect or disconnect
  the live-sequencer\nto any synthesizer once it is running\nusing `aconnect` (command
  line) or\n`kaconnect`, `alsa-patch-bay`, `patchage` (graphical interfaces).\n\nThe
  live-sequencer itself can be controlled to some extent.\nYou may start the live-sequencer
  this way\n\n~~~~\nlive-sequencer --connect-from YourMidiController\n~~~~\n\nor connect
  to it once it is running.\nThis enables the following functions:\n\n* If you press
  a key on your MIDI keyboard named YourMidiController,\n  then the according note
  name is inserted in the current module.\n  However, note durations cannot be preserved\n
  \ and velocities are ignored, as well.\n  Thus don't expect that the live-sequencer
  captures complex songs,\n  this function is just intended as assistance for note
  input.\n\n* You can control execution of the live-sequencer\n  using MIDI Machine
  Control SysEx messages.\n  Some MIDI controller keyboards have transportation buttons\n
  \ that support those messages.\n\nThe supported MMC commands are:\n\n* RECORD STROBE:\n
  \ Toggle between receiving and ignoring note input from MIDI keyboard\n\n* PLAY:
  Restart the interpreter\n\n* STOP: Halt the interpreter and turn sound off\n\n*
  PAUSE: Toggle between real time and single step mode\n\n* FAST FORWARD: Next element
  in single step mode\n\n# Tips & Tricks\n\n## Append with overlap\n\nThe `(+:+)`
  operator can only handle precise concatenation of event streams.\nHowever, in common
  music you also have to handle upbeats and legato.\nTechnically, this means that
  there may be events before and after a core part.\nFirst, let us consider the case
  where there are events after the core part.\nWe define a `Block` data structure
  containing two or more parallel `Track`s.\nFor simplicity we now use only two tracks:\n\n~~~~\ntype
  Track = [Event Message] ;\ndata Block = Block Track Track ;\n~~~~\n\nThe first track
  specifies the length of the block. It cannot overlap.\nIf you have no other use
  for it, fill it with rests.\nThe second track can be shorter or longer than the
  first track.\nEverything longer will be merged with subsequent `Block`s.\nThis is,
  how we convert a sequence of overlapping blocks\nto a plain `Event` stream:\n\n~~~~\nconsBlock
{'fraction_non_alphanumeric': 0.09888007790762382, 'fraction_numerical': 0.019720367278797998, 'mean_word_length': 3.5459288537549405, 'pattern_counts': {'":': 0, '<': 78, '<?xml version=': 0, '>': 84, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 9, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6622875', 'n_tokens_mistral': 9132, 'n_tokens_neox': 8720, 'n_words': 3836}