Programs That Sonnet 3.5 Can Make!

#1
by awacke1 - opened

I'm astounded by how well Sonnet 3.5 keeps up at a level of integration that requires thinking about components, files, assets and different technology together. Below are variations of prompts and output apps to test on HuggingFace as next generation programs created using AI Pair Programming (AIPP).

Create an html5 streamlit game of life using aframe and polygons and primitives where the 3d primitives move around in flocks and build buildings and cities when colliding of same type and size. Have them grow when they touch others of same type. Use the interface for st.chat_input and st.chat_message to interact with user and accept commands where with each command once submitted become part of a named chat. Give an input for name and use it in chat allowing user to change name after defaulting it to a common name plus random 2 digit number

Here's an example of an HTML5 Streamlit game of life using A-Frame, polygons, and primitives. In this game, 3D primitives move around in flocks and build buildings and cities when colliding with others of the same type and size. They grow when they touch others of the same type. The user can interact with the game using a chat input, where each command submitted becomes part of a named chat. There's also an input for the user's name, which is used in the chat and can be changed after defaulting to a common name plus a random two-digit number.

<!DOCTYPE html>
<html>
<head>
    <title>Game of Life</title>
    <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/mind-ar@1.2.0/dist/mindar-image.prod.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/mind-ar@1.2.0/dist/mindar-image-aframe.prod.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/streamlit-component-lib@latest/dist/index.js"></script>
</head>
<body>
    <div id="game-container">
        <a-scene embedded arjs="sourceType: webcam; debugUIEnabled: false;">
            <a-assets>
                <a-asset-item id="building-obj" src="building.obj"></a-asset-item>
                <a-asset-item id="city-obj" src="city.obj"></a-asset-item>
            </a-assets>

            <a-entity id="flocks">
                <!-- Flocks of primitives will be added here -->
            </a-entity>

            <a-entity id="buildings">
                <!-- Buildings will be added here -->
            </a-entity>

            <a-entity id="cities">
                <!-- Cities will be added here -->
            </a-entity>

            <a-camera-static></a-camera-static>
        </a-scene>
    </div>

    <div id="chat-container">
        <input type="text" id="name-input" placeholder="Enter your name">
        <div id="chat-messages"></div>
        <input type="text" id="chat-input" placeholder="Enter a command">
    </div>

    <script>
        const nameInput = document.getElementById('name-input');
        const chatMessages = document.getElementById('chat-messages');
        const chatInput = document.getElementById('chat-input');
        const scene = document.querySelector('a-scene');
        const flocksContainer = document.getElementById('flocks');
        const buildingsContainer = document.getElementById('buildings');
        const citiesContainer = document.getElementById('cities');

        let userName = `User${Math.floor(Math.random() * 100)}`;
        let chats = {};

        nameInput.value = userName;

        nameInput.addEventListener('input', () => {
            userName = nameInput.value.trim() || `User${Math.floor(Math.random() * 100)}`;
        });

        chatInput.addEventListener('keydown', (event) => {
            if (event.key === 'Enter') {
                const message = chatInput.value.trim();
                if (message) {
                    handleCommand(message);
                    addChatMessage(userName, message);
                    chatInput.value = '';
                }
            }
        });

        function addChatMessage(name, message) {
            const chatName = `chat-${name.toLowerCase()}`;
            if (!chats[chatName]) {
                chats[chatName] = [];
            }

            chats[chatName].push(message);

            const messagesHTML = chats[chatName].map((msg) => `<div>${msg}</div>`).join('');
            const chatHTML = `<div><strong>${name}:</strong><div>${messagesHTML}</div></div>`;

            chatMessages.innerHTML += chatHTML;
            chatMessages.scrollTop = chatMessages.scroll


Create an html5 streamlit game of life using aframe and polygons and primitives where the 3d primitives move around in flocks and build buildings and cities when colliding of same type and size.  Have them grow when they touch others of same type.  Use the interface for st.chat_input and st.chat_message to interact with user and accept commands where with each command once submitted become part of a named chat.  Give an input for name and use it in chat allowing user to change name after defaulting it to a common name plus random 2 digit number



Currently no image model can create a model image of a keyboard or a piano due to lack of diffusion control for small subsets of patterns.  That is being supplemented by ability to create 3D or static vector models instead as parts or overlays inside a long term control scene.  Demo on approach:


Create a streamlit app that generates an 88 key keyboard model of white keys and black keys labeling octaves and not per key.  Annotate for a chord player that sings lyrics while also reading the music chords to pace it in 12 or 3, 4 steps with rhythm.

Sure, here's a Streamlit app that generates an 88-key keyboard model with white and black keys labeled with octaves. It also includes annotations for chord players who sing lyrics while reading music chords, paced in 12 or 3/4 steps with rhythm.

```python
import streamlit as st
import matplotlib.pyplot as plt
import numpy as np

# Define the key map
KEY_MAP = {
    'C': 0, 'C#': 1, 'D': 2, 'D#': 3, 'E': 4, 'F': 5, 'F#': 6, 'G': 7, 'G#': 8, 'A': 9, 'A#': 10, 'B': 11
}

# Define the octave range
OCTAVE_RANGE = range(-1, 8)

# Define the key colors
WHITE_KEY_COLOR = 'white'
BLACK_KEY_COLOR = 'black'

# Define the key labels
KEY_LABELS = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']

# Define the chord annotations
CHORD_ANNOTATIONS = [
    "Chord players, sing lyrics while reading music chords",
    "Pace in 12 or 3/4 steps with rhythm"
]

def draw_keyboard():
    fig, ax = plt.subplots(figsize=(16, 4))
    ax.set_facecolor('black')
    ax.set_xticks([])
    ax.set_yticks([])

    key_width = 0.8
    key_height = 3
    key_spacing = 0.2

    for octave in OCTAVE_RANGE:
        for i, key in enumerate(KEY_LABELS):
            x = (i + (octave * 12)) * (key_width + key_spacing)
            y = 0

            if i in [1, 3, 6, 8, 10]:
                rect = plt.Rectangle((x, y), key_width, key_height * 0.6, facecolor=BLACK_KEY_COLOR)
                ax.add_patch(rect)
            else:
                rect = plt.Rectangle((x, y), key_width, key_height, facecolor=WHITE_KEY_COLOR, edgecolor='black')
                ax.add_patch(rect)

                if octave >= 0:
                    ax.text(x + 0.2, 0.5, f"{key}{octave}", fontsize=12, fontweight='bold')

    for i, annotation in enumerate(CHORD_ANNOTATIONS):
        ax.text(1, key_height * (1.2 + i * 0.3), annotation, fontsize=12, fontweight='bold', color='white')

    ax.set_aspect('equal')
    st.pyplot(fig)

st.title("88-Key Keyboard Model")
draw_keyboard()

This app uses the matplotlib library to create an 88-key keyboard model with white and black keys labeled with octaves. The draw_keyboard() function generates the keyboard visualization and adds annotations for chord players who sing lyrics while reading music chords, paced in 12 or 3/4 steps with rhythm.

When you run this app in Streamlit, it will display the 88-key keyboard model with the specified annotations.

Sign up or log in to comment