Log In  

Elevated by RGBA and TBC is pretty awesome: http://www.pouet.net/prod.php?which=52938

One of the cool things (among the many very, very, cool things) is the lights in the sky which match / mimic / are simultaneous with certain notes in the music.

In order to have a similar effect, I think I would have to understand how/where the state of the tracker is stored in the RAM?

Anyone have any hints?

P#10463 2015-05-04 16:57 ( Edited 2018-08-18 14:03)

You can use some undocumented parameters of stat(n) for this

16..19 gives you the sfx currently playing on each channel or -1 for none
20..23 gives you the currently playing row number (0..31) or -1 for none

Note that the row number may not be very precise depending on what is going on with the host operating system's audio mixer. Also in the case of the web player which needs to have a large mixing buffer, the result is often slightly earlier that what is audible.

P#10719 2015-05-16 18:20 ( Edited 2015-05-16 22:33)

PEEK() / POKE() the audio data:

0x3100..0x31ff (256 bytes)

64 patterns, each with 4 bytes:
byte 0: 7-bit pattern index + high bit means 'Loop Start'
byte 1: 7-bit pattern index + high bit means 'Loop End'
byte 2: 7-bit pattern index + high bit means 'Stop'
byte 3: 7-bit pattern index + high bit unused

0x3200..0x42ff (4352 bytes)

64 sounds, each with 68 bytes of data:
The first 64 bytes is the 32 notes, each note takes 16 bits:
byte 0 bits 0..5 : note value (0..63) -- 0 means C-1
byte 0 bits 6..7 : low bits of instrument value (encodes 0..3)
byte 1 bit 0 : high bit of instrument value (encodes +4)
byte 1 bits 1..3 : volume (0..7)
byte 1 bits 4..6 : effect (0..7)

Then 4 bytes for:
Editing mode (0 = tracker, 1 = frequency graph) // not relevant during runtime
Sound Speed
Loop Start
Loop End

P#10720 2015-05-16 18:32 ( Edited 2015-05-16 22:34)
1

p.s. poking live audio data isn't very well defined yet! Maybe best to avoid poking sounds as they are playing. But /demos/jelpi.pi with corrupt_mode = true seems to work ok.

P#10721 2015-05-16 18:35 ( Edited 2015-05-16 22:35)

THANK YOU!

P#10736 2015-05-17 06:29 ( Edited 2015-05-17 10:29)

"bits 0..5" are these the most or least significant bits? Confused a little on the order, here.

P#55358 2018-08-18 03:03 ( Edited 2018-08-18 07:03)

function sndadjust(id,spd,inst,oct)

local byte=id*68+3200

--octave

for byte, byte+62, +2 do
poke((value\12)+oct*12)

--instrument
--do a thing to reset this value to zero first

for byte, byte+62, +2 do
poke(value+=(inst\4)*64)

for 1, 63, +2 do
poke(value+=(inst/4))

--speed

poke(byte+65=spd)

end

I bet these have to be all changed to hex first, though...

Just seeing if I'm heading in the right direction. Only poking I've been doing previously is on Facebook.

P#55368 2018-08-18 10:03 ( Edited 2018-08-18 14:03)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 16:30:42 | 0.007s | Q:17