Comments (10)
NAudio which we use is capable to forge a Midi messages and is capable of supporting all important messages. Therefore it may be possible to actually convert SGT segments to real buffered Mdi event collections. That may require digging up the deprecated documentation of segments. Question is if it's really worth the probably huge amount of time to introduce DirectMusic converter
EDIT:
Looks like someone already made DirectMusic> Soundfont2 converter:
https://github.com/frabert/libdmusic
from openviii-monogame.
cool :)
from openviii-monogame.
Got the music working without using DirectMusic by parsing SGT file into sequence and translating to MIDI messages. See example state at:
b3a7785
the all tempo and things like that are constant, I just wanted to play the notes, not caring for the tempo, speed and instruments. Playback would be probably provided with FluidSynth or NAudio for both Linux and Windows just to delete use of the deprecated directmusic at all
from openviii-monogame.
some notes so I don't forget:
- seqt[n].mTime is sorted - that's good, no need for Linq every note as in prototype.
- seqt[n].mDuration should be put on a list for a note and channel and then noteoff'd
- seqt[n].dwPChannel has already a channel pointer- that's very good
- seqt[n].bByte1 is note
- seqt[n].bByte2 is velocity
- seqt[n].bStatus is MID event, but it's always 144=noteOn
Tempo is double but it reports weird values. Maybe it's not double or something?
Thread:
- init_debugger_audio on init should create Thread. The thread should get messages from the engine.
- Every PlayMusic should clear the sequence and stop the internal MIDIEvents.
- The thread should also GC pin the unmanaged variables.
Performance:
The segment reading is faster than vanilla DxMusic
from openviii-monogame.
segh::mTime
0: 62208
1: 44544
4: 154368
5: 185856
79:329024 (demo)
93:467712 (lasboss)
from openviii-monogame.
I wonder if creating a MIDI itself wouldn't be faster and more stable than handling the operations on my own. Currently I have to implement a thread with tempo, curves and all that stuff, but on the other hand I can create a .mid in memory and whole synth will do it on it's own 'their way' (which I'm more than sure is way faster). Afair NAudio has whole MIDI creation class.
from openviii-monogame.
DMUS_IO_TIMESIGNATURE may be wrong. The structure sizeof=8, but the algorithm reads actually (sectionLength-4) / 2 where it should be divide by 8. I just got a lot of rubbish in tims and noticed this error. Finally we lack the formulas for converting the time signature events to MIDI like- worth to follow libdmusic code to find out how the tempo and timing is parsed
from openviii-monogame.
TEMPO notes:
DMUS_PPQ is const 768
Calcs: 60 000 000 (BPMPPQ)?
Current example: 1202000 = 240 000
QuarterNote is set to 360 for now
Let N= 2000 in (1202000)
N - slower
<N - faster
60 000 000 / BPM = mill->
so setTempo((60000000/BPM) - needs testing
from openviii-monogame.
OpenVIII now uses custom NAudio library with my extension: naudio/NAudio#499
to write Midi to memory instead of HDD for fluid_player_add_mem
from openviii-monogame.
DirectMusic segments are now played in X64 and linux. It's still WIP, I'm making new issue
from openviii-monogame.
Related Issues (20)
- Menu Strings in Other Languages don't line up with English. HOT 1
- Noise in pngs will show in openviii. HOT 5
- Unit tests and OpenVIII HOT 12
- Laguna's team member names. HOT 4
- Coding style HOT 3
- Laguna costume settings. Unsure. HOT 1
- Battle Camera shakes at end of animation. HOT 4
- world collision - unable to leave some forests
- iOS / macOS HOT 7
- Need to be GPLv3 HOT 1
- build on a Pi4 HOT 2
- Possible translation fix in FF8-Remastered. HOT 1
- Need unit tests HOT 1
- Linux game path finding is just awful HOT 3
- Enable GitHub Discussions HOT 1
- question cdda pc2000 HOT 1
- Setup Code Scanning?
- Can't get project to build using latest Master. HOT 4
- Issue in Installing Windows HOT 2
- Info Needed HOT 2
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 openviii-monogame.