Liberty BASIC Community Forum
« Search Results »

Welcome Guest. Please Login or Register.
Feb 26th, 2017, 5:54pm


Rules|Home|Help|Search|Recent Posts|Notification

--Liberty BASIC Resources--
Liberty BASIC Community WikiSpace
Frequently Asked Questions
Bay Six Software Forum
Liberty BASIC Home Page
Carl Gundel's Blog
Official Liberty BASIC Support
Liberty BASIC Programmer's Encyclopedia
Liberty BASIC on Rosetta Code

Search Results

Total results: 10


 1   General Board / Re: rs232 without chr$(13),chr$(10) is possible?  on: Today at 5:01pm
Started by monini64 | Post by monini64
thanks for answer, an the other question how read ¨n¨bytes without chr$(13),chr$(10) is possble
 
  Reply Quote Notify of replies

 2   General Board / Re: rs232 without chr$(13),chr$(10) is possible?  on: Today at 2:25pm
Started by monini64 | Post by Rod
Yes, very possible. When you send the message with the print command use the ; character to suppress the CRLF character pair.

So print #port, msg$;

When reading it matters less, you will get the msg$ in the buffer with or without the CRLF pair.


http://lbpe.wikispaces.com/AccessingSerialPort
 
  Reply Quote Notify of replies

 3   General Board / rs232 without chr$(13),chr$(10) is possible?  on: Today at 1:37pm
Started by monini64 | Post by monini64
i need send a message for rs232 port but i need this havent chr$(13) and chr$(10) is possible?
Furthermore, i need received "n" bytes but the string havent chr$(13) and chr$(10)
i need, any think like this, read rs232 port "n" byte, is possible?
thanks in advance



 
  Reply Quote Notify of replies

 4   Liberty BASIC Code / Re: midi test  on: Today at 08:19am
Started by bluatigro | Post by Rod
The code works to an extent. You may be having problems because your code fails and leaves the midi port open. Close down Liberty BASIC and restart to fix that issue.

The second reason is that setting stereo volume is not supported by all midi devices. Mine returns error 8, function not supported.

If I rem out your volume setting the code runs as expected, you could allow return values 0 and 8 to proceed.
 
  Reply Quote Notify of replies

 5   Liberty BASIC Code / midi test  on: Today at 07:01am
Started by bluatigro | Post by bluatigro
i tryed to change a exaple

error :
midi open error

Code:
''bluatigro 26 feb 2017
''midi test
''code copyed and changed from :
''http://lbpe.wikispaces.com/MidiMapper

struct m , a$ as ptr

if midi.open() then
  notice "MIDI OPEN ERROR !!"
  end
end if
global hMidiOut
hMidiOut = m.a$.struct 'handle to midi device
if midi.volume( 255 , 255 ) then
  notice "MIDI VOLUME ERROR !!"
  end
end if
for voice = 0 to 10
  print "voice = " ; voice
  call midi.msg msg.change( voice , 127 )
  call midi.msg msg.play.note( 48 )
  call sleep 1000
next voice
call midi.msg 128 ''stop all notes
if midi.close() then notice "MIDI CLOSE ERROR !!"

end

sub sleep ms
 CallDLL #kernel32, "Sleep" _
 , ms As long _
 , ret As void
end sub

function msg.play.note( note )
  ''note = 48 'play C note
  event = 144 'event 144 = play on channel 1
  low = ( note * 256 ) + event
  velocity = 127
  hi = velocity * 256 * 256
  msg.play.note = low + hi
end function

function msg.change( voice , velocity )
  event = 192 'event 192 = change
  ''voice = values 0-127 : 19 = church organ
  ''velocity = 127
  low = ( voice * 256 ) + event
  hi = velocity * 256 * 256
  msg.change = low + hi
end function

sub midi.msg dwMsg
  CallDLL #winmm , "midiOutShortMsg" , _
  hMidiOut As ulong , _ 'handle to opened device
  dwMsg As ulong , _ 'message
  ret As ulong
end sub

