#[WIP] MIDI To RetroStudio [All Eras]

1 messages · Page 3 of 1

autumn hamlet
#

yes, also with playback

#

some midis just refuse despite everything going "right"

neat bramble
#

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!!

autumn hamlet
#

thanks, I just applied all the bitwise knowledge I got from working on the nes emulator

neat bramble
#

6502 in retrostudio is crazy

autumn hamlet
neat bramble
#

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

autumn hamlet
neat bramble
#

YOUR BYTES ARE ALSO TABLES?

#

Unhinged

#

I mean it's probably faster in some areas

#

But the memory usage. Yikes

gleaming wedge
#

What’s this do and used for ?

#

Oh music

neat bramble
autumn hamlet
gleaming wedge
#

Sick

neat bramble
#

A midi file is basically just a note sheet, but it supports different instruments and tempo and volume and whatnot

autumn hamlet
#

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

autumn hamlet
neat bramble
#

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

neat bramble
autumn hamlet
neat bramble
#

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

autumn hamlet
#

I attempted to do that

#

It just told me it wasn't possible

neat bramble
#

That's how I did it for some of my own almostlua projects that used bit32

autumn hamlet
#

lol

#

also this isn't in 32 bit since this is an 8bit processor

neat bramble
#

I was using bit32 as an example

#

You can adapt it to your needs obviously

autumn hamlet
#

the problem is also in regular programming languages you can manipulate the bits of a number directly

#

you can't here

neat bramble
#

For example, shifting a byte to the left is effectively multiplying it by 2

autumn hamlet
#

yes I know that one

neat bramble
#

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

autumn hamlet
#

for shifting right it's just floor(b/2^x) right

neat bramble
#

Yea

autumn hamlet
#

or if I need to get multiple bits

neat bramble
#

Then you shift the number right as much as needed for the middle to be in the end

autumn hamlet
#

what about the MSBs

neat bramble
#

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

autumn hamlet
#

I think the most I can really do is bitwise shifting here

neat bramble
#

For bitwise and, you can repeatedly shift both numbers and get their modulo and assemble the result as you loop

autumn hamlet
#

oh wait

#

OHH WAIT

#

HEHEHEHE

#

shift left and then modulus

neat bramble
#

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

autumn hamlet
#

what's with the a and b

neat bramble
autumn hamlet
#

oh wait a second

#

oh that's neat

#

I like that implementation

neat bramble
#

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

autumn hamlet
#

Yeah I figured ts out without chatgpt because it just flatout said fuck you I'm not telling you shit

neat bramble
#

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

neat bramble
#

Very fast very cool

autumn hamlet
#

oh wait true

autumn hamlet
#

I'll probably need to put a check in

neat bramble
#

2^(bits)-1 is the formula for the maximum value

autumn hamlet
#

yea

autumn hamlet
neat bramble
#

Depends

#

Math operations are faster than table lookups

#

The difference isn't too big to matter though

autumn hamlet
neat bramble
#

do 100000 table lookups and 100000 math operations and benchmark that

#

or i can do that for you

autumn hamlet
#

even if I will have to convert to binary tables for some instructions I can definitely use this to speed things up

autumn hamlet
#

I'm insane I managed to do the entire operation in one solve equation

neat bramble
#

Scary

autumn hamlet
# neat bramble 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)

neat bramble
#

| standing for bitwise or?

autumn hamlet
#

Didn't want to write math floor twice

neat bramble
#

Ohhh

#

That confused me but makes sense I guess

autumn hamlet
turbid herald
#

does it support all 128 instruments

autumn hamlet
#

half of the instruments kinda suck

regal atlas
#

importing a 255 kb song

#

💔💔

turbid herald
autumn hamlet
#

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

autumn hamlet
autumn hamlet
#

[WIP] MIDI To RetroStudio [All Eras]

autumn hamlet
#

ported a midi parser javascript library to autohotkey because why not

wintry dune
#

the midi importer doesnt create any midi and also uh

autumn hamlet
wintry dune
autumn hamlet
# wintry dune rip

The next version won't be using a wack ass encoding system and should support more midi files

eager pelican
#

