#[WIP] MIDI To RetroStudio [All Eras]
1 messages · Page 3 of 1
It refused to import a midi file for me once because of the name
Hmm idk
Well still this is a pretty cool feat of engineering!!
thanks, I just applied all the bitwise knowledge I got from working on the nes emulator
6502 in retrostudio is crazy

Yup I've seen that
I was working on my own 6502 emulator which I abandoned
It's not difficult in traditional programming languages, but block coding ?
How was the memory space even treated. Did you just have a big ass table
yeah the table initially contains just zeros, but as the addresses get accessed/written to it gets populated with sub-tables containing the bits
YOUR BYTES ARE ALSO TABLES?
Unhinged
I mean it's probably faster in some areas
But the memory usage. Yikes
This is a midi player, in other words, it plays music based on "notes" like how you'd expect from written music
I haven't figured out how to handle it with just base10 yet
Sick
A midi file is basically just a note sheet, but it supports different instruments and tempo and volume and whatnot
I've been thinking through some possible ways that I can just stay in decimal space and only convert to bytes when needed, but no real solid implementations
basically instructions to make music
Because it's different from roblox audio, you can import a lot of complicated and even copyrighted tracks (if you find the right midi), however that does come with its limitations as the choice of instruments and amount of notes is limited
Why not just use numbers
bitwise shifting and bitwise and/or
You can write your own basic bit32 library, it's not extremely difficult with just decimal numbers and a bit of chatgpt or your own research
Most functions can be implemented with shockingly simple decimal math
That's how I did it for some of my own almostlua projects that used bit32
the problem is also in regular programming languages you can manipulate the bits of a number directly
you can't here
For example, shifting a byte to the left is effectively multiplying it by 2
yes I know that one
Unfortunately
To get a bit, you can shift the number right as much as needed for the bit you need to be rightmost, then mod 2
for shifting right it's just floor(b/2^x) right
Yea
the issue is what if it's in the middle of the byte
or if I need to get multiple bits
Then you shift the number right as much as needed for the middle to be in the end
what about the MSBs
Ie you have 127 which is 0100 0000 and you want to check if the 7th bit is enabled
You can shift it 7 times to get 0000 0001, then you 1 % 2 == 1 to get that the bit is enabled
I think the most I can really do is bitwise shifting here
For bitwise and, you can repeatedly shift both numbers and get their modulo and assemble the result as you loop
Well right
But yea
function band(a, b)
local result = 0
local bit = 1
for i = 0, 31 do
local a_bit = a % 2
local b_bit = b % 2
if a_bit == 1 and b_bit == 1 then
result = result + bit
end
a = math.floor(a / 2)
b = math.floor(b / 2)
bit = bit * 2
end
return result
end
This is for 32 bits but it should give you an idea
It just constantly shifts both numbers right and gets their modulo
what's with the a and b
hmm?
I just asked chatgpt to generate it and manually read it to make sure it's correct
Can't be bothered writing anything myself atm hehe
Yeah I figured ts out without chatgpt because it just flatout said fuck you I'm not telling you shit
Understandable
For bitwise or, same logic but you replace the and with or
For bitwise not, only iterate through one number
Although I think that can be optimized
Or just 255 - byte
Very fast very cool
oh wait true
that implies the number is exclusively 8 bit
I'll probably need to put a check in
2^(bits)-1 is the formula for the maximum value
yea
I think the bitwise using decimal might actually be slower
Depends
Math operations are faster than table lookups
The difference isn't too big to matter though
but by how much
do 100000 table lookups and 100000 math operations and benchmark that
or i can do that for you
ok cool at least pulling the number is faster
even if I will have to convert to binary tables for some instructions I can definitely use this to speed things up
I'm insane I managed to do the entire operation in one solve equation
Scary
I kinda cheated by making a sub-function that just replaces the values of num a and b with math.floor([a|b] / 2)
| standing for bitwise or?
I'm just saying I did it for both a and b
Didn't want to write math floor twice
Yeah I ended up typing more just to explain why I typed less lmao
does it support all 128 instruments
maybe??

