hello_world_contexts

Hello, world!, context-agnostic.

Let’s play a C-major chord with different kinds of contexts, and compare what needs to change between them, and what can stay the same.

Invoke with:

josephine@laptop:~/supriya$ python -m examples.hello_world_contexts --help
usage: __main__.py [-h] (--realtime-threaded | --realtime-async |
                   --nonrealtime)

Play a C-major chord via different kinds of contexts

options:
  -h, --help           show this help message and exit
  --realtime-threaded  use a realtime threaded Server
  --realtime-async     use a realtime asyncio-enabled AsyncServer
  --nonrealtime        use a non-realtime Score

… to see complete options.

See the example documentation for a complete explanation.

main(args: list[str] | None = None) None

The example entry-point function.

parse_args(args: list[str] | None = None) Namespace

Parse CLI arguments.

play_synths(context: Context) list[Synth]

Play a C-major chord on context.

async run_async() None

Run the example on an realtime async AsyncServer.

run_nonrealtime() None

Run the example on a non-realtime Score.

run_threaded() None

Run the example on a realtime threaded Server.

stop_synths(synths: list[Synth]) None

Stop synths.