@autumn hamlet Always making me the day with a model

eager pelican
autumn hamlet
#

No I don't

eager pelican
autumn hamlet
#

Going to just write my own midi parser again, all of the midi 2 json libraries are shit lmao

mild trenchBOT
chilly crow
#

i made a stupid reply

autumn hamlet
chilly crow
#

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

autumn hamlet
#

But it takes forever to parse in-game

chilly crow
#

ah

autumn hamlet
# chilly crow ah

Yeah, trying to make parse the information outside of the client and then sending it

fossil grove
#

help

#

i keep getting an error when trying to import this plugin

neat bramble
fossil grove
neat bramble
#

how exactly are you importing it

#

what steps do you take

fossil grove
#

tru tools

neat bramble
#

tools you mean manage plugins window?

fossil grove
neat bramble
#

this was made before plugins existed

#

you need to import it the original way

#

through the import tab

fossil grove
#

im using this btw

fossil grove
#

okey

autumn hamlet
# fossil grove 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

fossil grove
#

i learnt some c# a couple years ago

#

at least ive got the logics and basics in my head

autumn hamlet
autumn hamlet
eager pelican
limber raft
#

wow

eager pelican
fair prawn
#

finally i can put srb2 midi ost

autumn hamlet
fair prawn
#

ok

#

when it gets finished

#

its srb2 midi time

turbid herald
neat bramble
#

sure is a midi file

wicked bolt
#

a

regal atlas
autumn hamlet
regal atlas
#

The ID you provided

#

Only has the importer

autumn hamlet
#

I'm rewriting it

#

Basically don't use the older versions

south night
#

please dont even abandon this pipedream

autumn hamlet
obsidian path
#

the people of retro dev need their MIDIs

lunar trellis
#

NO WAY

autumn hamlet
autumn hamlet
plucky wadi
#

woohoo

lunar trellis
regal atlas
#

@autumn hamlet [;easseeeeee

#

revive this

autumn hamlet
regal atlas
#

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

autumn hamlet
regal atlas
#

this is what happens when you abandon something for too long

#

lmao

autumn hamlet
regal atlas
#

did you even spend any work on the new version

#

just asking

autumn hamlet
regal atlas
#

how does the new version work?

#

does it work similar to the old one

autumn hamlet
regal atlas
#

wdym by midi versions

#

like formats?

#

.mod?

grizzled obsidian
#

how does this work

hollow bay
#

MIDI tomorrow ⚠️

autumn hamlet
#

It's sequenced music yes but not midi

regal atlas
#

mbb

#

I was so fucking dumb when I sent that

#

MOD files use sound samples for instruments

#

although they both have similar instructions system

autumn hamlet
#

the previous version of the importer exclusively supported type 1 midis

regal atlas
#

the way how they executes instruments

#

are way different

#

MIDIs will use a set of instruments usually a soundfont file.

autumn hamlet
#

Microsoft GS wavetable on fleek

regal atlas
#

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

regal atlas
#

but we should get a .mod player in retrostudio /satire

regal atlas
autumn hamlet
obsidian path
#

woa

#

ik it's old but still looks cool

undone steeple
#

how do i convert mp3 to midi

#

rigged

autumn hamlet
acoustic marsh
#

why did it load only 4 tracks and not the rest which is 11

#

piss

autumn hamlet
acoustic marsh
#

Lol

eager pelican
autumn hamlet
eager pelican
#

You don't want my patience to run out

autumn hamlet
eager pelican
autumn hamlet
#

I have to both develop an ingame import pipeline as well as write an external application to assist in sending it to retrostudio

covert depot
#

I was just checking in to find the model code for the latest release :D

acoustic marsh
#

im still waiting

autumn hamlet
lean hare
#

is this very laggy atm?

covert depot
autumn hamlet
regal atlas
#

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

ashen fable
#

dead tool 11

rigid schooner
#

dead tool 11.5

plucky wadi
#

dead tool ~4pi

eager pelican
autumn hamlet
#

alive tool

covert depot
#

so alive and well and it works too

acoustic marsh
#

this model is like a sick man

#

is he gonna die or is he gonna recover