示例#1
0
    private void BuildSampleLibrary()
    {
        SendSamples sendSamples = new SendSamples();

        sendSamples.SampleLibrary = new List <SoundResource>();
        if (Sample1 != null)
        {
            sendSamples.SampleLibrary.Add(Sample1);
        }
        //Wait(TimeSpan.FromSeconds(5));
        PostScriptEvent(ScriptId.AllScripts, "BeatBlockSample", sendSamples);
    }
    private void getSamples(ScriptEventData gotSamples)
    {
        //Log.Write("In getSamples");
        if (gotSamples.Data == null)
        {
            Log.Write(LogLevel.Warning, Script.ID.ToString(), "Expected non-null event data");
            return;
        }
        SendSamples sendSamples = gotSamples.Data.AsInterface <SendSamples>();

        if (sendSamples == null)
        {
            Log.Write(LogLevel.Error, Script.ID.ToString(), "Unable to create interface, check logs for missing member(s)");
            return;
        }

        SoundResource tempSample;
        string        tempSampleName;
        int           cntr = 0;

        Log.Write("sendSamples.SendSampleLibrary.Count(): " + sendSamples.SendSampleLibrary.Count());
        if (sendSamples.SendSampleLibrary.Count() > 0)
        {
            do
            {
                //Log.Write("cntr: " + cntr);
                if ((cntr == 1) || (cntr == 3) || (cntr == 5) || (cntr == 7) || (cntr == 9) || (cntr == 11) || (cntr == 13) || (cntr == 15) || (cntr == 17) || (cntr == 19))
                {
                    tempSample = sendSamples.SendSampleLibrary.ElementAt(cntr) as SoundResource;
                    SampleLibrary.Add(tempSample);
                    //Log.Write("sample added: " + tempSample.GetName());
                }
                else
                {
                    tempSampleName = sendSamples.SendSampleLibrary.ElementAt(cntr) as string;
                    SampleNames.Add(tempSampleName);
                    //Log.Write("Sample Name Added: " + tempSampleName);
                }
                //Errors = Errors + ", " + tempSample.GetName();
                //Log.Write("Sample Loaded: " + tempSample.GetName());
                cntr++;
            } while (cntr < sendSamples.SendSampleLibrary.Count());
        }
    }
