Difference between revisions of "Windows Tiny Intro"

From SizeCoding
Jump to: navigation, search
Line 9: Line 9:
  
 
=== Sound ===
 
=== Sound ===
TBA
+
There are a few ways to producing sound/music in Tiny Windows Intros.
 +
 
 +
==== Win32 Single Note MIDI ====
 +
Using the built-in MIDI, this requires just 2 calls
 +
* <code>midiOutOpen(midihandle, 0,0,0,0)</code> - To initialise the MIDI
 +
* <code>midiOutShortMsg(midihandle, 0x209035C0)</code> - 4 byte Midi message that sets instrument + plays a single note on channel 0
 +
 
 +
For a full list of Midi commands, check out this webpage: https://computermusicresource.com/MIDI.Commands.html
 +
 
 +
==== Win32 MIDI Player ====
 +
Depending on the sound budget, you can think about including a small MIDI tune instead.
 +
Similar to the single note MIDI approach, but playing multiple notes from data on 1 or more different channels.
 +
 
 +
==== Bytebeat softsynth ====
 +
An alternative option is to use a very simple Bytebeat softsynth (Check out https://bytebeat.demozoo.org if you are not familiar with the concept).
 +
 
 +
This requires an additional setup of the Win32 WaveOut callback, which can then be played and filled realtime with data.
 +
 
 +
For a taste of what is possible with small (<256 character) bytebeats formulas, check out one of the Bytebeat Music competitions from the Lovebyte parties, for example https://demozoo.org/parties/4760/#competition_18623
 +
 
 +
=== Compression ===
 +
Compression for the smaller Windows Tiny Intros are tricky, but there have been some experiments using the Windows Cabinet Decompressor calls
 +
 
 +
These functions allow for MSZIP (deflate) and MSLZ content to be loaded from the binary as payload at the cost of a a few more win32 function imports. Well this might be a good solution for 512 byte intros, the tipping point for Crinkler compression at the moment lies at the 800-850 bytes mark give or take.
 +
 
 +
From cabinet library:
 +
* <code>CreateDecompressor(0x20000002, 0, &HDecompressor)</code> - Create Decompressor object
 +
* <code>Decompress(HDecompressor, CompressedPayload, PackOutputSize, 0x11000, PackInputSize,0)</code> - Decompress payload
 +
 
  
 
== 512 byte intros for Windows ==
 
== 512 byte intros for Windows ==

Revision as of 01:52, 13 April 2024

Introduction

This category is for the tiniest Windows-32 intros, that often use CPU software rendering.

Re-using Windows Header

TBA

Graphics

TBA

Sound

There are a few ways to producing sound/music in Tiny Windows Intros.

Win32 Single Note MIDI

Using the built-in MIDI, this requires just 2 calls

  • midiOutOpen(midihandle, 0,0,0,0) - To initialise the MIDI
  • midiOutShortMsg(midihandle, 0x209035C0) - 4 byte Midi message that sets instrument + plays a single note on channel 0

For a full list of Midi commands, check out this webpage: https://computermusicresource.com/MIDI.Commands.html

Win32 MIDI Player

Depending on the sound budget, you can think about including a small MIDI tune instead. Similar to the single note MIDI approach, but playing multiple notes from data on 1 or more different channels.

Bytebeat softsynth

An alternative option is to use a very simple Bytebeat softsynth (Check out https://bytebeat.demozoo.org if you are not familiar with the concept).

This requires an additional setup of the Win32 WaveOut callback, which can then be played and filled realtime with data.

For a taste of what is possible with small (<256 character) bytebeats formulas, check out one of the Bytebeat Music competitions from the Lovebyte parties, for example https://demozoo.org/parties/4760/#competition_18623

Compression

Compression for the smaller Windows Tiny Intros are tricky, but there have been some experiments using the Windows Cabinet Decompressor calls

These functions allow for MSZIP (deflate) and MSLZ content to be loaded from the binary as payload at the cost of a a few more win32 function imports. Well this might be a good solution for 512 byte intros, the tipping point for Crinkler compression at the moment lies at the 800-850 bytes mark give or take.

From cabinet library:

  • CreateDecompressor(0x20000002, 0, &HDecompressor) - Create Decompressor object
  • Decompress(HDecompressor, CompressedPayload, PackOutputSize, 0x11000, PackInputSize,0) - Decompress payload


512 byte intros for Windows

256 byte intros for Windows

Other Resources