
| # | User | Message | Date |
| 153 | Steeve | I got the data using a free MSX emulator (openMSX). The music come from the game "Auf wiedersehen Monty".
You can use a "dump PSG" functionality in openMSX to get the raw data (values of the registers of the PSG).
You can find lot of roms (games) for the msx wich contain cool musics and effects for the AY PSG on www.planetemu.net
Beware, these roms are not freeware even if you can download them freely. Another way (i have not tried), is to use VortexTracker at http://bulba.at.kz/ (see http://www.youtube.com/watch?v=lYdIqcqgkPM for a demo) wich is well designed to compose an manipulate raw data for the AY-* PSG. I think many samples are given too. | 17-Jun 22:10 |
| 152 | Sunanda | Can any one help me reply to this question (received via REBOL.org's feedback form)? Thanks! << Where can I find more Hex Code like in psg-ay-3-8910-study.r Please point me to a tool that I can use for development of Sound Code for the AY-3-8910 where I end up with Hex Code that I can then load into EPROMs which would drive the AY-3-8910. Thanks for any help. http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=psg-ay-3-8910-study.r >> | 17-Jun 15:56 |
| 151 | Anton | Josh, recording ? There are only OS specific ways so far. | 24-Jun-06 9:28 |
| 150 | james_nak | Nice Rebolek! | 23-Jun-06 20:06 |
| 149 | Josh | There isn't a way to do sound input directly from rebol is there? | 23-Jun-06 19:02 |
| 148 | Thør | . | 4-Apr-06 19:01 |
| 147 | Rebolek | Oh, and the Melody button does not work too. | 2-Feb-06 20:47 |
| 146 | Rebolek | There's also some unfinished documentation included. Things that does not work: init sound (first button), LFO (black square button right to envelope button) and playing empty sound. That's what I remember for sure. But editing sound, creating, saving to own format and exporting to WAV works. Have fun. | 2-Feb-06 20:47 |
| 145 | Rebolek | You can change waves, adjust modulation, filter, envelopes, wave shaper, bit crusher and so on... | 2-Feb-06 20:45 |
| 144 | Rebolek | Then press fifth button (compute sound) and wait. Press last button (play sound, looks like triangle) and it should play a sound. | 2-Feb-06 20:44 |
| 143 | Rebolek | Anyway, it works. In the bottom row, there are six buttons. Press second button (load sound) and go to %sounds/ directory. Select a sound and open it. | 2-Feb-06 20:43 |
| 142 | Rebolek | It's pretty sub-alpha version. Some buttons do not work, some buttons crash the application. I know that so you do not have to report bugs, it's full of them. | 2-Feb-06 20:42 |
| 141 | Rebolek | I said I'll release Sintezar after Competition. Compo is over, so, I'm releasing it :) Download it from http://krutek.info/rebol/SintezarPM101.ZIP . Unpack it somewhere and run %sintezar_pm-101.r I hope it should work. | 2-Feb-06 20:41 |
| 140 | Rebolek | :) | 18-Sep-05 20:37 |
| 139 | Kaj | That which we call a siren, by any other name would sound as sweet? | 18-Sep-05 19:45 |
| 138 | Rebolek | (don't expect that 'bell' sounds like bell, 'violin' like violin and so on. it's just a name :-) | 18-Sep-05 18:22 |
| 137 | Rebolek | 14 demo sounds - http://krutek.info/rebol/sounds1.zip | 18-Sep-05 18:19 |
| 136 | Rebolek | I've got some demo-sounds ready, I'll post them today or tomorrow. | 17-Sep-05 17:30 |
| 135 | Rebolek | I said that REBOL plays sound in 22kHz/8bit, but that's not true. At least here, after some tests I'm pretty sure that it's 11kHz/8bit. | 17-Sep-05 17:30 |
| 134 | Volker | seems you could post some sounds now? :) | 15-Sep-05 20:25 |
| 133 | Rebolek | http://krutek.info/pix/PM101.png (work in progress) | 15-Sep-05 19:05 |
| 132 | Rebolek | BTW, WAV saver is ready, so I'll do some demo-sounds and fixes and release it ASAP ;) | 15-Sep-05 18:58 |
| 131 | Rebolek | It's really problem, but on the other hand, I can hear that Sintezar is much much better with sound than I thought on listening test done in REBOL :) | 15-Sep-05 18:57 |
| 130 | Rebolek | I've got some Intel chipset soundcard in work, but here at home I've got M-Audio Delta 1010LT and the results are same (sound results, sample/data looks different). | 15-Sep-05 18:55 |
| 129 | Rebolek | REBOL does definitely play sounds in 22kHz/8bit. You can hear the quantisation noise in low volume and everything sounds so filtered. | 15-Sep-05 18:54 |
| 128 | Rebolek | Romano I think it does not depend on system version but on soundcard (or drivers probably) | 15-Sep-05 17:08 |
| 127 | Romano | Here under XP and REBOL/View 1.3.1.3.1, both example (mono and stereo) work, 2 sample/data is not changed after insert. | 15-Sep-05 17:06 |
| 126 | Ingo | Well, whatever, sound in Rebol seems to be more or less unusable. | 15-Sep-05 16:59 |
| 125 | Ingo | Yes, that may be the case. | 15-Sep-05 16:59 |
| 124 | Rebolek | Anyway, I think it's bad behaviour. The data should remain same (the can be changed internaly when playing but users must see same data). | 15-Sep-05 16:50 |
| 123 | Rebolek | Probably depends on sound hardware, because I've testing this previously and I was getting different results on my home computer and my work computer | 15-Sep-05 16:48 |
| 122 | Ingo | Btw, I get different values, and the stereo version plays a sound for me | 15-Sep-05 16:47 |
| 121 | Ingo | It seems sound data is only changed on first insert, though. | 15-Sep-05 16:47 |
| 120 | Pekr | the question is - AGG for vectors, is one of two best free libraries - Cairo and AGG ... so - how is fmod quality wise? Is there any better, smaller library to have? | 15-Sep-05 14:06 |
| 119 | Pekr | RT's investor? :-) First I would try to talk to those folks, then to speculate about how much it will be. Maybe there is some amigan inside the group :-) | 15-Sep-05 14:05 |
| 118 | Rebolek | fmod? why not. but who's going to pay the license? | 15-Sep-05 13:53 |
| 117 | Pekr | now let's convince Carl, that as AGG was good choice for vectors, we should find another library for sound. Maybe fmod? | 15-Sep-05 13:40 |
| 116 | Pekr | simply put, rebol sound quality and buggy behavior deserves to be put into trashcan ;-) | 15-Sep-05 13:40 |
| 115 | Rebolek | Another thing - REBOL sounds different compared to other players. It's noisy and dull. I've got 44100Hz/16bit sound and it sound's more like 22050/8bit to my ear. | 15-Sep-05 12:54 |
| 114 | Rebolek | >> insert sound-port sample == 115000 >> sample/data == #{ 80808080808080808080808080808080808080808080807F7F7F7F7F7F7F7F7F 7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F... | 15-Sep-05 9:56 |
| 113 | Rebolek | >> sample/data == #{ 827EA55BC53BDF21F30DFD03FE02F40CE21EC838A957867A649C43BD27D911EF 05FB02FE08F818E831CF4FB1718F817EA45BC43BDE21F20DFC03FD02F30C... | 15-Sep-05 9:56 |
| 112 | Rebolek | if you look at sample/data after inserting sample to sound:// they're changed | 15-Sep-05 9:49 |
| 111 | Rebolek | This is stereo example - plays nothing | 15-Sep-05 9:48 |
| 110 | Rebolek | print "Play a ping sound..." ; (init event system too) ; Generate a ping waveform as a binary value: ping: #{} for amplitude 500 1 -1 [ for phase 1 360 16 [ val: 128 + to-integer 127 * sine phase val: amplitude * val / 500 append ping to-char val append ping to-char 256 - val ] ] ; Set up the sound sample parameters: sample: make sound [ rate: 44100 / 2 channels: 2 bits: 8 volume: 0.5 data: #{} ] ; Make the ping sound 10 times: loop 10 [append sample/data ping] ; Play the sound now: sound-port: open sound:// insert sound-port sample wait sound-port close sound-port | 15-Sep-05 9:47 |
| 109 | Rebolek | this is mono example - plays ping sound | 15-Sep-05 9:47 |
| 108 | Rebolek | print "Play a ping sound..." ; (init event system too) ; Generate a ping waveform as a binary value: ping: #{} for amplitude 500 1 -1 [ for phase 1 360 16 [ val: 128 + to-integer 127 * sine phase val: amplitude * val / 500 append ping to-char val ;append ping to-char 256 - val ] ] ; Set up the sound sample parameters: sample: make sound [ rate: 44100 / 2 channels: 1 bits: 8 volume: 0.5 data: #{} ] ; Make the ping sound 10 times: loop 10 [append sample/data ping] ; Play the sound now: sound-port: open sound:// insert sound-port sample wait sound-port close sound-port | 15-Sep-05 9:47 |
| 107 | Rebolek | OK | 15-Sep-05 9:47 |
| 106 | Rebolek | Wait a minute, I'll post fixed version | 15-Sep-05 9:43 |
| 105 | Rebolek | I didn't test it before pasting it here | 15-Sep-05 9:43 |
| 104 | Rebolek | Ingo: yes there are some bugs ;) | 15-Sep-05 9:35 |
| 103 | Ingo | Now that's interesting ... if I paste your example into a console, I get a very short high beep if I paste it into a script and do the script, I get a math error! (Math or number overflow) | 15-Sep-05 9:14 |
| 102 | Ingo | Thanks Kru, I reread that part, and actually found Carl's explanation. | 15-Sep-05 9:11 |
| 101 | Rebolek | Ah there's bug in example, it should be "128 - val" instead of "400 - val" but that's not the problem | 15-Sep-05 8:05 |
| 100 | Pekr | RAMBO it! | 15-Sep-05 8:03 |
| 99 | Rebolek | Sound is buggy as something really buggy. | 15-Sep-05 8:02 |
| 98 | Rebolek | There's some strange conversion always when you play a sound. | 15-Sep-05 8:02 |
| 97 | Rebolek | >> sample/channels == 1 >> sample/channels: 2 == 2 >> insert sound-port sample == 199 >> sample/channels == 1 | 15-Sep-05 8:02 |
| 96 | Rebolek | And here's why: | 15-Sep-05 8:02 |
| 95 | Rebolek | The problem is that it does not work (at least here). | 15-Sep-05 8:01 |
| 94 | Rebolek | print "Generating sound..."
bounceL: #{}
bounceR: #{}
repeat modulate 20 [
delta: negate log-2 modulate
for amplitude 400 1 delta [
for phase 1 360 16 [
val: 128 + to-integer 127 * sine phase
val: amplitude * val / 400
append bounceL to-char val
append bounceL to-char 400 - val
]
]
] bounce: #{} repeat i 400 [ insert tail bounce bounceL/:i insert tail bounce bounceR/:i ] ; Set up the sound sample parameters: sample: make sound [ rate: 44100 / 2 channels: 2 bits: 8 volume: 0.5 data: bounce ] ; Play the sound now: sound-port: open sound:// insert sound-port sample wait sound-port close sound-port | 15-Sep-05 8:00 |
| 93 | Rebolek | Example based on example in Carl's sound guide: | 15-Sep-05 8:00 |
| 92 | Rebolek | For sound samples with two channels both channels are interleaved, i.e. samples for each channel alternate within the binary. | 15-Sep-05 7:55 |
| 91 | Rebolek | http://www.rebol.com/docs/sound.html#section-7 | 15-Sep-05 7:55 |
| 90 | Ingo | OK, is there an example anywhere that shows how to create stereo sound? So far I haven't found one. | 15-Sep-05 7:43 |
| 89 | Rebolek | You must create sound with stereo effect. Once you insert something to sound:// you lost control and cannot change even the volume. | 15-Sep-05 6:44 |
| 88 | Ingo | When I create a sound using Rebol, with 2 channels, is it possible to access the to channels independently? So as to create a stereo effect? | 14-Sep-05 22:07 |
| 87 | Henrik | uploaded. if you get a new version with a new screenshot, you can upload it yourself, but you need an account to upload images... otherwise throw the link in the wikibook group | 8-Sep-05 20:45 |
| 86 | Henrik | will see if I can upload it in a few mins. | 8-Sep-05 18:40 |
| 85 | Rebolek | Henrik why not. But the GUI is not 100% finished so I hope it can be later replaced with better picture. | 8-Sep-05 18:38 |
| 84 | Henrik | kru, would you mind if we use this as a VID showcase in the Wikibook? | 8-Sep-05 15:31 |
| 83 | Anton | Mmm.. nice picture... | 8-Sep-05 15:17 |
| 82 | Volker | Thanks :) maybe if you make it ready for c, i could do the rest. means make it use structures, not relying on contexts etc. for the time-critical things. | 8-Sep-05 13:31 |
| 81 | Rebolek | Volker lot of things, really :) I'd like to finish features mentioned above and then translate all computations to C. I'll let you now, thank you. | 8-Sep-05 13:29 |
| 80 | Volker | if you have something to translate to c, tell me. | 8-Sep-05 13:28 |
| 79 | Rebolek | But it's slow. rebcode! will be great for this | 8-Sep-05 13:27 |
| 78 | Rebolek | Sounds very green ;)) | 8-Sep-05 13:26 |
| 77 | Rebolek | two or three things still missing: WAV saver, Vibrato and probably something else. At least WAV saver must be finished before release. | 8-Sep-05 13:26 |
| 76 | Volker | Does the sound sound "green" like this? :) | 8-Sep-05 13:24 |
| 75 | Geomol | That is soo cool! :-) | 8-Sep-05 13:22 |
| 74 | Rebolek | Volker so you're interested what's possible with better sound? Me too. But I can tell you, what is possible with today's sound. This - http://krutek.info/pix/pdsynth.png ;))) | 8-Sep-05 13:17 |
| 73 | Geomol | Moog producs: http://www.moogmusic.com/detail.php Amazing! | 23-Aug-05 10:18 |
| 72 | Rebolek | Bob Moog, inventor of famous synthesizers, died at age 71. Sad day for electronic music. http://www.moogmusic.com | 23-Aug-05 7:24 |
| 71 | Luca | Thank you, it is exactly what I was looking for. | 22-Aug-05 7:40 |
| 70 | Rebolek | luca: take a look at http://www.rebol.com/docs/sound.html , it's googd start. there are examples how to synthetize simple sine wavew and how to apply some envelope on it. | 22-Aug-05 6:12 |
| 69 | Luca | I know Rebol quite well but I don't know music. Can anybody point me to a white paper/tutorial/newbie docs/samples that explains how to valorize sound/data to play some notes? Thank you. | 21-Aug-05 20:05 |
| 68 | Rebolek | If floating point is fast enough today, it's better to use FP because of resolution | 16-Aug-05 13:04 |
| 67 | Rebolek | I'm using this code (and I really hope there's some better solution): >> insert tail sample do rejoin ["#{" skip to-hex to integer! (sample-value + 1) * 32767.5 4 "}"] | 16-Aug-05 13:03 |
| 66 | Volker | math with fpu should be comparable in speed today. i try it. | 16-Aug-05 13:03 |
| 65 | Rebolek | sou=so | 16-Aug-05 13:02 |
| 64 | Rebolek | but because there's no difference in speed of integer and FP math in REBOL, everything is done in FP sou it's needed to convert FP to 16-bit integer | 16-Aug-05 13:01 |
| 63 | Rebolek | then just >>insert tail sound buffer/data | 16-Aug-05 13:00 |
| 62 | Rebolek | buffer: context [ length: 256 data: make block! length init: does [ data: make block! length ] fill: func [fnc][ init loop length [ insert tail data do fnc data ] ] ] | 16-Aug-05 13:00 |
| 61 | Rebolek | I'm filling a buffer of 256 bytes so I can change parametres in realtime (buffer is filled, GUI works again, I can fiddle with knobs) and then I add buffer's content to some sound [block!] | 16-Aug-05 13:00 |
| 60 | Rebolek | yes there's a loop | 16-Aug-05 12:58 |
| 59 | Volker | Is there a loop around that? | 16-Aug-05 12:41 |
| 58 | Rebolek | switch-range: func [number blk][ foreach [rfrom rto action] blk [ if not number? rfrom [rfrom: get rfrom] if not number? rto [rto: get rto] if all [number >= rfrom number < rto][return do action] ] ] | 16-Aug-05 12:35 |
| 57 | Rebolek | it's just support function | 16-Aug-05 12:34 |
| 56 | Volker | where does switch-range come from? | 16-Aug-05 12:34 |
| 55 | Rebolek | with DCW you control shape of waveform. DCW-0 is sine waveform, DCW-1 is (square, saw, triangle) | 16-Aug-05 12:34 |
| 54 | Rebolek | and wave function - produces actual sound | 16-Aug-05 12:33 |
| 53 | Rebolek | basics are 'phaser function - updates oscillator phase | 16-Aug-05 12:33 |
| 52 | Rebolek | it supprots three different waveform (still six missing to recreate my CasioCZ ;) | 16-Aug-05 12:32 |
| 51 | Rebolek | PWM should be always 0.5 (it's from some older version) | 16-Aug-05 12:32 |
| 50 | Volker | Thats the right size to refresh my knowledge :) | 16-Aug-05 12:32 |
| 49 | Rebolek | right here ') | 16-Aug-05 12:31 |
| 48 | Rebolek | osc: context [ phase: 0 AM: 1 ;Amplitude modulation PWM: 0.5 ;Pulse width modulation DCW: .5 ; phase transition between sine and other wave [0 - 1] wave-length: 400 ;wave-length is sample-rate / frequency - don't wanna have samplerate here algorithms: [ saw [ d: (1 - dcw) / 2 cosine 360 * switch-range ph [ 0 d [ph * (pwm / d)] d 1 [(ph - d / (1 - d)) * pwm + pwm] ] ] square [ d: 1 / max 1e-50 (1 - dcw) cosine 360 * switch-range ph reduce [ 0 .25 [ph * 4 ** d / 4] .25 .5 [(abs ph - .5) * 4 ** d / 4 + .5] .5 .75 [ph * 4 - 2 ** d / 4 + .5] .75 1 [(abs ph - 1) * 4 ** d / 4 + 1] ] ] triangle [ ;triangle is d~.588888 d: 1 - (dcw * .41111) ;1 / max 1e-50 (1 - dcw) cosine 360 * switch-range ph reduce [ 0 .25 [ph * 4 ** d / 4] .25 .5 [(abs ph - .5) * 4 ** d / 4 + .5] .5 .75 [ph * 4 - 2 ** d / 4 + .5] .75 1 [(abs ph - 1) * 4 ** d / 4 + 1] ] ] ] algorithm: 'saw curves: copy [] forskip algorithms 2 [append curves to string! algorithms/1] phaser: func [][ phase-per-byte: 1 / wave-length phase: phase + phase-per-byte if phase > 1 [phase: phase - 1] phase ] wave: func [ ][ ph: phaser do select algorithms algorithm ] | 16-Aug-05 12:31 |
| 47 | Volker | where do i find it? | 16-Aug-05 12:31 |
| 46 | Rebolek | you can try this Phase Distortion I wrote yesterday | 16-Aug-05 12:31 |
| 45 | Volker | Where to start? | 16-Aug-05 12:29 |
| 44 | Rebolek | That should be great | 16-Aug-05 12:29 |
| 43 | Volker | Can i try t translate that? | 16-Aug-05 12:28 |
| 42 | Rebolek | I've got phase-distortion oscillator, FM oscillator, wavetable oscillator and my exponential oscillaor plus four types of filters and it's really time consuming in REBOL | 16-Aug-05 12:28 |
| 41 | Rebolek | No I probably have to rewrite all my routines to C. I haven't started working on FFT at all. | 16-Aug-05 12:27 |
| 40 | Rebolek | but I haven't tried it yet. | 16-Aug-05 12:27 |
| 39 | Volker | so you only need stubs? | 16-Aug-05 12:26 |
| 38 | Rebolek | there's fft C library, http://www.fftw.org/ | 16-Aug-05 12:26 |
| 37 | Volker | i don't know the math, but i may be able to translate rebol to c. | 16-Aug-05 12:23 |
| 36 | Volker | that needed c-part, fft. | 16-Aug-05 12:22 |
| 35 | Pekr | Syntezar's? | 16-Aug-05 12:21 |
| 34 | Rebolek | sorry, what prototype? | 16-Aug-05 12:21 |
| 33 | Volker | Can you write prototype in rebol, and i try my c-skills? | 16-Aug-05 11:58 |
| 32 | Pekr | I worked with image data in external library, was not all that difficult. Forget C ++, use C. But then - image data is just repetitive pattern of RGBA values, so maybe working with sound data will be much more difficult ... | 16-Aug-05 8:13 |
| 31 | Rebolek | Pekr yes, external library call can solve it (partially). I have to install some C/C++ SDK and start to learn it again... | 16-Aug-05 8:00 |
| 30 | Pekr | JIT (VM) for some specific tasks could be sufficient too, but we can only hope here. The only realistical thing is to use what we have now - other tool than REBOL ;-), or library calls .... | 16-Aug-05 7:31 |
| 29 | Pekr | first comes faster CPUs :-) What about producing language extension? Ah, we did not get any yet, sorry, I forgot, it is long time we were promissed to get those ;-) Hmm, but what about external library calls? Could do the trick, no? If you use gcc, you should be able to compile for main platforms at least ... | 16-Aug-05 7:30 |
| 28 | Anton | (He he he....) | 16-Aug-05 7:00 |
| 27 | Rebolek | fast fourier transformation. no way in current rebol (to much computations). On my Athlon XP 1700+ can REBOL do some 3milions computations in second (this is very aproximate number, some computaions are more time-consuming than other ). May sound like a big number, but if sound's sample rate is 44100Hz, there's only some 70 computations for each sample. And this is the ideal situation (no GUI and other CPU-demanding stuff). So there are two possibilities. 1) Some faster math, or JIT REBOL compiler and 2) wait for faster CPU's. Let's see what comes first. | 16-Aug-05 6:45 |
| 26 | Benjamin | i love those fancy bars from winamp or wmp how they do that ? how they get the khz and hz and all that from the wav file ? suposing it is a wav ... (raw or pcm) | 16-Aug-05 3:34 |
| 25 | Anton | But very good. Inspirational, indeed. | 15-Aug-05 16:07 |
| 24 | Anton | Very nice looking ! May I criticise your knobs though ? They are a bit big. Before long, you won't have any room left ! :) I suggest make them half the size in width and height. | 15-Aug-05 16:05 |
| 23 | Rebolek | Antor if you're interested, here's a screenshot of work in progress - http://krutek.info/pix/sintezar.jpg | 15-Aug-05 15:40 |
| 22 | Anton | Sounds good Kru, would like to look at it when you're ready. | 15-Aug-05 15:30 |
| 21 | Rebolek | unfortunately there's missing page 2 in the document. however if anybody is interested in synthesis, next version of sintezar is going to have five different oscilators, four filters, three waveshapers (these units are ready now) plus some other units (phaser is ready, i'm working on delay). I wrote some basic sequencer last week, so only some preset management system is missing and some work on GUI (drag and drop for connecting modules is ready, but I still have to rewrite all modules to support it) | 15-Aug-05 13:58 |
| 20 | Jean-François | By way of Christian's site | 15-Aug-05 2:56 |
| 19 | Jean-François | Here an article that could be usefull someday http://dafx04.na.infn.it/WebProc/Proc/P_201.pdf | 15-Aug-05 2:41 |
| 18 | Gregg | This is a known issue. RT wants to address sound at some point, but I'm not sure where it falls in the priority queue. | 27-Jun-05 19:54 |
| 17 | Rebolek | yes, it's modified randomly, I've done some test but the results were different all the time so I felt lost | 27-Jun-05 10:56 |
| 16 | Anton | The modification keeps happening, if you play different samples alternately, each sample is modified randomly, converted to a random mode. Gradually the sample becomes noisy due to rounding errors in the conversions. | 27-Jun-05 10:40 |
| 15 | Rebolek | coz it's really confusing me | 27-Jun-05 10:35 |
| 14 | Rebolek | IMO this modification - if it's needed - should be invisible to user | 27-Jun-05 10:35 |
| 13 | Anton | Yes, I have already found this "modification" problem. | 27-Jun-05 10:34 |
| 12 | Vincent | sound has a lot of problems:
the .wav data source is modified at loading
a low-q sample seems to force a permanent low-q to all successive samples
samples are adapted (=modified) to audio capabilities at first use, if 'rate or 'bits are not the default values. the only way to play samples without these problems is to: - open the sound port - insert a copy of the sample/sound object - close the port for each sound. | 27-Jun-05 10:23 |
| 11 | Rebolek | it still changes resolution to 8bit and channels to 2 | 27-Jun-05 9:03 |
| 10 | Rebolek | print "Play a simple tone..." ; (init event system too) ; Generate a sine wave tone (1 cycle of the wave): tone: #{} for phase 1 360 6 [ val: 32768 + to-integer 32767 * sine phase repend tone [to char! to integer! val / 256 to char! to integer! val // 256] ] ; Set up the sound sample parameters: sample: make sound [ rate: 44100 channels: 1 bits: 16 volume: 0.5 data: #{} ] ; Repeat the sine wave for 1000 cycles: loop 1000 [append sample/data tone] ; Play the tone now: ? sample sound-port: open sound:// insert sound-port sample ? sample wait sound-port close sound-port | 27-Jun-05 9:03 |
| 9 | Rebolek | I've changed example from documentation to produce 16bit sound instead of 8bit | 27-Jun-05 9:03 |
| 8 | Rebolek | bug probably? | 27-Jun-05 7:58 |
| 7 | Rebolek | I really don't understand why | 27-Jun-05 7:58 |
| 6 | Rebolek | wav does change after inserting into sound port | 27-Jun-05 7:58 |
| 5 | Rebolek | and look at debug output in console | 27-Jun-05 7:57 |
| 4 | Rebolek | snd: load http://krutek.info/rebol/sound.r view layout [ button "play" [ wav: make sound [rate: 22050 data: snd] print "make wav" ? wav sndport: open sound:// insert sndport wav print "insert sound" ? wav close sndport ] ] | 27-Jun-05 7:57 |
| 3 | Rebolek | try following code | 27-Jun-05 7:57 |
| 2 | Rebolek | And here is my first problem | 27-Jun-05 7:57 |
| 1 | Rebolek | I've started this groub to discuss sound in REBOL | 27-Jun-05 7:57 |