示例#3
0
    private void BuildSampleLibrary()
    {
        SendSamples    sendSamples    = new SendSamples();
        SendInstrument sendInstrument = new SendInstrument();

        sendSamples.SampleLibrary      = new List <object>();
        sendInstrument.InstrumentArray = new List <string>();
        if (Sample1Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample1Name);
        }
        if (Sample1 != null)
        {
            sendSamples.SampleLibrary.Add(Sample1);
        }
        if (Sample2Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample2Name);
        }
        if (Sample2 != null)
        {
            sendSamples.SampleLibrary.Add(Sample2);
        }
        if (Sample3Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample3Name);
        }
        if (Sample3 != null)
        {
            sendSamples.SampleLibrary.Add(Sample3);
        }
        if (Sample4Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample4Name);
        }
        if (Sample4 != null)
        {
            sendSamples.SampleLibrary.Add(Sample4);
        }
        if (Sample5Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample5Name);
        }
        if (Sample5 != null)
        {
            sendSamples.SampleLibrary.Add(Sample5);
        }
        if (Sample6Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample6Name);
        }
        if (Sample6 != null)
        {
            sendSamples.SampleLibrary.Add(Sample6);
        }
        if (Sample7Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample7Name);
        }
        if (Sample7 != null)
        {
            sendSamples.SampleLibrary.Add(Sample7);
        }
        if (Sample8Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample8Name);
        }
        if (Sample8 != null)
        {
            sendSamples.SampleLibrary.Add(Sample8);
        }
        if (Sample9Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample9Name);
        }
        if (Sample9 != null)
        {
            sendSamples.SampleLibrary.Add(Sample9);
        }
        if (Sample10Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample10Name);
        }
        if (Sample10 != null)
        {
            sendSamples.SampleLibrary.Add(Sample10);
        }

        sendInstrument.InstrumentArray = new List <string>();
        sendInstrument.InstrumentArray.Add("vibes");  //name of the instrument is the first entry
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-48");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-47");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-46");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-45");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-44");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-43");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-42");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-41");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-40");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-39");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-38");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-37");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-36");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-35");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-34");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-33");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-32");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-31");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-30");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-29");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-28");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-27");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-26");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-25");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-24");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-23");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-22");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-21");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-20");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-19");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-18");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-17");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-16");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-15");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-14");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-13");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-12");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-11");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-10");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-9");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-8");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-7");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-6");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-5");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-4");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-3");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-2");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("-1");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("1");
        sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("2"); sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Vibes C3"); sendInstrument.InstrumentArray.Add("4"); sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("1");
        sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("2"); sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("4"); sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("5"); sendInstrument.InstrumentArray.Add("Vibes F3"); sendInstrument.InstrumentArray.Add("6");
        sendInstrument.InstrumentArray.Add("Vibes C4"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Vibes C4"); sendInstrument.InstrumentArray.Add("1"); sendInstrument.InstrumentArray.Add("Vibes C4"); sendInstrument.InstrumentArray.Add("2"); sendInstrument.InstrumentArray.Add("Vibes C4"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Vibes C4"); sendInstrument.InstrumentArray.Add("4");
        sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("1"); sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("2"); sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("4");
        sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("5"); sendInstrument.InstrumentArray.Add("Vibes F4"); sendInstrument.InstrumentArray.Add("6"); sendInstrument.InstrumentArray.Add("Vibes C5"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Vibes C5"); sendInstrument.InstrumentArray.Add("1"); sendInstrument.InstrumentArray.Add("Vibes C5"); sendInstrument.InstrumentArray.Add("2");
        sendInstrument.InstrumentArray.Add("Vibes C5"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Vibes C5"); sendInstrument.InstrumentArray.Add("4"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("1"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("2");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("4"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("5"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("6"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("7");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("8"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("9"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("10"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("11"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("12");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("13"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("14"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("15"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("16"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("17");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("18"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("19"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("20"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("21"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("22");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("23"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("24"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("25"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("26"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("27");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("28"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("29"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("30"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("31"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("32");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("33"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("34"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("35"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("36"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("37");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("38"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("39"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("40"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("41"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("42");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("43"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("44"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("45"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("46"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("47");
        sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("48"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("49"); sendInstrument.InstrumentArray.Add("Vibes F5"); sendInstrument.InstrumentArray.Add("50");

        Wait(TimeSpan.FromSeconds(5));
        Log.Write("Vibes Sent");
        PostScriptEvent(ScriptId.AllScripts, "Samples11", sendSamples);
        PostScriptEvent(ScriptId.AllScripts, "Instrument11", sendInstrument);
    }
    private void BuildSampleLibrary()
    {
        SendSamples    sendSamples    = new SendSamples();
        SendInstrument sendInstrument = new SendInstrument();

        sendSamples.SampleLibrary      = new List <object>();
        sendInstrument.InstrumentArray = new List <string>();
        if (Sample1Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample1Name);
        }
        if (Sample1 != null)
        {
            sendSamples.SampleLibrary.Add(Sample1);
        }
        if (Sample2Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample2Name);
        }
        if (Sample2 != null)
        {
            sendSamples.SampleLibrary.Add(Sample2);
        }
        if (Sample3Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample3Name);
        }
        if (Sample3 != null)
        {
            sendSamples.SampleLibrary.Add(Sample3);
        }
        if (Sample4Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample4Name);
        }
        if (Sample4 != null)
        {
            sendSamples.SampleLibrary.Add(Sample4);
        }
        if (Sample5Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample5Name);
        }
        if (Sample5 != null)
        {
            sendSamples.SampleLibrary.Add(Sample5);
        }
        if (Sample6Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample6Name);
        }
        if (Sample6 != null)
        {
            sendSamples.SampleLibrary.Add(Sample6);
        }
        if (Sample7Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample7Name);
        }
        if (Sample7 != null)
        {
            sendSamples.SampleLibrary.Add(Sample7);
        }
        if (Sample8Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample8Name);
        }
        if (Sample8 != null)
        {
            sendSamples.SampleLibrary.Add(Sample8);
        }
        if (Sample9Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample9Name);
        }
        if (Sample9 != null)
        {
            sendSamples.SampleLibrary.Add(Sample9);
        }
        if (Sample10Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample10Name);
        }
        if (Sample10 != null)
        {
            sendSamples.SampleLibrary.Add(Sample10);
        }

        sendInstrument.InstrumentArray = new List <string>();
        sendInstrument.InstrumentArray.Add("square");          //name of the instrument is the first entry
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-69"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-68"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-67"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-66"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-65");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-64"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-63"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-62"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-61"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-60");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-59"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-58"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-57"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-56"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-55");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-54"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-53"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-52"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-51"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-50");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-49"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-48"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-47"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-46"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-45");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-44"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-43"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-42"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-41"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-40");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-39"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-38"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-37"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-36"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-35");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-34"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-33"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-32"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-31"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-30");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-29"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-28"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-27"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-26"); sendInstrument.InstrumentArray.Add("Square A44"); sendInstrument.InstrumentArray.Add("-25");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-24"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-23"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-22"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-21"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-20");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-19"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-18"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-17"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-16"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-15");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-14"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-13"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-12"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-11"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-10");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-9"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-8"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-7"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-6"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-5");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-4"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-3"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-2"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("-1"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("1"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("2"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("4"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("5");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("6"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("7"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("8"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("9"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("10");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("11"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("12"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("13"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("14"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("15");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("16"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("17"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("18"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("19"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("20");
        sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("21"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("22"); sendInstrument.InstrumentArray.Add("Square A4"); sendInstrument.InstrumentArray.Add("23"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("0"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("1");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("2"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("3"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("4"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("5"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("6");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("7"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("8"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("9"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("10"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("11");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("12"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("13"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("14"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("15"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("16");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("17"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("18"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("19"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("20"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("21");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("22"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("23"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("24"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("25"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("26");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("27"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("28"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("29"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("30"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("31");
        sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("32"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("33"); sendInstrument.InstrumentArray.Add("Square A6"); sendInstrument.InstrumentArray.Add("34");

        Wait(TimeSpan.FromSeconds(5));
        PostScriptEvent(ScriptId.AllScripts, "Samples10", sendSamples);
        PostScriptEvent(ScriptId.AllScripts, "Instrument10", sendInstrument);
    }
    private void CheckForCollisions(CollisionEventType trackedEvents)
    {
        while (true)
        {
            // This will block the coroutine until a collision happens
            CollisionData data = (CollisionData)WaitFor(RigidBody.Subscribe, trackedEvents, Sansar.Script.ComponentId.Invalid);
            if (data.EventType == CollisionEventType.CharacterContact)
            {
                //Log.Write("I hit an avatar");
            }
            else
            {
                //Log.Write("I hit an object");
                //Log.Write("CollisionEventType: " + data.EventType);
                goodhit = false;
                if (!hitDetected)
                {
                    //Log.Write("BPMBlock");
                    //Log.Write("BPMBlock: Position: " + RigidBody.GetPosition());
                    pos  = GetXPosition(RigidBody.GetPosition().ToString4());
                    ypos = GetYPosition(RigidBody.GetPosition().ToString4());
                    if ((ypos == "-0") || (ypos == "0."))
                    {
                        goodhit = true;
                    }

                    SendBPM sendBPM = new SendBPM();
                    sendBPM.BPMArray = new List <string>();
                    sendBPM.BPMArray.Add("bpm");
                    sendBPM.BPMArray.Add(pos);
                    sendBPM.BPMArray.Add(bpm);
                    SendBlockNames sendBlocks = new SendBlockNames();
                    sendBlocks.BlockNameArray = new List <string>();
                    sendBlocks.BlockNameArray.Add(BeatBlockName);
                    sendBlocks.BlockNameArray.Add("0");
                    sendBlocks.BlockNameArray.Add(beats);
                    SendSamples sendSamples = new SendSamples();
                    sendSamples.SampleLibrary = new List <SoundResource>();
                    if (Sample1 != null)
                    {
                        //Log.Write("BPMBlock: sample being sent from BPM: " + Sample1.GetName());
                        sendSamples.SampleLibrary.Add(Sample1);
                    }

                    if (goodhit)
                    {
                        //Log.Write("BPMBlock: goodhit");
                        PostScriptEvent(ScriptId.AllScripts, "BPMBlock", sendBPM);
                        PostScriptEvent(ScriptId.AllScripts, "BeatBlock", sendBlocks);
                        PostScriptEvent(ScriptId.AllScripts, "BeatBlockSample", sendSamples);
                        Wait(TimeSpan.FromSeconds(1.5));
                        DisplayBPMBlock();
                        Wait(TimeSpan.FromSeconds(1.0));
                        SubscribeToScriptEvent("ReturnBeatBlock", getBin);
                        subscribe   = true;
                        hitDetected = true;
                    }
                    else
                    {
                        //ScenePrivate.Chat.MessageAllUsers("Drop the BPM Block in a Loop Bin");
                        ReturnBPMBlock();
                    }
                }
            }
        }
    }
示例#6
0
    private void BuildSampleLibrary()
    {
        SendSamples    sendSamples    = new SendSamples();
        SendInstrument sendInstrument = new SendInstrument();

        sendSamples.SampleLibrary      = new List <object>();
        sendInstrument.InstrumentArray = new List <string>();
        if (Sample1Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample1Name);
        }
        if (Sample1 != null)
        {
            sendSamples.SampleLibrary.Add(Sample1);
        }
        if (Sample2Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample2Name);
        }
        if (Sample2 != null)
        {
            sendSamples.SampleLibrary.Add(Sample2);
        }
        if (Sample3Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample3Name);
        }
        if (Sample3 != null)
        {
            sendSamples.SampleLibrary.Add(Sample3);
        }
        if (Sample4Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample4Name);
        }
        if (Sample4 != null)
        {
            sendSamples.SampleLibrary.Add(Sample4);
        }
        if (Sample5Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample5Name);
        }
        if (Sample5 != null)
        {
            sendSamples.SampleLibrary.Add(Sample5);
        }
        if (Sample6Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample6Name);
        }
        if (Sample6 != null)
        {
            sendSamples.SampleLibrary.Add(Sample6);
        }
        if (Sample7Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample7Name);
        }
        if (Sample7 != null)
        {
            sendSamples.SampleLibrary.Add(Sample7);
        }
        if (Sample8Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample8Name);
        }
        if (Sample8 != null)
        {
            sendSamples.SampleLibrary.Add(Sample8);
        }
        if (Sample9Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample9Name);
        }
        if (Sample9 != null)
        {
            sendSamples.SampleLibrary.Add(Sample9);
        }
        if (Sample10Name.Length > 0)
        {
            sendSamples.SampleLibrary.Add(Sample10Name);
        }
        if (Sample10 != null)
        {
            sendSamples.SampleLibrary.Add(Sample10);
        }

        sendInstrument.InstrumentArray = new List <string>();
        sendInstrument.InstrumentArray.Add("conga");          //name of the instrument is the first entry
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-12");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-11");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-10");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-9");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-8");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-7");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-6");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-5");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-4");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-3");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-2");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("-1");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("63CongaBrLw"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("62CongaBrHi"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("62CongaBrHi"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("61BongoBrLw"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("61BongoBrLw"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("60BongoBrHi"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("60BongoBrHi"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("64FrameOpen"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("64FrameOpen"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiagogo"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiagogo"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("85Castanet1"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("85Castanet1"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Claves"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Claves"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");
        sendInstrument.InstrumentArray.Add("909Hiwoodbl"); sendInstrument.InstrumentArray.Add("0");

        Wait(TimeSpan.FromSeconds(5));
        PostScriptEvent(ScriptId.AllScripts, "Samples45", sendSamples);
        PostScriptEvent(ScriptId.AllScripts, "Instrument45", sendInstrument);
    }