function midi.volume( l , r )
  midiVol = ( r * 256 ) + l
  calldll #winmm , "midiOutSetVolume" , _ 'set volume for midi playback
  hMidiOut as ulong , _ 'handle to midi device
  midiVol as ulong , _ 'volume
  midi.volume As ulong
  '0=success (MMSYSERR_NOERROR = 0)
end function

function midi.open()
  CallDLL #winmm , "midiOutOpen" , _
  m As struct , _ 'address of midiOut handle
  -1 As ulong , _ 'ID of MIDI output device
  0 As ulong , _ 'callback, not used
  0 As ulong , _ 'callback instance, not used
  0 As ulong , _ 'callback event flag, not used
  midi.open As ulong
  '0=success (MMSYSERR_NOERROR = 0)
end function

function midi.close()
  CallDLL #winmm , "midiOutClose",_
  hMidiOut As ulong ,_ 'handle to opened device
  midi.close As ulong
  '0=success (MMSYSERR_NOERROR = 0)
end function

 

 
  Reply Quote Notify of replies

 6   Game and Graphic Programming / Re: open gl : robot walking  on: Feb 24th, 2017, 08:50am
Started by bluatigro | Post by CryptoMan
Awesome.

But it is running very slowly in LB4.5
 
  Reply Quote Notify of replies

 7   Novice / Re: as sending an automatic email?  on: Feb 24th, 2017, 07:31am
Started by YACKARE | Post by YACKARE
Tkanks you very much. It's ok.
 
  Reply Quote Notify of replies

 8   Novice / Re: as sending an automatic email?  on: Feb 22nd, 2017, 1:43pm
Started by YACKARE | Post by Chris Iverson
Same way as email. Just change the msg$ variable in your demo to be the URL you want to open. (Make sure to specify the full URL, including http:// or https://)
 
  Reply Quote Notify of replies

 9   Liberty BASIC Code / LB 'bomb'- program runs another copy of itself  on: Feb 22nd, 2017, 08:24am
Started by tenochtitlanuk | Post by tenochtitlanuk
PUBLIC HEALTH WARNING... experiment at your peril! You may lose control of your computer and have to reset if you modify the main code!
Code:
    nomainwin

    UpperLeftX   = 10 +int( 600 *rnd( 1))
    UpperLeftY   = 10 +int( 400 *rnd( 1))
    WindowWidth  =300 +int( 200 *rnd( 1))
    WindowHeight =240 +int( 200 *rnd( 1))

    open "Scared yet???!!!???" for graphics_nsb as #wg

    #wg "trapclose [quit]"
    bg$ =str$( int( 256 *rnd( 1))); " ";  str$( int( 256 *rnd( 1))); " ";  str$( int( 256 *rnd( 1)))
    #wg "down ; fill "; bg$
    #wg "backcolor "; bg$
    #wg "font 120"
    #wg "color ";  int( 256 *rnd( 1)); " ";  int( 256 *rnd( 1)); " ";  int( 256 *rnd( 1))
    #wg "up ; goto 20 200 ; down"
    #wg "\Yo!"

    if rnd( 1) <0.05 then [quit2]
    timer 1200, [quit]
    wait

  [quit]
    run "/home/john/.wine/drive_c/Program Files (x86)/Liberty BASIC v4.5.0/liberty.exe -r -a " + "Z:\home\john\LB\bomb\bomb.bas"
  [quit2]
    close #wg
    end
 

Load the code; save it to a chosen directory. Modify the address and program name in the 'run' line to match the name and filepath you used. Similarly, modify the path to 'liberty.exe'. ( NB My paths are unique to my Linux installation) . .
. . *** If you don't understand how to do that, don't try the code! ***

When you run the code, it will open a window, and run another copy of itself after a short interval. Feel free to try to close these windows...

Relax! Wait a while and it will quit...

EDIT What happens if you double-up the 'run' line? Chain reaction??
 
  Reply Quote Notify of replies

 10   Novice / Re: as sending an automatic email?  on: Feb 22nd, 2017, 02:58am
Started by YACKARE | Post by YACKARE

 
  Reply Quote Notify of replies


Rules|Home|Help|Search|Recent Posts|Notification



Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls