Would one of you code maestros be willing to put together a Visual Studio project for a machine that just sends MIDI to selected targets based on MIDI in events and pattern data? I'm studying BuzzGUI sources, but it has been really slow-going
GUI basically just a ListBox with SelectionMode = Multiple that updates when machines are added or deleted.
Example project for a simple C#/XAML machine (non-DSP)?
Re: Example project for a simple C#/XAML machine (non-DSP)?
There are GUI demos already (qsamo, relativion) but sending midi works like this:
Code: Select all
[MachineDecl(Name = "Jeskola MidiTest", ShortName = "MidiTest", Author = "Oskari Tammelin")]
public class MidiTestMachine : IBuzzMachine
{
IBuzzMachineHost host;
List<IMachine> targets = new List<IMachine>();
public MidiTestMachine(IBuzzMachineHost host)
{
this.host = host;
lock (targets) targets.Add(Global.Buzz.Song.Machines.FirstOrDefault(m => m.Name == "Qsamo"));
}
[ParameterDecl(DefValue = false)]
public bool Enabled { get; set; }
public void Work()
{
if (!Enabled) return;
if (host.MasterInfo.PosInTick == 0)
{
IMachine[] threadsafeTargets;
lock (targets) threadsafeTargets = targets.ToArray();
foreach (var t in threadsafeTargets)
{
if (t != null) t.SendMIDINote(0, 60, 100);
}
}
}
}
Re: Example project for a simple C#/XAML machine (non-DSP)?
Yes, but you forgot to add Comments for the Retarded (TM).oskari wrote:There are GUI demos already (qsamo, relativion)
Thanks for the snippet. I'll keep plodding.but sending midi works like this:
Re: Example project for a simple C#/XAML machine (non-DSP)?
I'm feeling so out of my depth here, y'all ...
Going to try some baby-steps questions about Relativion.
First one: Where/how do the pattern params - Root Note, Lowest Note, Highest Note, etc. - get defined? (I see that Note Matrix gets its dummy param from NoteMatrixMachine.cs, but Relativion's params seem to show up magically)
Going to try some baby-steps questions about Relativion.
First one: Where/how do the pattern params - Root Note, Lowest Note, Highest Note, etc. - get defined? (I see that Note Matrix gets its dummy param from NoteMatrixMachine.cs, but Relativion's params seem to show up magically)
Re: Example project for a simple C#/XAML machine (non-DSP)?
Relativion is a native machine, it was before "managed machines". See NTracker for an example of parameters.
- mantratronic
- Posts: 296
- Joined: Mon Nov 21, 2011 7:23 pm
Re: Example project for a simple C#/XAML machine (non-DSP)?
hey,
i've done something similar to the list of machines idea. https://dl.dropboxusercontent.com/u/123 ... getgui.rar is the .cs and xaml for a picker window that gets the machine and parameter list from buzz and let you choose a machine/parameter pair. im told the way i do gui coding is an offense to humanity (not really, just very wrong) so i would ignore that bit and look at the fillTreeList function which fills up a gui class with the data.
runs a loop for each machine in the song. maybe check they are a gen and have the midi params you want then add them to the class you are using to display them.
I havent used an auto update for this (ie you would need to open the window again if a machine got added), but you can listen to from BuzzGUI.Common.Global.Buzz.Song and rebuild the list when they trigger
in IBuzz you can also find which i guess will help the midi side?
will be about the irc channel if you have questions
i've done something similar to the list of machines idea. https://dl.dropboxusercontent.com/u/123 ... getgui.rar is the .cs and xaml for a picker window that gets the machine and parameter list from buzz and let you choose a machine/parameter pair. im told the way i do gui coding is an offense to humanity (not really, just very wrong) so i would ignore that bit and look at the fillTreeList function which fills up a gui class with the data.
Code: Select all
foreach (IMachine m in BuzzGUI.Common.Global.Buzz.Song.Machines)
I havent used an auto update for this (ie you would need to open the window again if a machine got added), but you can listen to
Code: Select all
event Action<IMachine> MachineAdded;
event Action<IMachine> MachineRemoved;
in IBuzz you can also find
Code: Select all
event Action<int> MIDIInput;
will be about the irc channel if you have questions