pyquist 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {pyquist-0.2.3/pyquist.egg-info → pyquist-0.2.4}/PKG-INFO +1 -1
  2. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/__init__.py +1 -1
  3. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/cli.py +16 -4
  4. {pyquist-0.2.3 → pyquist-0.2.4/pyquist.egg-info}/PKG-INFO +1 -1
  5. {pyquist-0.2.3 → pyquist-0.2.4}/LICENSE +0 -0
  6. {pyquist-0.2.3 → pyquist-0.2.4}/README.md +0 -0
  7. {pyquist-0.2.3 → pyquist-0.2.4}/pyproject.toml +0 -0
  8. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/audio.py +0 -0
  9. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/audio_test.py +0 -0
  10. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/device.py +0 -0
  11. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/device_test.py +0 -0
  12. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/helper.py +0 -0
  13. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/helper_test.py +0 -0
  14. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/paths.py +0 -0
  15. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/plot.py +0 -0
  16. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/plot_test.py +0 -0
  17. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/py.typed +0 -0
  18. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/score.py +0 -0
  19. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/score_test.py +0 -0
  20. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/test_data/232009__danmitch3ll__xylophone-sweep.wav +0 -0
  21. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/test_data/388954__fullmetaljedi__blues-riff-in-g-nylon.wav +0 -0
  22. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/test_data/434013__mrpearch__drum-patern.mp3 +0 -0
  23. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/test_data/ATTRIBUTION.md +0 -0
  24. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/test_data/ravel_bolero.mid +0 -0
  25. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/web/__init__.py +0 -0
  26. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/web/freesound.py +0 -0
  27. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist/web/theorytab.py +0 -0
  28. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist.egg-info/SOURCES.txt +0 -0
  29. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist.egg-info/dependency_links.txt +0 -0
  30. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist.egg-info/entry_points.txt +0 -0
  31. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist.egg-info/requires.txt +0 -0
  32. {pyquist-0.2.3 → pyquist-0.2.4}/pyquist.egg-info/top_level.txt +0 -0
  33. {pyquist-0.2.3 → pyquist-0.2.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyquist
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Barebones utilities for low-level computer music programming in Python and NumPy. Teaching library for CMU 15-322.
5
5
  Author: Chris Donahue
6
6
  License-Expression: MIT
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.3"
1
+ __version__ = "0.2.4"
2
2
 
3
3
  from .audio import Audio
4
4
  from .device import (
@@ -22,9 +22,11 @@ from .web.freesound import fetch_freesound
22
22
 
23
23
 
24
24
  def _cmd_devices(args: argparse.Namespace) -> None:
25
- del args
26
- set_input_device(update_default=True)
27
- set_output_device(update_default=True)
25
+ # No kind given means both, one after the other.
26
+ if args.kind in (None, "in"):
27
+ set_input_device(update_default=True)
28
+ if args.kind in (None, "out"):
29
+ set_output_device(update_default=True)
28
30
  print("Saved as default for future pyquist sessions.")
29
31
 
30
32
 
@@ -32,7 +34,7 @@ def _cmd_play(args: argparse.Namespace) -> None:
32
34
  # "test" is a shorthand for the bundled sample, so users can check that
33
35
  # audio output works without having an audio file on hand.
34
36
  if args.input.strip().lower() == "test":
35
- audio = Audio.from_file(TEST_SOUND).segment(duration=1.0)
37
+ audio = Audio.from_file(TEST_SOUND).as_mono().segment(duration=1.0)
36
38
  audio *= np.linspace(1.0, 0.0, audio.num_samples)[:, np.newaxis]
37
39
  else:
38
40
  audio = Audio.from_file(args.input)
@@ -71,6 +73,16 @@ def _build_parser() -> argparse.ArgumentParser:
71
73
  p_devices = subparsers.add_parser(
72
74
  "devices", help="Interactively select default input and output devices."
73
75
  )
76
+ p_devices.add_argument(
77
+ "kind",
78
+ nargs="?",
79
+ type=lambda s: {"input": "in", "output": "out"}.get(s.lower(), s.lower()),
80
+ choices=["in", "out"],
81
+ help=(
82
+ "Select only the input ('in' / 'input') or only the output "
83
+ "('out' / 'output') device. Omit to select both."
84
+ ),
85
+ )
74
86
  p_devices.set_defaults(func=_cmd_devices)
75
87
 
76
88
  p_play = subparsers.add_parser("play", help="Play an audio file.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyquist
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Barebones utilities for low-level computer music programming in Python and NumPy. Teaching library for CMU 15-322.
5
5
  Author: Chris Donahue
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes