Пример #1
0
 void OscToMax()
 {
     oscCode.SendOsc("/resetNotes", "clear");
     foreach (int i in notes)
     {
         Debug.Log("sending osc: " + i);
         oscCode.SendOsc("/notes", i.ToString());
     }
 }
Пример #2
0
    public void GenerateKickPattern(string address, string instruction)
    {
        if (instruction != "newBeat")
        {
            return;
        }

        int triggers = Random.Range(0, triggerNumbers.Count - 1);

        oscCode.SendOsc("/instrument", 0.ToString());
        oscCode.SendOsc("/pattern", 1.ToString());
        oscCode.SendOsc("/triggers", triggerNumbers[triggers]);
    }
Пример #3
0
    void SendMountainViaOsc(Mountain mountain)
    {
        Debug.Log("sending mountain data");
        oscCodeSender.SendOsc("/roots", "reset");
        oscCodeSender.SendOsc("/roots", mountain.rootString);

        int count = 0;

        foreach (string s in mountain.streamStrings)
        {
            oscCodeSender.SendOsc("/stream_" + count, "reset");
            oscCodeSender.SendOsc("/stream_" + count, s);
            count++;
        }
    }
Пример #4
0
    public void GenerateClapPattern(string address, string instruction)
    {
        if (instruction != "newBeat")
        {
            return;
        }

        int triggers = Random.Range(0, triggerNumbers.Count - 1);
        int steps    = Random.Range(0, possibleSteps.Count - 1);

        oscCode.SendOsc("/instrument", 2.ToString());
        oscCode.SendOsc("/pattern", 1.ToString());
        oscCode.SendOsc("/triggers", triggerNumbers[triggers]);
        oscCode.SendOsc("/step", possibleSteps[steps]);
    }
Пример #5
0
 // checks to see that both address and message data have been entered. if both true, sends the message.
 public void SendOutTestMessage()
 {
     if (addressUpdated && messageUpdated)
     {
         oscCodeSender.SendOsc(address, message);
     }
 }
Пример #6
0
    // This is the coroutine which will be running the song. It fires off the first event to Max then waits while it is running. When max switches the event's bool to
    // 'true', the coroutine fires off the next event and so on until there are no more left.

    IEnumerator EventScheduler(int index)
    {
        SongEventToOsc(index);

        while (!patience[index])
        {
            yield return(new WaitForEndOfFrame());
        }
        StopCoroutine(prevEvent);
        log.text = "end.";
        eventIndex++;
        if (eventIndex < eventCues.Count)
        {
            RunEvents();
        }
        else
        {
            oscCodeSender.SendOsc("Max_DecompMain", "/transport " + "STOP");
            eventIndex = 0;
        }
    }
Пример #7
0
 void Intro(object obj)
 {
     Debug.Log("INTRO STARTED" + EventManager.EventIndex);
     EventManager.EventIndex++;
     oscCode.SendOsc("/Max_DecompMain", "INTRO STARTED");
 }