half of the instruments kinda suck
my midi
I got autohotkey running on linux, which means I can now make a new helper application which will directly convert midi files to json
and then the json can be imported
[WIP] MIDI To RetroStudio [All Eras]
Yeah don't use it right now
rip
The next version won't be using a wack ass encoding system and should support more midi files
cool
@autumn hamlet Always making me the day with a model
Don't you get it...
No I don't
How can't you, im saying you always make my day better with a model
Going to just write my own midi parser again, all of the midi 2 json libraries are shit lmao
i made a stupid reply
Could I make something like what
so basically
i was gonna ask if you could make it like "Gamehero's Midi Keyboard" which is basically just a roblox midi player that uses base64 instaid of json
The previous version was basically that
But it takes forever to parse in-game
ah
Yeah, trying to make parse the information outside of the client and then sending it
what's the error
it just doesnt want to import
what do you mean
how exactly are you importing it
what steps do you take
tools you mean manage plugins window?
yuh
this was made before plugins existed
you need to import it the original way
through the import tab
im using this btw
I do not support the previous versions that are available as I'm working on a new version which will use the new plugin system for importing
If you get it working, gg
yay
i dont really know how to code, so i cant
i learnt some c# a couple years ago
at least ive got the logics and basics in my head
wow
Wowzers
finally i can put srb2 midi ost
not yet you can't
sure is a midi file
a
Yeah don't use this version lol
Yea
I'm rewriting it
Basically don't use the older versions
please dont even abandon this pipedream
I have too much going on rn to work on this but I will
the people of retro dev need their MIDIs
green.ogg
and MIDIs they shall
woohoo
green.ogg
eventually
alr
but what version can I use
idc if it's old
just something that works
@autumn hamlet alr how do I change the istruments of a song
or force a song to use custom instruments
using the newer version
I don't remember lmao
oh god
this is what happens when you abandon something for too long
lmao
I still have a js module I ported to AHK
yes but I'll have to rewrite it
ah
how does the new version work?
does it work similar to the old one
It was going to be similar yes, but would support more midi versions
how does this work
MIDI tomorrow ⚠️
mbb
I was so fucking dumb when I sent that
MOD files use sound samples for instruments
although they both have similar instructions system
the previous version of the importer exclusively supported type 1 midis
the way how they executes instruments
are way different
MIDIs will use a set of instruments usually a soundfont file.
Microsoft GS wavetable on fleek
A .mod file is a hybrid audio format that contains both digital audio samples and a set of instructions called patterns to sequence them. A player reads these patterns to play the samples at specific times, pitches, and volumes, while also applying effects like vibrato or panning. The song structure is created by arranging these patterns in a specific order, known as a "pattern list".
e
ok Wikipedia vro
mbbbb
but we should get a .mod player in retrostudio /satire

That is a completely different problem
because it bronk
Lol
Fix it
I'm in the middle of a rewrite
Ok hurry up
You don't want my patience to run out
I'm sorry to inform you but your impatience will not accelerate its development

Ohh you don't wanna know, oh the horror
I have to both develop an ingame import pipeline as well as write an external application to assist in sending it to retrostudio
its alright i can wait
Oh heck yeah it's nice to know this is still being worked on
I was just checking in to find the model code for the latest release :D
im still waiting
I'm afraid to say it's been pushed way back in my list of things to do, but it is not dead
is this very laggy atm?
nope
it's just very difficult to set up 
dead tool
dead tool 2.0
deal tool 3.0
deal tool 4.0
dead tool 5.0
dead tool 6.0
dead tool 7.0
dead tool 8.0
dead tool 9.0
dead tool 10
dead tool 11
dead tool 11.5
dead tool ~4pi
dead pan
alive tool
so alive and well and it works too
