Code Snippets FreeBasic

Short texts FreeBasic 🧑‍💻 Code snippets FreeBasic ✍️ Reading lists FreeBasic 👀

CMM2 tones tracker

‘================================== ‘Tones tracker ‘By Henryk K 2021.07.18 ‘================================== option explicit ‘dim tones(16) dim string note.name$(97) dim float note.freq(97) dim integer note.oct%=4 ‘instruments dim integer i.counter=200 dim integer i.current%=0 dim integer i.waveform%(255) dim float i.amplitude(255,200) dim float i.freq = 0.0 ‘keyboard dim integer s_tab%(255) ‘shift/ctrl/alt modifiers dim string eva$(6,255) ‘eval strings for keyboard matrix const s.nonne […]

Shape events in VBA

VERSION 1.0 CLASS BEGIN MultiUse = -1 ‘True END Attribute VB_Name = “stdShapeEvents” Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False ‘Example.bas ‘ ‘ Dim WithEvents shpEvents As stdShapeEvents ‘ ‘ Sub latchEvents() ‘ Set shpEvents = stdShapeEvents.Create(Sheet2) ‘ Call shpEvents.HookSheet(Sheet2) ‘ End Sub ‘ ‘ Private […]

Colour Maximite 2 tones

dim tones(16) for i=0 to bound(tones())-1 read tones(i) next i tempo=50 for i=0 to 20 a% = rnd * bound(tones()) play tone tones(a%), tones(a%), tempo pause tempo next i end data 105,113,121,131,143,158,175,197,225,263,315,394,525,629,788,1051

invaders game … weekend project

option explicit mode 1,8 dim integer xpos=400, ypos=400 ‘ player positien dim integer xmax, xmin ‘ invader x-bounds dim float xoff=0, yoff=0, dx=1 ‘x-pos invaders dim integer shooter = 0 ‘ spacebar shoot latch dim integer q_action = 0 ‘ Q-key latch dim integer missile_mode = 0, state = 0, state_counter dim integer game_over = […]