Comments (9)
I decided to keep current signature of SendEvent
. BUT it's obviously useful to have ability to get events from bytes. So I've added two classes:
BytesToMidiEventConverter
which takes bytes array and returnsMidiEvent
read from the bytes;MidiEventToBytesConverter
which takesMidiEvent
and returns byte array representing the event.
Both classes implement IDisposable
so don't forget to use these classes inside using
block or call Dispose
manually.
So you can use BytesToMidiEventConverter
to get MidiEvent
and then pass that event to SendEvent
method of OutputDevice
.
Although it looks a bit complicated, in my opinion this way is much more flexible since it's basic. New classes can be used for different scenarios, not for MIDI events sending only, providing the same API.
New classes are in develop branch so if you want to use them right now, please build the library from sources.
from drywetmidi.
Hi,
Nice feature request! At now you cannot send events as bytes, but I'll definitely add this ability.
Please note that you cannot send absolutely arbitrary bytes. In MIDI standard there are two types of MIDI events you can send/receive: channel and system exclusive.
System exclusive events already can be sent as bytes:
outputDevice.SendEvent(new NormalSysExEvent(new byte[] { ... }));
So I suppose you're talking about sending channel events (line Note On or Program Change) as bytes, right?
from drywetmidi.
Yes, we love using undefined MIDI commands for gaming-related applications. I personally like using control change or sysex messages that are not picked up by MIDI players to ensure backwards compatibility. Although I know others who use NoteOn events too.
from drywetmidi.
So why did you close the issue? :)
I'll implement sending channel events as bytes within the issue since sysex messages can be sent as bytes right now.
from drywetmidi.
Thank you!
from drywetmidi.
Excellent
from drywetmidi.
Please give your feedback (suggestions, questions, ...) or close the issue.
from drywetmidi.
I can't close the issue anymore.
from drywetmidi.
@clarkx86, I received notification about your comment but unfortunately I don't see it on GitHub :( You're interested in when I'll release new version of the library including changes regarding this issue. I can't say exact date but I'll try to make release in the beginning of February.
from drywetmidi.
Related Issues (20)
- HELP !!! Notes in panel to midi file?? HOT 9
- please help a noob HOT 6
- Remove all notes example from the README not working HOT 9
- Using wetdrymidi in C# project causes error CS0009
- InputDevice event listening crash HOT 2
- Crash when running in Unity on M2 MacBook HOT 3
- MidiDeviceException Internal error HOT 9
- Android Support
- Unity cannot exit after use HOT 10
- MidiClock sync problem HOT 6
- MIDI Tempo changes count returns 1 but the song has 6 tempo changes. HOT 1
- add il2cpp mode HOT 5
- CustomChunk no mididata throw error HOT 4
- CSharp Code Error HOT 2
- MIDI File returns error: InvalidMetaEventParameterValueException HOT 1
- Unable to send Note-On event to device HOT 8
- Cannot get track name to change HOT 10
- How to use DryWetMidi in Visual Basic (VS 2022) ? HOT 20
- Plans for MIDI 2.0 Support? HOT 2
- Skipping notes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drywetmidi.