ORG Player in Flash (swf)

Oct 10, 2008 at 12:38 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
I have developed a flash file that can read the information from an org file and using this guide, understand it and break down the file into a series of variables:
http://spgardebiter.sp.funpic.de/CaveStory/FAQ/orgfilesdesc.txt

But I could show note information while playing all I want but that still won't produce any sound.

Does anyone know how org players create the sound for all of the notes and instruments?

I hope you guys will help me with this because it means that you can play music direct from the site in org format.

I'll be uploading the source files later on after getting the rest of the information into variables and laid out onscreen.
 
Oct 10, 2008 at 12:56 AM
I can has squidburger?
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Sep 14, 2008
Location: Walrus World
Posts: 321
...The cheap way to do it would just be to make a .wav file for each instrument and then manipulate the pitch as needed, but I'm assuming you don't want to do that.

The person that would know would be Moose. I don't know how one would get a hold of him though.

By the way, I think an Org player in flash would be absolutely incredible. Good on ya (if I remember my Australian slang correctly, it's been a while since I was last there)
 
Oct 10, 2008 at 1:28 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
innocent.bystander said:
...The cheap way to do it would just be to make a .wav file for each instrument and then manipulate the pitch as needed, but I'm assuming you don't want to do that.
Actually that sounds like a good idea, but how would I draw out the notes and what pitch should the .wav files be in? Actually, would there be instruments stored in the exe? I'll need to check this stuff tonight.
 
Oct 10, 2008 at 1:33 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
I would recommend making the .wav files Middle C.
 
Oct 10, 2008 at 2:03 AM
I can has squidburger?
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Sep 14, 2008
Location: Walrus World
Posts: 321
*Shrug*
Just find out what pitch the OrgMaker notes are in, then record the instruments.
Or... wait. Didn't Pixel release an app that lets you create your own sound effects? I'm pretty sure that's how the OrgMaker instruments work. It's either ptNoise or pTone_ex00.
http://spgardebiter.sp.funpic.de/CaveStory/Programs/
 
Oct 10, 2008 at 2:21 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
So I could extract them from the exe, maybe?
 
Oct 10, 2008 at 1:08 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 33
Pronouns: he/him
Oct 10, 2008 at 3:06 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
Woohoo! I have the instruments in mp3 format embedded into the flash. :p (found them in the ORGasm folder)

And my flash file now converts all of the instrument data (pitch, number of notes, etc.) from the org file and inserts them into an array.

The following was ripped from access.org using the flash file:
Tempo: 100/2000

Instrument 0:
pitch[1000/1900] instrument[70] pi[false] notes[0]

Instrument 1:
pitch[1000/1900] instrument[70] pi[false] notes[49]

Instrument 2:
pitch[1000/1900] instrument[32] pi[false] notes[0]

Instrument 3:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 4:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 5:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 6:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 7:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 8:
pitch[1000/1900] instrument[0] pi[false] notes[24]

Instrument 9:
pitch[1000/1900] instrument[2] pi[false] notes[8]

Instrument 10:
pitch[1000/1900] instrument[5] pi[false] notes[44]

Instrument 11:
pitch[1000/1900] instrument[6] pi[false] notes[0]

Instrument 12:
pitch[1000/1900] instrument[4] pi[false] notes[3]

Instrument 13:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 14:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Instrument 15:
pitch[1000/1900] instrument[0] pi[false] notes[0]

Note information is next I guess.

*sigh* My brain hurts...
 
Oct 11, 2008 at 4:21 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
Oct 11, 2008 at 5:22 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
What? I can't try it online?
 
Oct 11, 2008 at 5:43 PM
I can has squidburger?
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Sep 14, 2008
Location: Walrus World
Posts: 321
Neat, but are you stuck on something or do you just want us to see how far you've gotten?

edit: also, why'd you change the extension to .sof?
 
Oct 12, 2008 at 12:02 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
innocent.bystander said:
Neat, but are you stuck on something or do you just want us to see how far you've gotten?

edit: also, why'd you change the extension to .sof?
SOF=Simplified ORG Format

I used a file to hex converter and the resulting file I renamed to "access.sof".
The reason for this is that the file is read as text, not as hex, resulting in lost information if if it read in it's natural state. So this "simplified" for importing values into the flash, since letters and numbers are not lost in the conversion.
 
Oct 12, 2008 at 8:03 AM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 33
Pronouns: he/him
I'm working on something simular. On a Frequency Modulation Synthesis programme, which can play notes and such. I'm sure as hell your source will be helpful for me.
If I get the thing to work I can upload the source.

Edit: Ahh damn, I can't even read those files :/
Well I have to try myself then.

Edit edit:

This may be helpful for you:

Code:
	Count = 0
CountX = 0
CountY = 0

SampleRate = 44100

DIM Volume[8192][16]
DIM Frequency[8192][16]
DIM Length[8192][16]
DIM Sample[SampleRate]
DIM Note[120]

Frequency[0][0] = 39
Frequency[1][0] = 42
Frequency[2][0] = 44
Frequency[3][0] = 46
Frequency[4][0] = 47
Frequency[5][0] = 51
Frequency[6][0] = 44
Length[0][0] = 2
Length[1][0] = 2
Length[2][0] = 8
Length[3][0] = 2
Length[4][0] = 2
Length[5][0] = 4
Length[6][0] = 10

Note[0] = 27.5

FOR Count = 1 TO 119
Note[Count] = 1.059463094359 * Note[Count-1]
NEXT

IF OPENFILE(1, "Output.wav", FALSE)		// Save output

FOR CountX = 0 TO 6
FOR CountY = 0 TO Length[CountX][0] * 44100 / 10
INC Count, 1
WRITEBYTE 1, INTEGER((SIN(360/SampleRate*Count*Note[Frequency[CountX][0]])*100)+125)
NEXT
NEXT

CLOSEFILE 1

ENDIF
 
Oct 12, 2008 at 12:46 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
S. P. Gardebiter said:
I'm working on something simular. On a Frequency Modulation Synthesis programme, which can play notes and such. I'm sure as hell your source will be helpful for me.
If I get the thing to work I can upload the source.

Edit: Ahh damn, I can't even read those files :/
Well I have to try myself then.

Edit edit:

This may be helpful for you:

Code:
	Count = 0
CountX = 0
CountY = 0

SampleRate = 44100

DIM Volume[8192][16]
DIM Frequency[8192][16]
DIM Length[8192][16]
DIM Sample[SampleRate]
DIM Note[120]

Frequency[0][0] = 39
Frequency[1][0] = 42
Frequency[2][0] = 44
Frequency[3][0] = 46
Frequency[4][0] = 47
Frequency[5][0] = 51
Frequency[6][0] = 44
Length[0][0] = 2
Length[1][0] = 2
Length[2][0] = 8
Length[3][0] = 2
Length[4][0] = 2
Length[5][0] = 4
Length[6][0] = 10

Note[0] = 27.5

FOR Count = 1 TO 119
Note[Count] = 1.059463094359 * Note[Count-1]
NEXT

IF OPENFILE(1, "Output.wav", FALSE)		// Save output

FOR CountX = 0 TO 6
FOR CountY = 0 TO Length[CountX][0] * 44100 / 10
INC Count, 1
WRITEBYTE 1, INTEGER((SIN(360/SampleRate*Count*Note[Frequency[CountX][0]])*100)+125)
NEXT
NEXT

CLOSEFILE 1

ENDIF
The source code is in the link I described. Can you tell me what I am seeing here by any chance?
 
Oct 12, 2008 at 2:27 PM
I can has squidburger?
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Sep 14, 2008
Location: Walrus World
Posts: 321
andwhyisit said:
SOF=Simplified ORG Format

I used a file to hex converter and the resulting file I renamed to "access.sof".
The reason for this is that the file is read as text, not as hex, resulting in lost information if if it read in it's natural state. So this "simplified" for importing values into the flash, since letters and numbers are not lost in the conversion.
Would it be possible to make an ORG to SOF converter?

And what exactly are you stuck on? Now you just need to make it play the WAV's from the pitches specified.
 
Oct 12, 2008 at 3:48 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
andwhyisit said:
The source code is in the link I described. Can you tell me what I am seeing here by any chance?
Looks like some flavour of BASIC to me.

innocent.bystander said:
Would it be possible to make an ORG to SOF converter?
I thought he said he did that?

innocent.bystander said:
And what exactly are you stuck on? Now you just need to make it play the WAV's from the pitches specified.
Maybe he's stuck on the pitch changing? Or perhaps Flash can't read binary files? (But then, the WAVs could be embedded in the swf...)
 
Oct 12, 2008 at 11:53 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6222
Age: 39
Pronouns: he/him
Celtic Minstrel said:
Maybe he's stuck on the pitch changing? Or perhaps Flash can't read binary files? (But then, the WAVs could be embedded in the swf...)
It can read the information perfectly, I have the instruments embedded, making it play the music is another thing entirely.

I have no idea where to start.

How many possible notes per second does an org file play at?

Celtic Minstrel said:
Looks like some flavour of BASIC to me.
Never really learnt basic.

innocent.bystander said:
Would it be possible to make an ORG to SOF converter?
Any simple file to hex converter would do it.
 
Back
Top