Exemplo n.º 1
0
def make_telemetry():
    zones = [
        {
            'name': ['sparse'],
            'register': (7, 10),
            'density': (1, 2),
            'harmonicity': (1, 10),
            'roughness': (1, 5),
            'pace': (1, 3)
        }, {
            'name': ['gentle'],
            'register': (3, 7),
            'density': (3, 8),
            'harmonicity': (8, 10),
            'roughness': (1, 2),
            'pace': (1, 3)
        }, {
            'name': ['ballsout'],
            'register': (1, 10),
            'density': (2, 10),
            'harmonicity': (1, 10),
            'roughness': (4, 10),
            'pace': (3, 10)
        }, {
            'name': ['upbeat'],
            'register': (5, 8),
            'density': (1, 8),
            'harmonicity': (8, 10),
            'roughness': (2, 4),
            'pace': (4, 7)
        }
    ]

    dsp.log('generating telemetry...')

    numsections = dsp.randint(10, 20)
    sections = []

    for s in range(numsections):
        zone = dsp.randchoose(zones)
        section = make_section(zone)
        sections += section

        # Transition
        if dsp.rand(0, 100) > 20:
            next_zone = dsp.randchoose(zones)

            if next_zone['name'] != zone['name']:
                next_section = make_section(next_zone)

                transition_zone = {
                    'name': ['transition', section[-1]['name'][0], next_section[0]['name'][0]],
                    'register': (section[-1]['register'], next_section[0]['register']),
                    'density': (section[-1]['density'], next_section[0]['density']),
                    'harmonicity': (section[-1]['harmonicity'], next_section[0]['harmonicity']),
                    'roughness': (section[-1]['roughness'], next_section[0]['roughness']),
                    'pace': (section[-1]['pace'], next_section[0]['pace']),
                }

                transition_section = make_section(transition_zone)

                sections += transition_section
                sections += next_section

    dsp.log('telemetry generated')
    settings.shared('tel', sections)
Exemplo n.º 2
0
def make_telemetry():
    zones = [
        {
            "name": ["sparse"],
            "register": (7, 10),
            "density": (1, 2),
            "harmonicity": (1, 10),
            "roughness": (1, 5),
            "pace": (1, 3),
        },
        {
            "name": ["gentle"],
            "register": (3, 7),
            "density": (3, 8),
            "harmonicity": (8, 10),
            "roughness": (1, 2),
            "pace": (1, 3),
        },
        {
            "name": ["ballsout"],
            "register": (1, 10),
            "density": (2, 10),
            "harmonicity": (1, 10),
            "roughness": (4, 10),
            "pace": (3, 10),
        },
        {
            "name": ["upbeat"],
            "register": (5, 8),
            "density": (1, 8),
            "harmonicity": (8, 10),
            "roughness": (2, 4),
            "pace": (4, 7),
        },
        {
            "name": ["upbeat"],
            "register": (5, 8),
            "density": (1, 8),
            "harmonicity": (8, 10),
            "roughness": (2, 4),
            "pace": (4, 7),
        },
    ]

    dsp.log("generating telemetry...")

    numsections = dsp.randint(10, 20)
    sections = []

    for s in range(numsections):
        zone = dsp.randchoose(zones)
        section = make_section(zone)
        sections += section

        # Transition
        if dsp.rand(0, 100) > 20:
            next_zone = dsp.randchoose(zones)

            if next_zone["name"] != zone["name"]:
                next_section = make_section(next_zone)

                transition_zone = {
                    "name": ["transition", section[-1]["name"][0], next_section[0]["name"][0]],
                    "register": (section[-1]["register"], next_section[0]["register"]),
                    "density": (section[-1]["density"], next_section[0]["density"]),
                    "harmonicity": (section[-1]["harmonicity"], next_section[0]["harmonicity"]),
                    "roughness": (section[-1]["roughness"], next_section[0]["roughness"]),
                    "pace": (section[-1]["pace"], next_section[0]["pace"]),
                }

                transition_section = make_section(transition_zone)

                sections += transition_section
                sections += next_section

    dsp.log("telemetry generated")
    settings.shared("tel", sections)
Exemplo n.º 3
0
def getTel():
    tel = json.loads(settings.shared('tel'))
    count = int(settings.shared('count'))
    tel = tel[count % len(tel)]

    return tel
Exemplo n.º 4
0
def getTel():
    tel = json.loads(settings.shared("tel"))
    count = int(settings.shared("count"))
    tel = tel[count % len(tel)]

    return tel