kneasle / wheatley

An AI for Ringing Room that can ring any number of bells to increase the scope of practices.
https://pypi.org/project/wheatley/
MIT License
15 stars 13 forks source link

Allow inlining calls into `--place-notation` #194

Open kneasle opened 3 years ago

kneasle commented 3 years ago

Something like putting calls in ()s in front of the first place notation they affect. E.g.:

I hope this will fill the gap of people wanting to ring false practice night touches - it's very very flexible (if you don't mind feeding Wheatley loads of place notation) but isn't too complex to implement. Anything longer than a practice touch can be put into CompLib.

centreboard commented 3 years ago

I'm struggling to parse your second example, I think it uses , both to separate methods and symmetric method/lead ends.

How about instead of overloading --place-notation we allowed users to specify a file where each line is a row, optionally followed by calls. That could be very flexible, e.g. jump changes become trivial or you could write out call changes. We'd need to work out when calls are made relative to the place in the file (start / end of row, preceding row?)

12345678 'Go Cambridge'
21436587
12463857
21648375
26143857
62418375
62148735
26417853
62471835
aajshaw commented 3 years ago

If you go with a a file approach then you may want to consider an approach that I used in a bot that I developed RingingRon that has a GUI that allows selecting of methods and extents.

The methods are specified as places up to the point where a Bob or Single can be called, then the places that are the plain, Bob or Single are specified in separate sections. The extents that can be played are in individual sections. As you can probably guess this is really just a config file and the following is an example for Plain Bob Triples:

[INFO]
name=Plain Bob Triples
bells=7
coverable=Yes

[TRACKS]
1:2 3 4 5 6 7 7 6 5 4 3 2
2:1 1 2 3 4 5 6 7 7 6 5 4
3:4 5 6 7 7 6 5 4 3 2 1 1
4:3 2 1 1 2 3 4 5 6 7 7 6
5:6 7 7 6 5 4 3 2 1 1 2 3
6:5 4 3 2 1 1 2 3 4 5 6 7
7:7 6 5 4 3 2 1 1 2 3 4 5

[PLAIN]
1:2 2
2:1 1
3:4 3
4:3 4
5:6 5
6:5 6
7:7 7

[BOB]
1:2 3
2:1 1
3:4 4
4:3 2
5:6 5
6:5 6
7:7 7

[SINGLE]
1: 2 2
2:1 1
3:4 4
4:3 3
5:6 5
6:5 6
7:7 7

[EXTENT-1]
NAME:Plain Course
LENGTH:84
DEFINITION:PPPPPP

[EXTENT-2]
NAME:Touch of 56 BBBB
LENGTH:56
DEFINITION:BBBB

[EXTENT-3]
NAME:Touch of 56 SBBS
LENGTH:56
DEFINITION:SBBS

[EXTENT-4]
NAME:Touch of 56 SSSS
LENGTH:56
DEFINITION:SSSS

[EXTENT-5]
NAME:Touch of 112 PPBBPPBB
LENGTH:112
DEFINITION:PPBBPPBB

[EXTENT-6]
NAME:Touch of 112 PPSSPPSS
LENGTH:112
DEFINITION:PPSSPPSS

[EXTENT-7]
NAME:Touch of 112 PBSBPSBB
LENGTH:112
DEFINITION:PBSBPSBB

[EXTENT-8]
NAME:Touch of 112 PBSBPSBB shuffled
LENGTH:112
MUTABLE:Yes
DEFINITION:PBSBPSBB

[EXTENT-9]
NAME:Five part quarter
LENGTH:1260
DEFINITION:BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB

[EXTENT-10]
NAME:Five part quarter shuffled
LENGTH:1260
MUTABLE:Yes
DEFINITION:BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB BPPPBBPPPPPBPPPPPB

The idea of the MUTABLE flag in the EXTENT-x sections is so that the Bobs and Singles are not always in the same places, it forced me to not just learn a line :-)

I think the this could be applied to Wheatly by having a command line option to specify the extent to be played -EXTENT PBSBPSBB and if necessary load the definition of the method either as we currently do or by specifying the method definition in a file -METHOD_DEFINITION PlainBobTriples.mdf.

I would be happy to have a go at this or alternatively make changes to RingingRon.

centreboard commented 3 years ago

Interesting, so your format in [TRACKS] is the place each bell is in each row. How would you extend this to ringing spliced with multiple methods?

For a single method you can already give Wheatley a method name / place notation + what a bob & single look like. We could add --calls PBSBPSBB argument to have Wheatley call a touch of it instead of listening to Bobs/Singles from RingingRoom.

aajshaw commented 3 years ago

In hindsight [TRACKS] probably should have been [PLACES], in my defence I did not know some of the terminology when I started developing the original simulator that RingingRon was based on :-) and as you rightly point out there is no apparent way to extent it to ringing spliced methods.

It would seem that I have got hold of the wrong end of the stick as I did not realise that the idea was to splice methods, and as you rightly point out a --calls argument for Wheatly would give the same functionality as RingingRon